Lua API
0.4.0
Game Engine
|
Functions | |
setGravity (vec3) | |
Sets the current gravity. More... | |
getGravity () | |
Returns the gravity in the current scene. More... | |
getLinearDamping (object) | |
Returns the linear damping from the given object. More... | |
setLinearDamping (object, damping) | |
Sets the linear damping of the given object. More... | |
getAngularDamping (object) | |
Returns the angular damping from the given object. More... | |
setAngularDamping (object, damping) | |
Sets the angular damping of the given object. More... | |
getLinearFactor (object) | |
Returns the linear factor from the given object. More... | |
setLinearFactor (object, factor) | |
Sets the linear factor of the given object. More... | |
getAngularFactor (object) | |
Returns the angular factor from the given object. More... | |
setAngularFactor (object, factor) | |
Sets the angular factor of the given object. More... | |
getMass (object) | |
Returns the mass of the given object. More... | |
setMass (object, mass) | |
Sets the mass of the given object. More... | |
getFriction (object) | |
Returns the friction constant of the given object. More... | |
setFriction (object, friction) | |
Sets the friction constant of the given object. More... | |
getRestitution (object) | |
Returns the physical restitution of the given object. More... | |
setRestitution (object, restitution) | |
Sets the restitution of the given object. More... | |
clearForces (object) | |
Removes all active forces from the given object. More... | |
addCentralForce (object, force, mode) | |
Applies a new central force to the given object. More... | |
addTorque (object, torque, mode) | |
Applies a new torque to the given object. More... | |
getCentralForce (object) | |
Returns the force applied to the given object. More... | |
getTorque (object) | |
Returns the torque applied to the given object. More... | |
isCollisionTest (object) | |
Checks if the object is colliding at all. More... | |
isCollisionBetween (object1, object2) | |
Checks if the two given objects are colliding. More... | |
getNumCollisions (object) | |
Returns the total number of collisions the given object currently has. More... | |
rayHit (start, end) | |
addCentralForce | ( | object | , |
force | , | ||
mode | |||
) |
Applies a new central force to the given object.
The new force will be added to the currently existing central force of the object. The mode parameter is optional and allows you to apply forces relative to the objects current rotation.
object | The physically active object. |
force | A vec3 containing the force to apply. |
mode | A string containing "local". Can be left out. |
addTorque | ( | object | , |
torque | , | ||
mode | |||
) |
Applies a new torque to the given object.
The new torque will be added to the currently existing torque of the object. The mode parameter is optional and allows you to apply a torque relative to the objects current rotation.
object | The physically active object. |
torque | A vec3 containing the torque to apply. |
mode | A string containing "local". Can be left out. |
clearForces | ( | object | ) |
Removes all active forces from the given object.
object | The physically activated object. |
getAngularDamping | ( | object | ) |
Returns the angular damping from the given object.
object | The physically active object |
getAngularFactor | ( | object | ) |
Returns the angular factor from the given object.
getCentralForce | ( | object | ) |
Returns the force applied to the given object.
object | The physically active object. |
getFriction | ( | object | ) |
Returns the friction constant of the given object.
object | The physically active object. |
getGravity | ( | ) |
Returns the gravity in the current scene.
getLinearDamping | ( | object | ) |
Returns the linear damping from the given object.
object | The physically active object |
getLinearFactor | ( | object | ) |
Returns the linear factor from the given object.
object | The physically active object |
getMass | ( | object | ) |
Returns the mass of the given object.
object | The physically active object. |
getNumCollisions | ( | object | ) |
Returns the total number of collisions the given object currently has.
object | The physically active object. |
getRestitution | ( | object | ) |
Returns the physical restitution of the given object.
object | The physically active object. |
getTorque | ( | object | ) |
Returns the torque applied to the given object.
object | The physically active object. |
isCollisionBetween | ( | object1 | , |
object2 | |||
) |
Checks if the two given objects are colliding.
object1 | The physically active object. |
object2 | The physically active object. |
isCollisionTest | ( | object | ) |
Checks if the object is colliding at all.
object | The physically active object. |
rayHit | ( | start | , |
end | |||
) |
setAngularDamping | ( | object | , |
damping | |||
) |
Sets the angular damping of the given object.
object | The physically active object |
damping | A number containing the angular damping. |
setAngularFactor | ( | object | , |
factor | |||
) |
Sets the angular factor of the given object.
object | The physically active object |
factor | A number containing the angular factor. |
setFriction | ( | object | , |
friction | |||
) |
Sets the friction constant of the given object.
object | The physically active object. |
friction | The new friction. |
setGravity | ( | vec3 | ) |
Sets the current gravity.
Example:
vec3 | A vec3 containing the new gravitational pull. |
setLinearDamping | ( | object | , |
damping | |||
) |
Sets the linear damping of the given object.
object | The physically active object |
damping | A number containing the linear damping. |
setLinearFactor | ( | object | , |
factor | |||
) |
Sets the linear factor of the given object.
object | The physically active object |
factor | A vec3 containing the linear factor. |
setMass | ( | object | , |
mass | |||
) |
Sets the mass of the given object.
object | The physically active object. |
mass | The new mass. |
setRestitution | ( | object | , |
restitution | |||
) |
Sets the restitution of the given object.
object | The physically active object. |
restitution | The new restitution. |