![]() |
naev 0.12.6
|
Handles transforms. More...
#include "nlua_transform.h"#include "nluadef.h"
Go to the source code of this file.
Functions | |
| static int | transformL_tostring (lua_State *L) |
| Gets a string representing the transform. | |
| static int | transformL_eq (lua_State *L) |
| Compares two transforms to see if they are the same. | |
| static int | transformL_new (lua_State *L) |
| Creates a new identity transform.Gets a transform. | |
| static int | transformL_mul (lua_State *L) |
| Multiplies two transforms (A*B). | |
| static int | transformL_get (lua_State *L) |
| Gets all the values of the transform. | |
| static int | transformL_set (lua_State *L) |
| Sets an element of a transform. | |
| static int | transformL_scale (lua_State *L) |
| Applies scaling to a transform. | |
| static int | transformL_translate (lua_State *L) |
| Applies translation to a transform. | |
| static int | transformL_rotate2d (lua_State *L) |
| Applies a 2D rotation (along Z-axis) to a transform. | |
| static int | transformL_ortho (lua_State *L) |
| Creates an orthogonal matrix. | |
| static int | transformL_applyPoint (lua_State *L) |
| Applies a transformation to a point. | |
| static int | transformL_applyDim (lua_State *L) |
| Applies a transformation to a dimension. | |
| int | nlua_loadTransform (nlua_env env) |
| Loads the transform library. | |
| mat4 * | lua_totransform (lua_State *L, int ind) |
| Lua bindings to interact with transforms. | |
| mat4 * | luaL_checktransform (lua_State *L, int ind) |
| Gets transform at index or raises error if there is no transform at index. | |
| mat4 * | lua_pushtransform (lua_State *L, mat4 transform) |
| Pushes a transform on the stack. | |
| int | lua_istransform (lua_State *L, int ind) |
| Checks to see if ind is a transform. | |
Variables | |
| static const luaL_Reg | transformL_methods [] |
Handles transforms.
Definition in file nlua_transform.c.
| int lua_istransform | ( | lua_State * | L, |
| int | ind ) |
Checks to see if ind is a transform.
| L | Lua state to check. |
| ind | Index position to check. |
Definition at line 113 of file nlua_transform.c.
Pushes a transform on the stack.
| L | Lua state to push transform into. |
| transform | Transform to push. |
Definition at line 98 of file nlua_transform.c.
| mat4 * lua_totransform | ( | lua_State * | L, |
| int | ind ) |
Lua bindings to interact with transforms.
Lua module: transform
Gets transform at index.
| L | Lua state to get transform from. |
| ind | Index position to find the transform. |
Definition at line 72 of file nlua_transform.c.
| mat4 * luaL_checktransform | ( | lua_State * | L, |
| int | ind ) |
Gets transform at index or raises error if there is no transform at index.
| L | Lua state to get transform from. |
| ind | Index position to find transform. |
Definition at line 84 of file nlua_transform.c.
| int nlua_loadTransform | ( | nlua_env | env | ) |
Loads the transform library.
| env | Environment to load transform library into. |
Definition at line 54 of file nlua_transform.c.
|
static |
Applies a transformation to a dimension.
Lua function parameter: Transform T Transform to apply. Lua function parameter: number x Dimension X-coordinate. Lua function parameter: number y Dimension Y-coordinate. Lua function parameter: number z Dimension Z-coordinate. Lua return parameter: number New X coordinate. Lua return parameter: number New Y coordinate. Lua return parameter: number New Z coordinate.
| L | Lua State |
Lua function: applyDim
Definition at line 379 of file nlua_transform.c.
|
static |
Applies a transformation to a point.
Lua function parameter: Transform T Transform to apply. Lua function parameter: number x Point X-coordinate. Lua function parameter: number y Point Y-coordinate. Lua function parameter: number z Point Z-coordinate. Lua return parameter: number New X coordinate. Lua return parameter: number New Y coordinate. Lua return parameter: number New Z coordinate.
| L | Lua State |
Lua function: applyPoint
Definition at line 346 of file nlua_transform.c.
|
static |
Compares two transforms to see if they are the same.
Lua function parameter: Transform t1 Transform 1 to compare. Lua function parameter: Transform t2 Transform 2 to compare. Lua return parameter: boolean true if both transforms are the same.
| L | Lua State |
Lua function: __eq
Definition at line 153 of file nlua_transform.c.
|
static |
Gets all the values of the transform.
Note, this returns in column-major.
Lua function parameter: Transform T Transform te get parameters of. Lua return parameter: table 2D table containing all the values of the transform.
| L | Lua State |
Lua function: get
Definition at line 204 of file nlua_transform.c.
|
static |
Multiplies two transforms (A*B).
Lua function parameter: Transform A First element to multiply. Lua function parameter: Transform B Second element to multiply. Lua return parameter: Transform Result of multiplication.
| L | Lua State |
Lua function: __mul
Definition at line 185 of file nlua_transform.c.
|
static |
Creates a new identity transform.Gets a transform.
Lua return parameter: Transform A new transform corresponding to an identity matrix.
| L | Lua State |
Lua function: new
Definition at line 167 of file nlua_transform.c.
|
static |
Creates an orthogonal matrix.
Lua function parameter: number left Left value. Lua function parameter: number right Right value. Lua function parameter: number bottom Bottom value. Lua function parameter: number top Top value. Lua function parameter: number nearVal value. Lua function parameter: number farVal value. Lua return parameter: Transform A new transformation.
| L | Lua State |
Lua function: translate
Definition at line 321 of file nlua_transform.c.
|
static |
Applies a 2D rotation (along Z-axis) to a transform.
Lua function parameter: Transform T Transform to apply rotation to. Lua function parameter: number angle Angle to rotate (radians).
| L | Lua State |
Lua function: rotate2d
Definition at line 299 of file nlua_transform.c.
|
static |
Applies scaling to a transform.
Lua function parameter: Transform T Transform to apply scaling to. Lua function parameter: number x X-axis scaling. Lua function parameter: number y Y-axis scaling. Lua function parameter: number z Z-axis scaling. Lua return parameter: Transform A new transformation.
| L | Lua State |
Lua function: scale
Definition at line 258 of file nlua_transform.c.
|
static |
Sets an element of a transform.
Lua function parameter: Transform T Transform to set element of. Lua function parameter: number i Column to set. Lua function parameter: number j Row to set. Lua function parameter: number v Value to set to.
| L | Lua State |
Lua function: set
Definition at line 228 of file nlua_transform.c.
|
static |
Gets a string representing the transform.
Lua function parameter: Transform t Transform to get string of. Lua return parameter: string String corresponding to the transform.
| L | Lua State |
Lua function: __tostring
Definition at line 136 of file nlua_transform.c.
|
static |
Applies translation to a transform.
Lua function parameter: Transform T Transform to apply translation to. Lua function parameter: number x X-axis translation. Lua function parameter: number y Y-axis translation. Lua function parameter: number z Z-axis translation. Lua return parameter: Transform A new transformation.
| L | Lua State |
Lua function: translate
Definition at line 280 of file nlua_transform.c.
|
static |
Transform metatable methods.
Definition at line 33 of file nlua_transform.c.