Module sk_math

Functions

vector3 (x, y, z) creates a new 3d vector
isVector3 (obj) determines if the input is a Vector3
box3 (min, max) creates a box3
quaternion (x, y, z, w) creates a new quaternion
isQuaternion (obj) determines if the input is a Quaternion

Class Vector3

Vector3:__eq (b)
Vector3:__add (b)
Vector3:__sub (b)
Vector3:__mul (b)
Vector3:__div (b)
Vector3:magnitude () Get the magnitude of the vector
Vector3:magnitudeSqrd () Get the magnitude squared of the vector
Vector3:normalized () Returns a normalized version of this vector
Vector3:min (other) Get the magnitude of the vector
Vector3:max (other) Get the magnitude of the vector
Vector3:dot (b) Get the dot product between two vectors
Vector3:cross (b) Get the cross product between two vectors
Vector3:lerp (b) Linearly interpolates between two points

Class Box3

Box3:nearest_point_in_box (point) Returns the point inside or on the box that is nearest to the given point
Box3:overlaps (box_or_point) Returns the point inside or on the box that is nearest to the given point
Box3:__mul (b)
Box3:distance_to_point (point) Gets the distance from the box to the point If the box contains the point then the negative distance to the nearest edge is returned
Box3:lerp () Linearly interpolates between the min and max of the box
Box3:union (box_or_point) Linearly interpolates between the min and max of the box

Class Quaternion

Quaternion:conjugate ()
Quaternion:slerp (b, t)


Functions

vector3 (x, y, z)
creates a new 3d vector

Parameters:

  • x number the x value for the vector
  • y number the x value for the vector
  • z number the x value for the vector

Returns:

    Vector3
isVector3 (obj)
determines if the input is a Vector3

Parameters:

  • obj any

Returns:

    boolean
box3 (min, max)
creates a box3

Parameters:

Returns:

    Box3
quaternion (x, y, z, w)
creates a new quaternion

Parameters:

  • x number the x value for the quaternion
  • y number the x value for the quaternion
  • z number the x value for the quaternion
  • w number the x value for the quaternion

Returns:

    Quaternion
isQuaternion (obj)
determines if the input is a Quaternion

Parameters:

  • obj any

Returns:

    boolean

Class Vector3

Vector3:__eq (b)

Parameters:

Returns:

    Vector3
Vector3:__add (b)

Parameters:

Returns:

    Vector3
Vector3:__sub (b)

Parameters:

Returns:

    Vector3
Vector3:__mul (b)

Parameters:

Returns:

    Vector3
Vector3:__div (b)

Parameters:

Returns:

    Vector3
Vector3:magnitude ()
Get the magnitude of the vector

Returns:

    number
Vector3:magnitudeSqrd ()
Get the magnitude squared of the vector

Returns:

    number
Vector3:normalized ()
Returns a normalized version of this vector

Returns:

    Vector3
Vector3:min (other)
Get the magnitude of the vector

Parameters:

Returns:

    Vector3
Vector3:max (other)
Get the magnitude of the vector

Parameters:

Returns:

    Vector3
Vector3:dot (b)
Get the dot product between two vectors

Parameters:

Returns:

    number
Vector3:cross (b)
Get the cross product between two vectors

Parameters:

Returns:

    Vector3
Vector3:lerp (b)
Linearly interpolates between two points

Parameters:

Returns:

    Vector3

Class Box3

Box3:nearest_point_in_box (point)
Returns the point inside or on the box that is nearest to the given point

Parameters:

Returns:

    Vector3
Box3:overlaps (box_or_point)
Returns the point inside or on the box that is nearest to the given point

Parameters:

Returns:

    boolean
Box3:__mul (b)

Parameters:

Returns:

    Box3
Box3:distance_to_point (point)
Gets the distance from the box to the point If the box contains the point then the negative distance to the nearest edge is returned

Parameters:

Returns:

    number
Box3:lerp ()
Linearly interpolates between the min and max of the box

Returns:

    Vector3
Box3:union (box_or_point)
Linearly interpolates between the min and max of the box

Parameters:

Returns:

    Box3

Class Quaternion

Quaternion:conjugate ()

Returns:

    Quaternion
Quaternion:slerp (b, t)

Parameters:

Returns:

    Quaternion
generated by LDoc 1.4.6 Last updated 2022-12-30 12:30:52