|
Lua API
0.4.0
Game Engine
|
Functions | |
| rotate (object, axis, angle,"local") | |
| Rotates an object. More... | |
| translate (object,{x, y, z},"local") | |
| Translates an object. More... | |
| getPosition (object) | |
| Retrieves the position of an object. More... | |
| getRotation (object) | |
| Retrieves the rotation of an object. More... | |
| getScale (object) | |
| Retrieves the scale of an object. More... | |
| setPosition (object, pos) | |
| Sets the position of an object. More... | |
| setRotation (object, rot) | |
| Sets the rotation of an object. More... | |
| setScale (object, scale) | |
| Sets the scale of an object. More... | |
| getTransformedPosition (object) | |
| Retrieves the transformed position of an object. More... | |
| getTransformedRotation (object) | |
| Retrieves the transformed rotation of an object. More... | |
| getTransformedScale (object) | |
| Retrieves the transformed scale of an object. More... | |
| getInverseRotatedVector (object, vector) | |
| Calculates the inverse rotated vector according to the matrix of the object. More... | |
| getRotatedVector (object, vector) | |
| Rotates the given vector according to the matrix of the given object. More... | |
| getInverseVector (object, vector) | |
| Calculates the inverse vector according to the matrix of the object. More... | |
| getTransformedVector (object, vector) | |
| Multiplies the given with the matrix of the given object. More... | |
| updateMatrix (object) | |
| Recalculates the matrix of the given object. More... | |
| getMatrix (object) | |
| Retrieves the matrix of an object as a table. More... | |
| getInverseRotatedVector | ( | object | , |
| vector | |||
| ) |
Calculates the inverse rotated vector according to the matrix of the object.
| object | The object. |
| vector | The vec3 containing positional data. |
| getInverseVector | ( | object | , |
| vector | |||
| ) |
Calculates the inverse vector according to the matrix of the object.
This can be useful for converting global vectors into local vectors.
| object | The object. |
| vector | The vec3 containing positional data. |
| getMatrix | ( | object | ) |
Retrieves the matrix of an object as a table.
| object | The object. |
| getPosition | ( | object | ) |
Retrieves the position of an object.
| object | The object. |
| getRotatedVector | ( | object | , |
| vector | |||
| ) |
Rotates the given vector according to the matrix of the given object.
| object | The object. |
| vector | The vec3 containing positional data. |
| getRotation | ( | object | ) |
Retrieves the rotation of an object.
| object | The object. |
| getScale | ( | object | ) |
Retrieves the scale of an object.
| object | The object. |
| getTransformedPosition | ( | object | ) |
Retrieves the transformed position of an object.
This includes all transformations done by parents.
| object | The object. |
| getTransformedRotation | ( | object | ) |
Retrieves the transformed rotation of an object.
This includes all transformations done by parents.
| object | The object. |
| getTransformedScale | ( | object | ) |
Retrieves the transformed scale of an object.
This includes all transformations done by parents.
| object | The object. |
| getTransformedVector | ( | object | , |
| vector | |||
| ) |
Multiplies the given with the matrix of the given object.
This is useful for converting local to global coordinates.
| object | The object. |
| vector | The vec3 containing positional data. |
| rotate | ( | object | , |
| axis | , | ||
| angle | , | ||
| "local" | |||
| ) |
Rotates an object.
The local parameter is optional.
Example:
| object | The object to rotate. |
| axis | An vec3 containing the axis to rotate around. |
| angle | The angle to rotate. |
| local | Specifies if the rotation is in the global or the local space. |
| setPosition | ( | object | , |
| pos | |||
| ) |
Sets the position of an object.
| object | The object. |
| pos | A vec3 containing the new position. |
| setRotation | ( | object | , |
| rot | |||
| ) |
Sets the rotation of an object.
| object | The object. |
| rot | A vec3 containing the new rotation. |
| setScale | ( | object | , |
| scale | |||
| ) |
Sets the scale of an object.
| object | The object. |
| scale | A vec3 containing the new scale. |
| translate | ( | object | , |
| {x, y, z} | , | ||
| "local" | |||
| ) |
Translates an object.
The local parameter is optional.
Example:
| object | The object to translate. |
| axis | An vec3 containing the direction to translate to. |
| local | Specifies if the translation is in the global or the local space. |
| updateMatrix | ( | object | ) |
Recalculates the matrix of the given object.
| object | The object. |