Class Vector4f
java.lang.Object
dev.prozilla.pine.common.math.vector.Vector<Vector4f>
dev.prozilla.pine.common.math.vector.VectorFloat<Vector4f>
dev.prozilla.pine.common.math.vector.Vector4f
4-dimensional vector with floating point precision. GLSL equivalent to 
vec4.- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionadd(float x, float y, float z, float w) 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 Vector4fgetTemp(float x, float y, float z, float w) Returns a temporary vector with given values.inthashCode()floatCalculates the squared length of this vector.static Vector4fone()Creates a new vector (1, 1, 1, 1)static Vector4fDeprecated.scale(float scalar) Scales this vector by a scalar.set(float xyzw) set(float x, float y, float z, float w) voidtoBuffer(FloatBuffer buffer) Stores 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.VectorFloatlengthMethods inherited from class dev.prozilla.pine.common.math.vector.Vectordivide, equals, lerp, negate, normalize, parseToFloats, parseToFloats, parseToIntegers, parseToIntegers, parseToNumbers, subtract
- 
Field Details- 
xpublic float x
- 
ypublic float y
- 
zpublic float z
- 
wpublic float w
- 
tempReusable temporary vector, to avoid repeatedly creating new instances in performance-critical contexts.
 
- 
- 
Constructor Details- 
Vector4fpublic Vector4f()Creates a default 4-dimensional vector with all values set to0f.
- 
Vector4fpublic Vector4f(float x, float y, float z, float w) Creates a 4-dimensional vector with given values.
 
- 
- 
Method Details- 
set
- 
set
- 
add
- 
addDescription copied from class:VectorAdds another vector to this vector.
- 
scaleDescription copied from class:VectorScales this vector by a scalar.
- 
lengthSquaredpublic float lengthSquared()Description copied from class:VectorFloatCalculates the squared length of this vector.- Specified by:
- lengthSquaredin class- VectorFloat<Vector4f>
 
- 
dotDescription copied from class:VectorFloatCalculates the dot product of this vector with another vector.- Specified by:
- dotin class- VectorFloat<Vector4f>
- Returns:
- Dot product of this vector multiplied by another vector
 
- 
toBufferDescription copied from class:VectorFloatStores the vector in a given buffer.- Specified by:
- toBufferin class- VectorFloat<Vector4f>
- Parameters:
- buffer- The buffer to store the vector data in
 
- 
hashCodepublic int hashCode()
- 
equalsDescription copied from interface:CloneableChecks if the given object is equal to this object.
- 
cloneDescription copied from interface:CloneableReturns a new object that is equal to this object.
- 
toStringConverts this vector to a string representation in the format "(x,y,z,w)".
- 
parseDeprecated.Replaced byVector4f.Parseras of 2.0.2- Throws:
- InvalidStringException
 
- 
oneCreates a new vector (1, 1, 1, 1)
- 
getTempReturns a temporary vector with given values. Note that this temporary vector is a global instance, so avoid concurrent usage.
 
- 
Vector4f.Parseras of 2.0.2