java.lang.Object
com.github.stephengold.joltjni.UVec4
- All Implemented Interfaces:
UVec4Arg
A vector composed of 4 unsigned integer components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests for exact equality with the argument.intgetW()Return the 4th (W) component.intgetX()Return the first (X) component.intgetY()Return the 2nd (Y) component.intgetZ()Return the 3rd (Z) component.inthashCode()Return a hash code.voidset(int x, int y, int z, int w) Set all 4 components to specified values.voidsetW(int w) Alter the 4th (W) component.voidsetX(int x) Alter the first (X) component.voidsetY(int y) Alter the 2nd (Y) component.voidsetZ(int z) Alter the 3rd (Z) component.toString()Return a string representation of the vector, which is unaffected.
-
Constructor Details
-
UVec4
public UVec4()Instantiate an all-zero vector (0,0,0,0). -
UVec4
public UVec4(int x, int y, int z, int w) Instantiate a vector with specified components.- Parameters:
x- the desired X componenty- the desired Y componentz- the desired Z componentw- the desired W component
-
UVec4
Instantiate a copy of the argument.- Parameters:
vec- the vector to copy (not null, unaffected)
-
-
Method Details
-
set
public void set(int x, int y, int z, int w) Set all 4 components to specified values.- Parameters:
x- the desired X componenty- the desired Y componentz- the desired Z componentw- the desired W component
-
setW
public void setW(int w) Alter the 4th (W) component.- Parameters:
w- the desired value
-
setX
public void setX(int x) Alter the first (X) component.- Parameters:
x- the desired value
-
setY
public void setY(int y) Alter the 2nd (Y) component.- Parameters:
y- the desired value
-
setZ
public void setZ(int z) Alter the 3rd (Z) component.- Parameters:
z- the desired value
-
getW
public int getW()Return the 4th (W) component. The vector is unaffected. -
getX
public int getX()Return the first (X) component. The vector is unaffected. -
getY
public int getY()Return the 2nd (Y) component. The vector is unaffected. -
getZ
public int getZ()Return the 3rd (Z) component. The vector is unaffected. -
equals
Tests for exact equality with the argument. Ifotheris null, false is returned. Either way, the current instance is unaffected. -
hashCode
public int hashCode()Return a hash code. If two vectors have identical values, they will have the same hash code. The vector is unaffected. -
toString
Return a string representation of the vector, which is unaffected. For example, a zero vector is represented by:UVec4(0 0 0 0)
-