Quaternion - CreedVI/Raylib-J GitHub Wiki

The Qaternion data structure is used to store four floats as an x, y, z, w coordinate quartet. Quaternion is identical to Vector4 and should be used over Vector4 when performing Qaternion operations.

Constructors

Qaternion()

Qaternion quat = new Qaternion();

Results in a Qaternion with the value of 0, 0, 0, 0


Qaternion(float x, float y, float z, float w)

Qaternion position = new Qaternion(55, 67.4f, 4.3f, 5);

Results in a Qaternion with the value of 55, 67.4f, 4.3f, 5

Methods

setX(float x)

quat.setX(53);

Sets the value of x to 53


setY(float y)

quat.setY(326);

Sets the value of y to 326


setZ(float z)

quat.setZ(33);

Sets the value of z to 33


setW(float w)

quat.setW(6);

Sets the value of w to 6


getX()

quat.getX();

Returns the value of x


getY()

quat.getY();

Returns the value of y


getZ()

quat.getZ();

Returns the value of z


getW()

quat.getW();

Returns the value of w