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 TypeMethodDescriptionboolean
Tests for exact equality with the argument.int
getW()
Return the 4th (W) component.int
getX()
Return the first (X) component.int
getY()
Return the 2nd (Y) component.int
getZ()
Return the 3rd (Z) component.int
hashCode()
Return a hash code.void
set
(int x, int y, int z, int w) Set all 4 components to specified values.void
setW
(int w) Alter the 4th (W) component.void
setX
(int x) Alter the first (X) component.void
setY
(int y) Alter the 2nd (Y) component.void
setZ
(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
-
-
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. Ifother
is 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)
-