Quaternion

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import crafttweaker.api.util.math.Quaternion;

Methods

script.zs
// Quaternion.conj()
myQuaternion.conj();

Return Type: Quaternion

script.zs
// Quaternion.copy() as Quaternion
myQuaternion.copy();

Return Type: float

script.zs
// Quaternion.i() as float
myQuaternion.i();

Return Type: float

script.zs
// Quaternion.j() as float
myQuaternion.j();

Return Type: float

script.zs
// Quaternion.k() as float
myQuaternion.k();
script.zs
Quaternion.mul(other as Quaternion)
ParameterType
Parameter
other
Type
Quaternion
script.zs
Quaternion.mul(value as float)
ParameterType
Parameter
value
Type
float
script.zs
// Quaternion.normalize()
myQuaternion.normalize();

Return Type: float

script.zs
// Quaternion.r() as float
myQuaternion.r();
script.zs
Quaternion.setValue(i as float, j as float, k as float, r as float)
ParameterType
Parameter
i
Type
float
Parameter
j
Type
float
Parameter
k
Type
float
Parameter
r
Type
float
script.zs
Quaternion.slerp(other as Quaternion, value as float)
ParameterType
Parameter
other
Type
Quaternion
Parameter
value
Type
float

Return Type: Vector3f

script.zs
// Quaternion.toXYZ() as Vector3f
myQuaternion.toXYZ();

Return Type: Vector3f

script.zs
// Quaternion.toXYZDegrees() as Vector3f
myQuaternion.toXYZDegrees();

Return Type: Vector3f

script.zs
// Quaternion.toYXZ() as Vector3f
myQuaternion.toYXZ();

Return Type: Vector3f

script.zs
// Quaternion.toYXZDegrees() as Vector3f
myQuaternion.toYXZDegrees();

Properties

NameTypeHas GetterHas Setter
Name
i
Type
float
Has Getter
true
Has Setter
false
Name
j
Type
float
Has Getter
true
Has Setter
false
Name
k
Type
float
Has Getter
true
Has Setter
false
Name
r
Type
float
Has Getter
true
Has Setter
false
Name
xyz
Type
Vector3f
Has Getter
true
Has Setter
false
Name
xyzDegrees
Type
Vector3f
Has Getter
true
Has Setter
false
Name
yxz
Type
Vector3f
Has Getter
true
Has Setter
false
Name
yxzDegrees
Type
Vector3f
Has Getter
true
Has Setter
false