back
A unit vector representing the world BACK direction (0,0,-1)
down
A unit vector representing the world DOWN direction (0,-1,0)
east
A unit vector representing the world EAST direction (1,0,0) (same as RIGHT)
forward
A unit vector representing the world FORWARD direction (0,0,1)
left
A unit vector representing the world LEFT direction (-1,0,0)
north
A unit vector representing the world NORTH direction (0,0,1) (same as FORWARD)
one
A unit vector representing the value of 1 in all directions (1,1,1)
right
A unit vector representing the world RIGHT direction (1,0,0)
south
A unit vector representing the world SOUTH direction (0,0,-1) (same as BACK)
up
A unit vector representing the world UP direction (0,1,0)
west
A unit vector representing the world WEST direction (-1,0,0) (same as LEFT)
zero
A unit vector representing the value of 0 in all directions (0,0,0)
Staticaddadd
Add two vectors to produce a new vector
Staticbackback
A unit vector representing the world BACK direction (0,0,-1)
Staticclampclamp
Clamps the components of a vector to limits to produce a new vector
Staticcrosscross
Calculate the cross product of two vectors. Returns a new vector.
Staticdistancedistance
Calculate the distance between two vectors
Staticdotdot
Calculate the dot product of two vectors
Staticdowndown
A unit vector representing the world DOWN direction (0,-1,0)
Staticeasteast
A unit vector representing the world EAST direction (1,0,0) (same as RIGHT)
Staticequalsequals
Check the equality of two vectors
Staticfloorfloor
Floor the components of a vector to produce a new vector
Staticforwardforward
A unit vector representing the world FORWARD direction (0,0,1)
Staticleftleft
A unit vector representing the world LEFT direction (-1,0,0)
Staticlerplerp
Constructs a new vector using linear interpolation on each component from two vectors.
Staticmagnitudemagnitude
The magnitude of a vector
Staticmultiplymultiply
Element-wise multiplication of two vectors together. Not to be confused with Vector3Utils.dot product or Vector3Utils.cross product
Staticnormalizenormalize
Takes a vector 3 and normalizes it to a unit vector
Staticnorthnorth
A unit vector representing the world NORTH direction (0,0,1) (same as FORWARD)
Staticoneone
A unit vector representing the value of 1 in all directions (1,1,1)
Staticrightright
A unit vector representing the world RIGHT direction (1,0,0)
StaticrotateXrotateX
Rotates the vector around the x axis counterclockwise (left hand rule)
StaticrotateYrotateY
Rotates the vector around the y axis counterclockwise (left hand rule)
StaticrotateZrotateZ
Rotates the vector around the z axis counterclockwise (left hand rule)
Staticscalescale
Multiple all entries in a vector by a single scalar value producing a new vector
Staticslerpslerp
Constructs a new vector using spherical linear interpolation on each component from two vectors.
Staticsouthsouth
A unit vector representing the world SOUTH direction (0,0,-1) (same as BACK)
Staticsubtractsubtract
Subtract two vectors to produce a new vector (v1-v2)
StatictotoString
Create a string representation of a vector3
Staticupup
A unit vector representing the world UP direction (0,1,0)
Staticwestwest
A unit vector representing the world WEST direction (-1,0,0) (same as LEFT)
Staticzerozero
A unit vector representing the value of 0 in all directions (0,0,0)
Assigns the values of the passed in vector to this vector. Returns itself.
cross
Computes the cross product of this and the passed in vector, returning itself.
floor
Floor the components of a vector to produce a new vector
lerp
Constructs a new vector using linear interpolation on each component from two vectors.
magnitude
The magnitude of the vector
multiply
Element-wise multiplication of two vectors together. Not to be confused with Vector3Builder.dot product or Vector3Builder.cross product
normalize
Normalizes this vector, returning itself.
rotateX
Rotates the vector around the x axis counterclockwise (left hand rule)
Angle in radians
rotateY
Rotates the vector around the y axis counterclockwise (left hand rule)
Angle in radians
rotateZ
Rotates the vector around the z axis counterclockwise (left hand rule)
Angle in radians
scale
Scales this by the passed in value, returning itself.
slerp
Constructs a new vector using spherical linear interpolation on each component from two vectors.
subtract
Subtracts the vector v from this, returning itself.
toString
Create a string representation of a vector
Optionaloptions: { decimals?: number; delimiter?: string }
Utilities operating on Vector3 objects.
This is a mixture of the Vector3Builder and Vector3Utils classes.