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

Wraps a nkMaths::Quaternion 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 newQuat4 (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue getX (void *vector)
 
static nkScripts::OutputValue getY (void *vector)
 
static nkScripts::OutputValue getZ (void *vector)
 
static nkScripts::OutputValue getW (void *vector)
 
static nkScripts::OutputValue getAsEulerAngles (const nkScripts::DataStack &stack)
 
static void setX (const nkScripts::DataStack &stack)
 
static void setY (const nkScripts::DataStack &stack)
 
static void setZ (const nkScripts::DataStack &stack)
 
static void setW (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue transform (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue apply (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setFromAxisAngle (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setFromEuler (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setFromOrientationMatrix (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue setFromTransformationMatrix (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 div (const nkScripts::DataStack &stack)
 
static nkScripts::OutputValue eq (const nkScripts::DataStack &stack)
 

Detailed Description

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

Member Function Documentation

◆ updateEnvironment()

static void nkAstraeus::nkMathsWrap::QuaternionWrapper::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::QuaternionWrapper::constructor ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type.

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

◆ destructor()

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

Wrapper function for the destructor of the user type.

Parameters
toDestroyThe data that has to be freed.

◆ newQuat4()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::newQuat4 ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type. Will map to the quaternion 4-float constructor.

local t = nkMaths.Quaternion.newQuat4(x, y, z, w) ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ getX()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::getX ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getX(), exposed as an attribute getter.

local d = q._x ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getY()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::getY ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getY(), exposed as an attribute getter.

local d = q._y ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getZ()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::getZ ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getZ(), exposed as an attribute getter.

local d = q._z ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getW()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::getW ( void *  vector)
static

Wrapper function for the nkMaths::Quaternion::getW(), exposed as an attribute getter.

local d = q._w ;
Parameters
vectorThe data from which the attribute will be retrieved.
Returns
The attribute value, as a float.

◆ getAsEulerAngles()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::getAsEulerAngles ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaterion::getAsEulerAngles().

local e = q:getAsEulerAngles() ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ setX()

static void nkAstraeus::nkMathsWrap::QuaternionWrapper::setX ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setX(), exposed as an attribute setter.

q._x = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setY()

static void nkAstraeus::nkMathsWrap::QuaternionWrapper::setY ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setY(), exposed as an attribute setter.

q._y = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setZ()

static void nkAstraeus::nkMathsWrap::QuaternionWrapper::setZ ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setZ(), exposed as an attribute setter.

q._z = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ setW()

static void nkAstraeus::nkMathsWrap::QuaternionWrapper::setW ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setW(), exposed as an attribute setter.

q._w = 0.2 ;
Parameters
stackThe parameter stack.
Returns
The output value, empty.

◆ transform()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::transform ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::transform().

q:applyToVec(v) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ apply()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::apply ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::apply().

q:applyToVec(v) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Vector.

◆ setFromAxisAngle()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::setFromAxisAngle ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setFromAxisAngle().

q:setFromAxisAngle(axis, angle) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Quaternion.

◆ setFromEuler()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::setFromEuler ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setFromEuler().

q:setFromEuler(angles) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Quaternion.

◆ setFromOrientationMatrix()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::setFromOrientationMatrix ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setFromOrientationMatrix().

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

◆ setFromTransformationMatrix()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::setFromTransformationMatrix ( const nkScripts::DataStack stack)
static

Wrapper function for nkMaths::Quaternion::setFromTransformationMatrix().

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

◆ toString()

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

Overrides the default string conversion function.

local s = tostring(q) ;
Parameters
stackThe parameter stack.
Returns
The output value, as a string.

◆ add()

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

Overrides the default add operation for the user type.

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

◆ sub()

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

Overrides the default subtract operation for the user type.

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

◆ mul()

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

Overrides the default multiply operation for the user type.

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

◆ div()

static nkScripts::OutputValue nkAstraeus::nkMathsWrap::QuaternionWrapper::div ( const nkScripts::DataStack stack)
static

Overrides the default divide operation for the user type.

local q = p / t ;
Parameters
stackThe parameter stack.
Returns
The output value, as a nkMaths::Quaternion.

◆ eq()

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

Overrides the default equality operation for the user type.

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

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