Module ncine.vec3

The table containing 3-components vector related functions

Functions

ncine.vec3.create (x, y, z) Creates a vec3 table from its components
ncine.vec3.add (vec0, vec1) Adds two vectors together, component-wise
ncine.vec3.add (vec0, scalar) Adds a scalar to the vector components
ncine.vec3.sub (vec0, vec1) Subtracts the second vector from the first one, component-wise
ncine.vec3.sub (vec, scalar) Subtracts the scalar from the vector components
ncine.vec3.mul (vec0, vec1) Multiplies two vectors together, component-wise
ncine.vec3.mul (vec, scalar) Multiplies the vector components by the scalar
ncine.vec3.div (vec0, vec1) Divides the first vector by the second one, component-wise
ncine.vec3.div (vec, scalar) Divides the vector components by the scalar
ncine.vec3.length (vec) Returns the length of the vector
ncine.vec3.sqrlength (vec) Returns the squared length of the vector
ncine.vec3.normalized (vec) Returns a normalized version of the vector
ncine.vec3.dot (vec0, vec1) Returns the dot product between the two vectors

Tables

ncine.vec3 A three component vector


Functions

ncine.vec3.create (x, y, z)
Creates a vec3 table from its components

Parameters:

  • x number The X component
  • y number The Y component
  • z number The Z component

Returns:

    ncine.vec3
ncine.vec3.add (vec0, vec1)
Adds two vectors together, component-wise

Parameters:

Returns:

    ncine.vec3
ncine.vec3.add (vec0, scalar)
Adds a scalar to the vector components

Parameters:

Returns:

    ncine.vec3
ncine.vec3.sub (vec0, vec1)
Subtracts the second vector from the first one, component-wise

Parameters:

Returns:

    ncine.vec3
ncine.vec3.sub (vec, scalar)
Subtracts the scalar from the vector components

Parameters:

Returns:

    ncine.vec3
ncine.vec3.mul (vec0, vec1)
Multiplies two vectors together, component-wise

Parameters:

Returns:

    ncine.vec3
ncine.vec3.mul (vec, scalar)
Multiplies the vector components by the scalar

Parameters:

Returns:

    ncine.vec3
ncine.vec3.div (vec0, vec1)
Divides the first vector by the second one, component-wise

Parameters:

Returns:

    ncine.vec3
ncine.vec3.div (vec, scalar)
Divides the vector components by the scalar

Parameters:

Returns:

    ncine.vec3
ncine.vec3.length (vec)
Returns the length of the vector

Parameters:

Returns:

    number
ncine.vec3.sqrlength (vec)
Returns the squared length of the vector

Parameters:

Returns:

    number
ncine.vec3.normalized (vec)
Returns a normalized version of the vector

Parameters:

Returns:

    ncine.vec3
ncine.vec3.dot (vec0, vec1)
Returns the dot product between the two vectors

Parameters:

Returns:

    number

Tables

ncine.vec3
A three component vector

Fields:

  • x number The X component
  • y number The Y component
  • z number The Z component
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56