Package rosequartz.math
Class Vec4
- All Implemented Interfaces:
Serializable
Represents a vector with an x-, a y-, a z- and a w-component.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVec4()
Create a vector initialized to [0, 0, 0, 1].Vec4(float x, float y, float z, float w)
Creates a vector with the given values.Creates a vector with the given values.Creates a vector with the given values.Creates a vector with the given values.Creates a vector with the given values.Creates a vector with the given values.Creates a vector with the given values.Creates a vector with the given values. -
Method Summary
Modifier and TypeMethodDescriptionprotected float[]
Returns an array containing all components in the order they appear in the vector.protected Vec4
Creates a new vector (values don't matter) of this type.Multiplies this the given matrix with this vector and stores the result in this.Multiplies this the given matrix with this vector and stores the result in dest.Multiplies this the given matrix with this vector and stores the result in a new vector, returning it.set(float x, float y, float z, float w)
Sets the vector to the given values.Sets the vector to the given values.Sets the vector to the given values.Sets the vector to the given values.Sets the vector to the given values.Sets the vector to the given values.Sets the vector to the given values.Sets the vector to the given values.protected void
setComponents(float[] values)
Sets the components of the vector.
-
Field Details
-
x
public float x -
y
public float y -
z
public float z -
w
public float w
-
-
Constructor Details
-
Vec4
public Vec4()Create a vector initialized to [0, 0, 0, 1]. -
Vec4
Creates a vector with the given values. -
Vec4
Creates a vector with the given values. -
Vec4
Creates a vector with the given values. -
Vec4
Creates a vector with the given values. -
Vec4
Creates a vector with the given values. -
Vec4
Creates a vector with the given values. -
Vec4
Creates a vector with the given values. -
Vec4
public Vec4(float x, float y, float z, float w)Creates a vector with the given values.
-
-
Method Details
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
set
Sets the vector to the given values.- Returns:
- this
-
mul
Multiplies this the given matrix with this vector and stores the result in this.- Parameters:
mat
- vector to multiply with this one- Returns:
- this
-
mul
Multiplies this the given matrix with this vector and stores the result in dest.- Parameters:
mat
- vector to multiply with this onedest
- vector to store result in- Returns:
- this
-
mulN
Multiplies this the given matrix with this vector and stores the result in a new vector, returning it.- Parameters:
mat
- vector to multiply with this one- Returns:
- new vector holding result
-
getComponents
protected float[] getComponents()Description copied from class:Vec
Returns an array containing all components in the order they appear in the vector.- Specified by:
getComponents
in classVec<Vec4>
- Returns:
- array containing all vector components
-
setComponents
protected void setComponents(float[] values)Description copied from class:Vec
Sets the components of the vector.- Specified by:
setComponents
in classVec<Vec4>
- Parameters:
values
- an array containing the values for all components.
-
getNewVector
Description copied from class:Vec
Creates a new vector (values don't matter) of this type.- Specified by:
getNewVector
in classVec<Vec4>
- Returns:
- new vector of this type
-