Class Vector3i
java.lang.Object
dev.prozilla.pine.common.math.vector.Vector<Vector3i>
dev.prozilla.pine.common.math.vector.VectorInt<Vector3i>
dev.prozilla.pine.common.math.vector.Vector3i
3-dimensional vector with integer precision. GLSL equivalent to
ivec3
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(int x, int y, int z) Adds another vector to this vector.clone()
Returns a new object that is equal to this object.int
Calculates the dot product of this vector with another vector.boolean
Checks if the given object is equal to this object.static Vector3i
getTemp
(int x, int y, int z) Returns a temporary vector with given values.int
Calculates the squared length of this vector.static Vector3i
scale
(float scalar) Scales this vector by a scalar.void
Stores the vector in a given buffer.toString()
Converts this vector to a string representation in the format "(x,y,z)".Methods inherited from class dev.prozilla.pine.common.math.vector.Vector
divide, equals, hashCode, lerp, negate, normalize, parseToFloats, parseToFloats, parseToIntegers, parseToIntegers, parseToNumbers, subtract
-
Field Details
-
x
public int x -
y
public int y -
z
public int z -
temp
Reusable temporary vector, to avoid repeatedly creating new instances in performance-critical contexts.
-
-
Constructor Details
-
Vector3i
public Vector3i()Creates a default 3-dimensional vector with all values set to0
. -
Vector3i
public Vector3i(int x, int y, int z) Creates a 3-dimensional vector with given values.
-
-
Method Details
-
add
-
add
Description copied from class:Vector
Adds another vector to this vector. -
scale
Description copied from class:Vector
Scales this vector by a scalar. -
lengthSquared
public int lengthSquared()Description copied from class:VectorInt
Calculates the squared length of this vector.- Specified by:
lengthSquared
in classVectorInt<Vector3i>
-
dot
Description copied from class:VectorInt
Calculates the dot product of this vector with another vector. -
toBuffer
Description copied from class:VectorInt
Stores the vector in a given buffer. -
equals
Description copied from interface:Cloneable
Checks if the given object is equal to this object. -
clone
Description copied from interface:Cloneable
Returns a new object that is equal to this object. -
toString
Converts this vector to a string representation in the format "(x,y,z)". -
parse
- Throws:
InvalidStringException
-
getTemp
Returns a temporary vector with given values. Note that this temporary vector is a global instance, so avoid concurrent usage.
-