Class Vector2d
java.lang.Object
de.placeblock.betterinventories.util.Vector2d
Vector class to specify positions in GUIs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a Vector to this Vectorstatic Vector2dClamps a Vector to two VectorsbooleanNew equals method comparing just x and yinthashCode()static Vector2dlargest(Collection<Vector2d> vectors) Calculates the largest Vectorstatic Vector2dCalculates the maximum of two Vectorsstatic Vector2dCalculates the minimum of two VectorsSubtract a Vector from this VectortoString()
-
Constructor Details
-
Vector2d
public Vector2d()Creates a new Vector with 0-values
-
-
Method Details
-
subtract
Subtract a Vector from this Vector- Parameters:
vector2d- The Vector- Returns:
- The new Vector
-
add
Adds a Vector to this Vector- Parameters:
vector2d- The Vector- Returns:
- The new Vector
-
equals
New equals method comparing just x and y -
hashCode
public int hashCode() -
toString
-
largest
Calculates the largest Vector- Parameters:
vectors- The Vectors- Returns:
- The largest Vector
-
max
Calculates the maximum of two Vectors- Parameters:
vector1- The first Vectorvector2- The second Vector- Returns:
- The new Vector
-
min
Calculates the minimum of two Vectors- Parameters:
vector1- The first Vectorvector2- The second Vector- Returns:
- The new Vector
-
clamp
Clamps a Vector to two Vectors- Parameters:
vector- The Vector to clampmin- The minimum Vectormax- The maximum Vector- Returns:
- The clamped Vector
-