Package rosequartz.math
Class Vec3
- All Implemented Interfaces:
Serializable
Represents a vector with an x-, a y- and a z-component.
- See Also:
- Serialized Form
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected float[]Returns an array containing all components in the order they appear in the vector.protected Vec3Creates a new vector (values don't matter) of this type.set(float x, float y, float z)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 voidsetComponents(float[] values)Sets the components of the vector.
-
Field Details
-
x
public float x -
y
public float y -
z
public float z
-
-
Constructor Details
-
Vec3
public Vec3()Create a vector initialized to [0, 0, 0]. -
Vec3
Creates a vector with the given values. -
Vec3
Creates a vector with the given values. -
Vec3
Creates a vector with the given values. -
Vec3
public Vec3(float x, float y, float z)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
-
getComponents
protected float[] getComponents()Description copied from class:VecReturns an array containing all components in the order they appear in the vector.- Specified by:
getComponentsin classVec<Vec3>- Returns:
- array containing all vector components
-
setComponents
protected void setComponents(float[] values)Description copied from class:VecSets the components of the vector.- Specified by:
setComponentsin classVec<Vec3>- Parameters:
values- an array containing the values for all components.
-
getNewVector
Description copied from class:VecCreates a new vector (values don't matter) of this type.- Specified by:
getNewVectorin classVec<Vec3>- Returns:
- new vector of this type
-