Class Vector4i
java.lang.Object
dev.prozilla.pine.common.math.vector.Vector<Vector4i>
dev.prozilla.pine.common.math.vector.VectorInt<Vector4i>
dev.prozilla.pine.common.math.vector.Vector4i
4-dimensional vector with integer precision. GLSL equivalent to
ivec4.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int x, int y, int z, int w) Adds another vector to this vector.clone()Returns a new object that is equal to this object.intCalculates the dot product of this vector with another vector.booleanChecks if the given object is equal to this object.static Vector4igetTemp(int x, int y, int z, int w) Returns a temporary vector with given values.inthashCode()intCalculates the squared length of this vector.static Vector4ione()Creates a new vector (1, 1, 1, 1)static Vector4iDeprecated.scale(float scalar) Scales this vector by a scalar.set(int xyzw) set(int x, int y, int z, int w) voidStores the vector in a given buffer.toString()Converts this vector to a string representation in the format "(x,y,z,w)".Methods inherited from class dev.prozilla.pine.common.math.vector.Vector
divide, equals, lerp, negate, normalize, parseToFloats, parseToFloats, parseToIntegers, parseToIntegers, parseToNumbers, subtract
-
Field Details
-
x
public int x -
y
public int y -
z
public int z -
w
public int w -
temp
Reusable temporary vector, to avoid repeatedly creating new instances in performance-critical contexts.
-
-
Constructor Details
-
Vector4i
public Vector4i()Creates a default 4-dimensional vector with all values set to0. -
Vector4i
public Vector4i(int x, int y, int z, int w) Creates a 4-dimensional vector with given values.
-
-
Method Details
-
set
-
set
-
add
-
add
Description copied from class:VectorAdds another vector to this vector. -
scale
Description copied from class:VectorScales this vector by a scalar. -
lengthSquared
public int lengthSquared()Description copied from class:VectorIntCalculates the squared length of this vector.- Specified by:
lengthSquaredin classVectorInt<Vector4i>
-
dot
Description copied from class:VectorIntCalculates the dot product of this vector with another vector. -
toBuffer
Description copied from class:VectorIntStores the vector in a given buffer. -
hashCode
public int hashCode() -
equals
Description copied from interface:CloneableChecks if the given object is equal to this object. -
clone
Description copied from interface:CloneableReturns a new object that is equal to this object. -
toString
Converts this vector to a string representation in the format "(x,y,z,w)". -
parse
Deprecated.Replaced byVector4i.Parseras of 2.0.2- Throws:
InvalidStringException
-
one
Creates a new vector (1, 1, 1, 1) -
getTemp
Returns a temporary vector with given values. Note that this temporary vector is a global instance, so avoid concurrent usage.
-
Vector4i.Parseras of 2.0.2