Class Vector3f
java.lang.Object
dev.prozilla.pine.common.math.vector.Vector<Vector3f>
dev.prozilla.pine.common.math.vector.VectorFloat<Vector3f>
dev.prozilla.pine.common.math.vector.Vector3f
3-dimensional vector with floating point precision. GLSL equivalent to
vec3.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(float x, float y, float z) Adds another vector to this vector.clone()Returns a new object that is equal to this object.floatCalculates the dot product of this vector with another vector.booleanChecks if the given object is equal to this object.static Vector3fgetTemp(float x, float y, float z) Returns a temporary vector with given values.inthashCode()floatCalculates the squared length of this vector.static Vector3fone()Creates a new vector (1, 1, 1)static Vector3fDeprecated.scale(float scalar) Scales this vector by a scalar.set(float xyz) set(float x, float y, float z) voidtoBuffer(FloatBuffer buffer) 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.VectorFloat
lengthMethods 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 float x -
y
public float y -
z
public float z -
temp
Reusable temporary vector, to avoid repeatedly creating new instances in performance-critical contexts.
-
-
Constructor Details
-
Vector3f
public Vector3f()Creates a default 3-dimensional vector with all values set to0f. -
Vector3f
public Vector3f(float x, float y, float z) Creates a 3-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 float lengthSquared()Description copied from class:VectorFloatCalculates the squared length of this vector.- Specified by:
lengthSquaredin classVectorFloat<Vector3f>
-
dot
Description copied from class:VectorFloatCalculates the dot product of this vector with another vector.- Specified by:
dotin classVectorFloat<Vector3f>- Returns:
- Dot product of this vector multiplied by another vector
-
toBuffer
Description copied from class:VectorFloatStores the vector in a given buffer.- Specified by:
toBufferin classVectorFloat<Vector3f>- Parameters:
buffer- The buffer to store the vector data in
-
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)". -
parse
Deprecated.Replaced byVector3f.Parseras of 2.0.2- Throws:
InvalidStringException
-
one
Creates a new vector (1, 1, 1) -
getTemp
Returns a temporary vector with given values. Note that this temporary vector is a global instance, so avoid concurrent usage.
-
Vector3f.Parseras of 2.0.2