Vector3f

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.Vector3f;

Methods

script.zs
Vector3f.add(other as Vector3f)
ParameterType
Parameter
other
Type
Vector3f
script.zs
Vector3f.add(x as float, y as float, z as float)
ParameterType
Parameter
x
Type
float
Parameter
y
Type
float
Parameter
z
Type
float
script.zs
Vector3f.clamp(min as float, max as float)
ParameterType
Parameter
min
Type
float
Parameter
max
Type
float
script.zs
Vector3f.clamp(min as Vector3f, max as Vector3f)
ParameterType
Parameter
min
Type
Vector3f
Parameter
max
Type
Vector3f

Return Type: Vector3f

script.zs
// Vector3f.copy() as Vector3f
myVector3f.copy();
script.zs
Vector3f.cross(other as Vector3f)
ParameterType
Parameter
other
Type
Vector3f

Return Type: float

script.zs
Vector3f.dot(other as Vector3f) as float
ParameterType
Parameter
other
Type
Vector3f
script.zs
Vector3f.lerp(max as Vector3f, value as float)
ParameterType
Parameter
max
Type
Vector3f
Parameter
value
Type
float
script.zs
Vector3f.load(other as Vector3f)
ParameterType
Parameter
other
Type
Vector3f
script.zs
Vector3f.mul(scalar as float)
ParameterType
Parameter
scalar
Type
float
script.zs
Vector3f.mul(x as float, y as float, z as float)
ParameterType
Parameter
x
Type
float
Parameter
y
Type
float
Parameter
z
Type
float

Return Type: boolean

script.zs
// Vector3f.normalize() as boolean
myVector3f.normalize();

Return Type: Quaternion

script.zs
Vector3f.rotation(rads as float) as Quaternion
ParameterType
Parameter
rads
Type
float

Return Type: Quaternion

script.zs
Vector3f.rotationDegrees(degrees as float) as Quaternion
ParameterType
Parameter
degrees
Type
float
script.zs
Vector3f.setValues(x as float, y as float, z as float)
ParameterType
Parameter
x
Type
float
Parameter
y
Type
float
Parameter
z
Type
float
script.zs
Vector3f.sub(other as Vector3f)
ParameterType
Parameter
other
Type
Vector3f
script.zs
Vector3f.transform(matrix as Matrix3f)
ParameterType
Parameter
matrix
Type
Matrix3f
script.zs
Vector3f.transform(quaternion as Quaternion)
ParameterType
Parameter
quaternion
Type
Quaternion

Return Type: float

script.zs
// Vector3f.x() as float
myVector3f.x();

Return Type: float

script.zs
// Vector3f.y() as float
myVector3f.y();

Return Type: float

script.zs
// Vector3f.z() as float
myVector3f.z();

Properties

NameTypeHas GetterHas Setter
Name
x
Type
float
Has Getter
true
Has Setter
false
Name
y
Type
float
Has Getter
true
Has Setter
false
Name
z
Type
float
Has Getter
true
Has Setter
false