Moai SDK
2.0
|
Additional Inherited Members | |
Function List inherited from MOAITransformBase | |
getWorldDir | |
getWorldLoc | |
getWorldRot | |
getWorldScl | |
getWorldXAxis | |
getWorldYAxis | |
getWorldZAxis | |
getWorldXNormal | |
getWorldYNormal | |
getWorldZNormal | |
modelToWorld | |
setParent | |
worldToModel | |
|
|
Create and add a set of collision edges to the body.
function addChain ( MOAIBox2DBody self, table verts [, boolean closeChain ] )
MOAIBox2DBody | self |
table | verts Array containing vertex coordinate components ( t[1] = x0, t[2] = y0, t[3] = x1, t[4] = y1... ) |
boolean | closeChain Optional. Default value is false. |
|
Create and add circle fixture to the body.
function addCircle ( MOAIBox2DBody self, number x, number y, number radius )
MOAIBox2DBody | self |
number | x in units, world coordinates, converted to meters |
number | y in units, world coordinates, converted to meters |
number | radius in units, converted to meters |
|
Create and add a polygon fixture to the body.
function addEdges ( MOAIBox2DBody self, table verts )
MOAIBox2DBody | self |
table | verts 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 )
MOAIBox2DBody | self |
table | verts 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 )
MOAIBox2DBody | self |
number | xMin in units, world coordinates, converted to meters |
number | yMin in units, world coordinates, converted to meters |
number | xMax in units, world coordinates, converted to meters |
number | yMax in units, world coordinates, converted to meters |
number | angle |
|
See Box2D documentation.
function applyAngularImpulse ( MOAIBox2DBody self, number angularImpulse [, boolean wake ] )
MOAIBox2DBody | self |
number | angularImpulse in kg * units / s, converted to kg * m / s |
boolean | wake Optional. wake this body. Default is true |
|
See Box2D documentation.
function applyForce ( MOAIBox2DBody self, number forceX, number forceY [, number pointX, number pointY, boolean wake ] )
MOAIBox2DBody | self |
number | forceX in kg * units / s^2, converted to N [kg * m / s^2] |
number | forceY in kg * units / s^2, converted to N [kg * m / s^2] |
number | pointX Optional. in units, world coordinates, converted to meters |
number | pointY Optional. in units, world coordinates, converted to meters |
boolean | wake Optional. wake this body. Default is true |
|
See Box2D documentation.
function applyLinearImpulse ( MOAIBox2DBody self, number impulseX, number impulseY [, number pointX, number pointY, boolean wake ] )
MOAIBox2DBody | self |
number | impulseX in kg * units / s, converted to kg * m / s |
number | impulseY in kg * units / s, converted to kg * m / s |
number | pointX Optional. in units, world coordinates, converted to meters |
number | pointY Optional. in units, world coordinates, converted to meters |
boolean | wake Optional. wake this body. Default is true |
|
See Box2D documentation.
function applyTorque ( MOAIBox2DBody self [, number torque, boolean wake ] )
MOAIBox2DBody | self |
number | torque Optional. in (kg * units / s^2) * units, converted to N-m. Default value is 0. |
boolean | wake Optional. wake this body. Default is true |
|
Schedule body for destruction.
function destroy ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getAngle ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getAngularVelocity ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
Returns list of MOAIBox2DBody that are in contact with this body.
function getContactList ( MOAIBox2DBody self, boolean touching )
MOAIBox2DBody | self |
boolean | touching |
|
See Box2D documentation.
function getGravityScale ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getInertia ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getLinearVelocity ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getLocalCenter ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getMass ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getPosition ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function getWorldCenter ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function isActive ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function isAwake ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function isBullet ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function isFixedRotation ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function resetMassData ( MOAIBox2DBody self )
MOAIBox2DBody | self |
|
See Box2D documentation.
function setActive ( MOAIBox2DBody self [, boolean active ] )
MOAIBox2DBody | self |
boolean | active Optional. Default value is false. |
|
See Box2D documentation.
function setAngularDamping ( MOAIBox2DBody self, number damping )
MOAIBox2DBody | self |
number | damping |
|
See Box2D documentation.
function setAngularVelocity ( MOAIBox2DBody self [, number omega ] )
MOAIBox2DBody | self |
number | omega Optional. Angular velocity in degrees/s, converted to radians/s. Default value is 0. |
|
See Box2D documentation.
function setAwake ( MOAIBox2DBody self [, boolean awake ] )
MOAIBox2DBody | self |
boolean | awake Optional. Default value is true. |
|
See Box2D documentation.
function setBullet ( MOAIBox2DBody self [, boolean bullet ] )
MOAIBox2DBody | self |
boolean | bullet Optional. Default value is true. |
|
See Box2D documentation.
function setFixedRotation ( MOAIBox2DBody self [, boolean fixedRotation ] )
MOAIBox2DBody | self |
boolean | fixedRotation Optional. Default value is true. |
|
See Box2D documentation.
function setGravityScale ( MOAIBox2DBody self [, number gravityScale. ] )
MOAIBox2DBody | self |
number | gravityScale. Optional. |
|
See Box2D documentation.
function setLinearDamping ( MOAIBox2DBody self [, number damping ] )
MOAIBox2DBody | self |
number | damping Optional. |
|
See Box2D documentation.
function setLinearVelocity ( MOAIBox2DBody self [, number velocityX, number velocityY ] )
MOAIBox2DBody | self |
number | velocityX Optional. in unit/s, converted to m/s. Default is 0. |
number | velocityY 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 ] )
MOAIBox2DBody | self |
number | mass in kg. |
number | I Optional. in kg*units^2, converted to kg * m^2. Default is previous value for I. |
number | centerX Optional. in units, local coordinates, converted to meters. Default is previous value for centerX. |
number | centerY 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 ] )
MOAIBox2DBody | self |
number | positionX Optional. in units, world coordinates, converted to meters. Default is 0. |
number | positionY Optional. in units, world coordinates, converted to meters. Default is 0. |
number | angle Optional. In degrees, converted to radians. Default is 0. |
|
See Box2D documentation.
function setType ( MOAIBox2DBody self, number type )
MOAIBox2DBody | self |
number | type One of MOAIBox2DBody.DYNAMIC, MOAIBox2DBody.KINEMATIC, MOAIBox2DBody.STATIC |