PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Vector3

Vector3

Constructors

Vector3.new ( number x = 0, number y = 0, number z = 0 )

Constructs a new Vector3 using coordinates x, y, z.

Vector3.FromNormalId ( Enum normal )

Constructs a new Vector3 in a particular direction.

Vector3.FromAxis ( Enum axis )

Constructs a new Vector3 for a particular axis.

Properties

number Vector3.X

The x-coordinate

number Vector3.Y

The y-coordinate

number Vector3.Z

The z-coordinate

number Vector3.Magnitude

The length of the vector

Vector3 Vector3.Unit

A normalized copy of the vector - one which has the same direction as the original but a magnitude of 1

Functions

Vector3 Vector3:Lerp ( Vector3 goal, number alpha )

Returns a Vector3 linearly interpolated between this Vector3 and the goal by the fraction alpha/

number Vector3:Dot ( Vector3 other )

Returns a scalar dot product of the two vectors

Vector3 Vector3:Cross ( Vector3 other )

Returns the cross product of the two vectors

bool Vector3:isClose ( Vector3 other, number epsilon )

Returns true if the other Vector3 falls within the epsilon radius of this Vector3.

Math Operations

Vector3 Vector3 + Vector3

Returns a new Vector3 with each component of the second added to the corresponding component of the first.

Vector3 Vector3 - Vector3

Returns a new Vector3 with each component of the second subtracted from the corresponding component of the first.

Vector3 Vector3 * Vector3

Returns a new Vector3 with each component of the second multiplied the corresponding component of the first.

Vector3 Vector3 / Vector3

Returns a new Vector3 with each component of the first divided by the corresponding component of the second.

Vector3 Vector3 * number

Returns the Vector3 with each component multiplied by the number.

Vector3 Vector3 / number

Returns the Vector3 with each component divided by the number.