|
Moai SDK
1.5 revision 1 (MoaiEdition)
|
Create and add a set of collision edges to the body.
function addChain ( MOAIBox2DBody self, table verts [, boolean closeChain ] )
| self | ( MOAIBox2DBody ) |
| verts | ( table ) Array containing vertex coordinate components ( t[1] = x0, t[2] = y0, t[3] = x1, t[4] = y1... ) |
| closeChain | ( boolean ) Optional. Default value is false. |
Create and add circle fixture to the body.
function addCircle ( MOAIBox2DBody self, number x, number y, number radius )
| self | ( MOAIBox2DBody ) |
| x | ( number ) in units, world coordinates, converted to meters |
| y | ( number ) in units, world coordinates, converted to meters |
| radius | ( number ) in units, converted to meters |
Create and add a polygon fixture to the body.
function addEdges ( MOAIBox2DBody self, table verts )
| self | ( MOAIBox2DBody ) |
| verts | ( table ) Array containing vertex coordinate components in units, world coordinates, converted to meters ( t[1] = x0, t[2] = y0, t[3] = x1, t[4] = y1... ) |
Create and add a polygon fixture to the body.
function addPolygon ( MOAIBox2DBody self, table verts )
| self | ( MOAIBox2DBody ) |
| verts | ( table ) Array containing vertex coordinate components in units, world coordinates, converted to meters. ( t[1] = x0, t[2] = y0, t[3] = x1, t[4] = y1... ) |
Create and add a rect fixture to the body.
function addRect ( MOAIBox2DBody self, number xMin, number yMin, number xMax, number yMax, number angle )
| self | ( MOAIBox2DBody ) |
| xMin | ( number ) in units, world coordinates, converted to meters |
| yMin | ( number ) in units, world coordinates, converted to meters |
| xMax | ( number ) in units, world coordinates, converted to meters |
| yMax | ( number ) in units, world coordinates, converted to meters |
| angle | ( number ) |
See Box2D documentation.
function applyAngularImpulse ( MOAIBox2DBody self, number angularImpulse )
| self | ( MOAIBox2DBody ) |
| angularImpulse | ( number ) in kg * units / s, converted to kg * m / s |
See Box2D documentation.
function applyForce ( MOAIBox2DBody self, number forceX, number forceY [, number pointX, number pointY ] )
| self | ( MOAIBox2DBody ) |
| forceX | ( number ) in kg * units / s^2, converted to N [kg * m / s^2] |
| forceY | ( number ) in kg * units / s^2, converted to N [kg * m / s^2] |
| pointX | ( number ) Optional. in units, world coordinates, converted to meters |
| pointY | ( number ) Optional. in units, world coordinates, converted to meters |
See Box2D documentation.
function applyLinearImpulse ( MOAIBox2DBody self, number impulseX, number impulseY [, number pointX, number pointY ] )
| self | ( MOAIBox2DBody ) |
| impulseX | ( number ) in kg * units / s, converted to kg * m / s |
| impulseY | ( number ) in kg * units / s, converted to kg * m / s |
| pointX | ( number ) Optional. in units, world coordinates, converted to meters |
| pointY | ( number ) Optional. in units, world coordinates, converted to meters |
See Box2D documentation.
function applyTorque ( MOAIBox2DBody self [, number torque ] )
| self | ( MOAIBox2DBody ) |
| torque | ( number ) Optional. in (kg * units / s^2) * units, converted to N-m. Default value is 0. |
Schedule body for destruction.
function destroy ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getAngle ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getAngularVelocity ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getInertia ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getLinearVelocity ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getLocalCenter ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getMass ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getPosition ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function getWorldCenter ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function isActive ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function isAwake ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function isBullet ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function isFixedRotation ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function resetMassData ( MOAIBox2DBody self )
| self | ( MOAIBox2DBody ) |
See Box2D documentation.
function setActive ( MOAIBox2DBody self [, boolean active ] )
| self | ( MOAIBox2DBody ) |
| active | ( boolean ) Optional. Default value is false. |
See Box2D documentation.
function setAngularDamping ( MOAIBox2DBody self, number damping )
| self | ( MOAIBox2DBody ) |
| damping | ( number ) |
See Box2D documentation.
function setAngularVelocity ( MOAIBox2DBody self [, number omega ] )
| self | ( MOAIBox2DBody ) |
| omega | ( number ) Optional. Angular velocity in degrees/s, converted to radians/s. Default value is 0. |
See Box2D documentation.
function setAwake ( MOAIBox2DBody self [, boolean awake ] )
| self | ( MOAIBox2DBody ) |
| awake | ( boolean ) Optional. Default value is true. |
See Box2D documentation.
function setBullet ( MOAIBox2DBody self [, boolean bullet ] )
| self | ( MOAIBox2DBody ) |
| bullet | ( boolean ) Optional. Default value is true. |
See Box2D documentation.
function setFixedRotation ( MOAIBox2DBody self [, boolean fixedRotation ] )
| self | ( MOAIBox2DBody ) |
| fixedRotation | ( boolean ) Optional. Default value is true. |
See Box2D documentation.
function setLinearDamping ( MOAIBox2DBody self [, number damping ] )
| self | ( MOAIBox2DBody ) |
| damping | ( number ) Optional. |
See Box2D documentation.
function setLinearVelocity ( MOAIBox2DBody self [, number velocityX, number velocityY ] )
| self | ( MOAIBox2DBody ) |
| velocityX | ( number ) Optional. in unit/s, converted to m/s. Default is 0. |
| velocityY | ( number ) Optional. in unit/s, converted to m/s. Default is 0. |
See Box2D documentation.
function setMassData ( MOAIBox2DBody self, number mass [, number I, number centerX, number centerY ] )
| self | ( MOAIBox2DBody ) |
| mass | ( number ) in kg. |
| I | ( number ) Optional. in kg*units^2, converted to kg * m^2. Default is previous value for I. |
| centerX | ( number ) Optional. in units, local coordinates, converted to meters. Default is previous value for centerX. |
| centerY | ( number ) Optional. in units, local coordinates, converted to meters. Default is previous value for centerY. |
See Box2D documentation.
function setTransform ( MOAIBox2DBody self [, number positionX, number positionY, number angle ] )
| self | ( MOAIBox2DBody ) |
| positionX | ( number ) Optional. in units, world coordinates, converted to meters. Default is 0. |
| positionY | ( number ) Optional. in units, world coordinates, converted to meters. Default is 0. |
| angle | ( number ) Optional. In degrees, converted to radians. Default is 0. |
See Box2D documentation.
function setType ( MOAIBox2DBody self, number type )
| self | ( MOAIBox2DBody ) |
| type | ( number ) One of MOAIBox2DBody.DYNAMIC, MOAIBox2DBody.KINEMATIC, MOAIBox2DBody.STATIC |