Vec3

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

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

Implements

Vec3 implements the following interfaces:

Position

Constructors

new(x as double, y as double, z as double)
script.zs
// new Vec3(x as double, y as double, z as double);
new Vec3(myDouble, myDouble, myDouble);

Parameters:

x Type: double
y Type: double
z Type: double

Members

add(other as Vec3) as Vec3
script.zs
// Vec3.add(other as Vec3) as Vec3;
myVec3.add(myVec3);

Parameters:

other Type: Vec3

Return Type: Vec3

add(x as double, y as double, z as double) as Vec3
script.zs
// Vec3.add(x as double, y as double, z as double) as Vec3;
myVec3.add(myDouble, myDouble, myDouble);

Parameters:

x Type: double
y Type: double
z Type: double

Return Type: Vec3

closerThan(position as Position, maxDistance as double) as bool
script.zs
// Vec3.closerThan(position as Position, maxDistance as double) as bool;
myVec3.closerThan(myPosition, myDouble);

Parameters:

position Type: Position
maxDistance Type: double

Return Type: bool

cross(other as Vec3) as Vec3
script.zs
// Vec3.cross(other as Vec3) as Vec3;
myVec3.cross(myVec3);

Parameters:

other Type: Vec3

Return Type: Vec3

distanceTo(other as Vec3) as double
script.zs
// Vec3.distanceTo(other as Vec3) as double;
myVec3.distanceTo(myVec3);

Parameters:

other Type: Vec3

Return Type: double

distanceToSqr(other as Vec3) as double
script.zs
// Vec3.distanceToSqr(other as Vec3) as double;
myVec3.distanceToSqr(myVec3);

Parameters:

other Type: Vec3

Return Type: double

distanceToSqr(x as double, y as double, z as double) as double
script.zs
// Vec3.distanceToSqr(x as double, y as double, z as double) as double;
myVec3.distanceToSqr(myDouble, myDouble, myDouble);

Parameters:

x Type: double
y Type: double
z Type: double

Return Type: double

dot(other as Vec3) as double
script.zs
// Vec3.dot(other as Vec3) as double;
myVec3.dot(myVec3);

Parameters:

other Type: Vec3

Return Type: double

getValue(axis as Axis) as double
script.zs
// Vec3.getValue(axis as Axis) as double;
myVec3.getValue(myAxis);

Parameters:

axis Type: Axis

Return Type: double

Getter
script.zs
// Vec3.horizontalDistance as double
myVec3.horizontalDistance

Return Type: double

horizontalDistance() as double
script.zs
// Vec3.horizontalDistance() as double;
myVec3.horizontalDistance();

Return Type: double

Getter
script.zs
// Vec3.horizontalDistanceSqr as double
myVec3.horizontalDistanceSqr

Return Type: double

horizontalDistanceSqr() as double
script.zs
// Vec3.horizontalDistanceSqr() as double;
myVec3.horizontalDistanceSqr();

Return Type: double

Getter
script.zs
// Vec3.length as double
myVec3.length

Return Type: double

length() as double
script.zs
// Vec3.length() as double;
myVec3.length();

Return Type: double

Getter
script.zs
// Vec3.lengthSqr as double
myVec3.lengthSqr

Return Type: double

lengthSqr() as double
script.zs
// Vec3.lengthSqr() as double;
myVec3.lengthSqr();

Return Type: double

lerp(other as Vec3, value as double) as Vec3
script.zs
// Vec3.lerp(other as Vec3, value as double) as Vec3;
myVec3.lerp(myVec3, myDouble);

Parameters:

other Type: Vec3
value Type: double

Return Type: Vec3

multiply(other as Vec3) as Vec3
script.zs
// Vec3.multiply(other as Vec3) as Vec3;
myVec3.multiply(myVec3);

Parameters:

other Type: Vec3

Return Type: Vec3

multiply(x as double, y as double, z as double) as Vec3
script.zs
// Vec3.multiply(x as double, y as double, z as double) as Vec3;
myVec3.multiply(myDouble, myDouble, myDouble);

Parameters:

x Type: double
y Type: double
z Type: double

Return Type: Vec3

Getter
script.zs
// Vec3.normalize as Vec3
myVec3.normalize

Return Type: Vec3

normalize() as Vec3
script.zs
// Vec3.normalize() as Vec3;
myVec3.normalize();

Return Type: Vec3

Getter
script.zs
// Vec3.reverse as Vec3
myVec3.reverse

Return Type: Vec3

reverse() as Vec3
script.zs
// Vec3.reverse() as Vec3;
myVec3.reverse();

Return Type: Vec3

scale(scalar as double) as Vec3
script.zs
// Vec3.scale(scalar as double) as Vec3;
myVec3.scale(myDouble);

Parameters:

scalar Type: double

Return Type: Vec3

subtract(other as Vec3) as Vec3
script.zs
// Vec3.subtract(other as Vec3) as Vec3;
myVec3.subtract(myVec3);

Parameters:

other Type: Vec3

Return Type: Vec3

subtract(x as double, y as double, z as double) as Vec3
script.zs
// Vec3.subtract(x as double, y as double, z as double) as Vec3;
myVec3.subtract(myDouble, myDouble, myDouble);

Parameters:

x Type: double
y Type: double
z Type: double

Return Type: Vec3

vectorTo(other as Vec3) as Vec3
script.zs
// Vec3.vectorTo(other as Vec3) as Vec3;
myVec3.vectorTo(myVec3);

Parameters:

other Type: Vec3

Return Type: Vec3

Getter
script.zs
// Vec3.x as double
myVec3.x

Return Type: double

x() as double
script.zs
// Vec3.x() as double;
myVec3.x();

Return Type: double

xRot(pitch as float) as Vec3
script.zs
// Vec3.xRot(pitch as float) as Vec3;
myVec3.xRot(myFloat);

Parameters:

pitch Type: float

Return Type: Vec3

Getter
script.zs
// Vec3.y as double
myVec3.y

Return Type: double

y() as double
script.zs
// Vec3.y() as double;
myVec3.y();

Return Type: double

yRot(yaw as float) as Vec3
script.zs
// Vec3.yRot(yaw as float) as Vec3;
myVec3.yRot(myFloat);

Parameters:

yaw Type: float

Return Type: Vec3

Getter
script.zs
// Vec3.z as double
myVec3.z

Return Type: double

z() as double
script.zs
// Vec3.z() as double;
myVec3.z();

Return Type: double

zRot(roll as float) as Vec3
script.zs
// Vec3.zRot(roll as float) as Vec3;
myVec3.zRot(myFloat);

Parameters:

roll Type: float

Return Type: Vec3