API Documentation
Static Public Member Functions | List of all members
nkAstraeus::nkMathsWrap::MatrixWrapper Class Referencefinal

Wraps a nkMaths::Matrix and offers functions for use in scripting. More...

Static Public Member Functions

static void updateEnvironment (nkScripts::Environment *env)
 
static void * constructor (const nkScripts::DataStack &stack)
 
static void destructor (void *toDestroy)
 
static nkScripts::OutputValue newMat2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue newMat3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue newMat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getM (void *data)
 
static nkScripts::OutputValue getRow0 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getRow1 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getRow2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getRow3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getCol0 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getCol1 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getCol2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getCol3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue get (const nkScripts::DataStack &stack)
 
static void setM (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue set (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getInverseMat2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getInverseMat3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getInverseMat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getTranspose (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue inverseMat2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue inverseMat3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue inverseMat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue transpose (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getPositionComponent (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getOrientationComponent (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getScaleComponent (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getDecomposed (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setToViewMatrixDirection (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setToPerspectiveMatrix (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setToOrthographicMatrix (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setPositionComponent (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setOrientationComponent (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setScaleComponent (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setToTransformation (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getDeterminantMat2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getDeterminantMat3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getDeterminantMat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getTraceMat2 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getTraceMat3 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getTraceMat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue toString (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue add (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue sub (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue mul (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue eq (const nkScripts::DataStack &stack)
 

Detailed Description

Wraps a nkMaths::Matrix and offers functions for use in scripting.

Member Function Documentation

◆ updateEnvironment()

static void nkAstraeus::nkMathsWrap::MatrixWrapper::updateEnvironment ( nkScripts::Environment env)
static

Updates a given environment and set it up to use all functions wrapped by this wrapper.

Parameters
envThe environment to set up.

◆ constructor()

static void* nkAstraeus::nkMathsWrap::MatrixWrapper::constructor ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type.

local m = nkMaths.Matrix.new() ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ destructor()

static void nkAstraeus::nkMathsWrap::MatrixWrapper::destructor ( void *  toDestroy)
static

Wrapper function for the destructor of the user type.

Parameters
toDestroyThe data that has to be freed.

◆ newMat2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::newMat2 ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type. Will map to the mat2 constructor.

local m = nkMaths.Matrix.newMat2(a00, a01, a10, a11) ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ newMat3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::newMat3 ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type. Will map to the mat3 constructor.

local m = nkMaths.Matrix.newMat3(a00, a01, a02, a10, a11, a12, a20, a21, a22) ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ newMat4()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::newMat4 ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type. Will map to the mat4 constructor.

local m = nkMaths.Matrix.newMat4(a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33) ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ getM()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getM ( void *  data)
static

Wrapper function for the nkMaths::Matrix::_m, exposed as an attribute getter.

local mAttribute = m._m ;
Parameters
dataThe data from which the attribute will be retrieved.
Returns
The attribute value, as a std::array<std::array<float, 4>, 4>.

◆ getRow0()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getRow0 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getRow0().

local v = m:getRow0() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getRow1()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getRow1 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getRow1().

local v = m:getRow1() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getRow2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getRow2 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getRow2().

local v = m:getRow2() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getRow3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getRow3 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getRow3().

local v = m:getRow3() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getCol0()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getCol0 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getCol0().

local v = m:getCol0() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getCol1()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getCol1 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getCol1().

local v = m:getCol1() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getCol2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getCol2 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getCol2().

local v = m:getCol2() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getCol3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getCol3 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getCol3().

local v = m:getCol3() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ get()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::get ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::get().

local v = m:get(x, y) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ setM()

static void nkAstraeus::nkMathsWrap::MatrixWrapper::setM ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::_m, exposed as an attribute setter.

m._m = a ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ set()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::set ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::set().

m:set(v, x, y) ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ getInverseMat2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getInverseMat2 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getInverseMat2().

local mi = m:getInverseMat2() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ getInverseMat3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getInverseMat3 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getInverseMat3().

local mi = m:getInverseMat3() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ getInverseMat4()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getInverseMat4 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getInverseMat4().

local mi = m:getInverseMat4() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ getTranspose()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getTranspose ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getTranspose().

local mt = m:getTranspose() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ inverseMat2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::inverseMat2 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::inverseMat2().

Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ inverseMat3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::inverseMat3 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::inverseMat3().

Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ inverseMat4()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::inverseMat4 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::inverseMat4().

Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ transpose()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::transpose ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::transpose().

Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ getPositionComponent()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getPositionComponent ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getPositionComponent().

local v = m:getPositionComponent() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getOrientationComponent()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getOrientationComponent ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getOrientationComponent().

Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ getScaleComponent()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getScaleComponent ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getScaleComponent().

local v = m:getScaleComponent() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ getDecomposed()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getDecomposed ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getDecomposed().

m:getDecomposed(v, r, s) ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setToViewMatrixDirection()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setToViewMatrixDirection ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setToViewMatrixDirection().

m:setToViewMatrixDirection(p, d, u) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ setToPerspectiveMatrix()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setToPerspectiveMatrix ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setToPerspectiveMatrix().

m:setToPerspectiveMatrix(a, b, c, d) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ setToOrthographicMatrix()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setToOrthographicMatrix ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setToOrthographicMatrix().

m:setToOrthographicMatrix(a, b, c, d) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ setPositionComponent()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setPositionComponent ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setPositionComponent().

m:setPositionComponent(p) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ setOrientationComponent()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setOrientationComponent ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setOrientationComponent().

m:setOrientationComponent(q) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ setScaleComponent()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setScaleComponent ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setScaleComponent().

m:setScaleComponent(s) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ setToTransformation()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::setToTransformation ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::setToTransformation().

m:setToTransformation(p, r, s) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ getDeterminantMat2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getDeterminantMat2 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getDeterminantMat2().

local d = m:getDeterminantMat2() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ getDeterminantMat3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getDeterminantMat3 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getDeterminantMat3().

local d = m:getDeterminantMat3() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ getDeterminantMat4()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getDeterminantMat4 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getDeterminantMat4().

local d = m:getDeterminantMat4() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ getTraceMat2()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getTraceMat2 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getTraceMat2().

local d = m:getTraceMat2() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ getTraceMat3()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getTraceMat3 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getTraceMat3().

local d = m:getTraceMat3() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ getTraceMat4()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::getTraceMat4 ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Matrix::getTraceMat4().

local d = m:getTraceMat4() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a float.

◆ toString()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::toString ( const nkScripts::DataStack stack)
static

Overrides the default string conversion function.

local s = tostring(m) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a string, in the format :
Mat
(
     _m[0][0], _m[0][1], _m[0][2], _m[0][3],
     _m[1][0], _m[1][1], _m[1][2], _m[1][3],
     _m[2][0], _m[2][1], _m[2][2], _m[2][3],
     _m[3][0], _m[3][1], _m[3][2], _m[3][3]
).

◆ add()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::add ( const nkScripts::DataStack stack)
static

Overrides the default add operation for the user type.

local m = p + t ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ sub()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::sub ( const nkScripts::DataStack stack)
static

Overrides the default subtract operation for the user type.

local m = p - t ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ mul()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::mul ( const nkScripts::DataStack stack)
static

Overrides the default multiply operation for the user type.

local m = p * t ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Matrix.

◆ eq()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::MatrixWrapper::eq ( const nkScripts::DataStack stack)
static

Overrides the default equality operation for the user type.

local v = p == t ;
Parameters
stackThe parameter stack.
Returns
The output value, as a bool.

The documentation for this class was generated from the following file: