Interface Vec4Arg
- All Known Implementing Classes:
Vec4
public interface Vec4Arg
Read-only access to a
Vec4
. (native type: const Vec4)-
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the dot product with the specified vector.float
get
(int index) Return the specified component.float
getW()
Return the 4th (W) component in single precision.float
getX()
Return the first (X) component in single precision.float
getY()
Return the 2nd (Y) component in single precision.float
getZ()
Return the 3rd (Z) component in single precision.float[]
toArray()
Copy the components to an array.
-
Method Details
-
dot
Return the dot product with the specified vector. The current vector is unaffected.- Parameters:
factor
- the vector to dot with the current one (not null, unaffected)- Returns:
- the dot product
-
get
float get(int index) Return the specified component. The vector is unaffected.- Parameters:
index
- 0, 1, 2, or 3- Returns:
- the X component if index=0, the Y component if index=1, the Z component if index=2, or the W component if index=3
- Throws:
IllegalArgumentException
- if index is not 0, 1, 2, or 3
-
getW
float getW()Return the 4th (W) component in single precision. The vector is unaffected.- Returns:
- the component value
-
getX
float getX()Return the first (X) component in single precision. The vector is unaffected.- Returns:
- the component value
-
getY
float getY()Return the 2nd (Y) component in single precision. The vector is unaffected.- Returns:
- the component value
-
getZ
float getZ()Return the 3rd (Z) component in single precision. The vector is unaffected.- Returns:
- the component value
-
toArray
float[] toArray()Copy the components to an array. The vector is unaffected.- Returns:
- a new array with length=4
-