|
Moai SDK
1.5 revision 1 (MoaiEdition)
|
Create and add a body to the world.
function addBody ( MOAIBox2DWorld self, number type [, number x, number y ] )
| self | ( MOAIBox2DWorld ) |
| type | ( number ) One of MOAIBox2DBody.DYNAMIC, MOAIBox2DBody.KINEMATIC, MOAIBox2DBody.STATIC |
| x | ( number ) Optional. in units, in world coordinates, converted to meters |
| y | ( number ) Optional. in units, in world coordinates, converted to meters |
Create and add a joint to the world. See Box2D documentation.
function addDistanceJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number anchorA_X, number anchorA_Y, number anchorB_X, number anchorB_Y [, number frequencyHz, number dampingRatio, boolean collideConnected ] )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| anchorA_X | ( number ) in units, in world coordinates, converted to meters |
| anchorA_Y | ( number ) in units, in world coordinates, converted to meters |
| anchorB_X | ( number ) in units, in world coordinates, converted to meters |
| anchorB_Y | ( number ) in units, in world coordinates, converted to meters |
| frequencyHz | ( number ) Optional. in Hz. Default value determined by Box2D |
| dampingRatio | ( number ) Optional. Default value determined by Box2D |
| collideConnected | ( boolean ) Optional. Default value is false |
Create and add a joint to the world. See Box2D documentation.
function addFrictionJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number anchorX, number anchorY [, number maxForce, number maxTorque ] )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| anchorX | ( number ) in units, in world coordinates, converted to meters |
| anchorY | ( number ) in units, in world coordinates, converted to meters |
| maxForce | ( number ) Optional. in kg * units / s^2, converted to N [kg * m / s^2]. Default value determined by Box2D |
| maxTorque | ( number ) Optional. in kg * units / s^2 * units, converted to N-m [kg * m / s^2 * m]. Default value determined by Box2D |
Create and add a joint to the world. See Box2D documentation.
function addGearJoint ( MOAIBox2DWorld self, MOAIBox2DJoint jointA, MOAIBox2DJoint jointB, number ratio )
| self | ( MOAIBox2DWorld ) |
| jointA | ( MOAIBox2DJoint ) |
| jointB | ( MOAIBox2DJoint ) |
| ratio | ( number ) |
Create and add a joint to the world. See Box2D documentation.
function addMouseJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number targetX, number targetY, number maxForce [, number frequencyHz, number dampingRatio ] )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| targetX | ( number ) in units, in world coordinates, converted to meters |
| targetY | ( number ) in units, in world coordinates, converted to meters |
| maxForce | ( number ) in kg * units / s^2, converted to N [kg * m / s^2]. |
| frequencyHz | ( number ) Optional. in Hz. Default value determined by Box2D |
| dampingRatio | ( number ) Optional. Default value determined by Box2D |
Create and add a joint to the world. See Box2D documentation.
function addPrismaticJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number anchorA, number anchorB, number axisA, number axisB )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| anchorA | ( number ) in units, in world coordinates, converted to meters |
| anchorB | ( number ) in units, in world coordinates, converted to meters |
| axisA | ( number ) translation axis vector X component (no units) |
| axisB | ( number ) translation axis vector Y component (no units) |
Create and add a joint to the world. See Box2D documentation.
function addPulleyJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number groundAnchorA_X, number groundAnchorA_Y, number groundAnchorB_X, number groundAnchorB_Y, number anchorA_X, number anchorA_Y, number anchorB_X, number anchorB_Y, number ratio, number maxLengthA, number maxLengthB )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| groundAnchorA_X | ( number ) in units, in world coordinates, converted to meters |
| groundAnchorA_Y | ( number ) in units, in world coordinates, converted to meters |
| groundAnchorB_X | ( number ) in units, in world coordinates, converted to meters |
| groundAnchorB_Y | ( number ) in units, in world coordinates, converted to meters |
| anchorA_X | ( number ) in units, in world coordinates, converted to meters |
| anchorA_Y | ( number ) in units, in world coordinates, converted to meters |
| anchorB_X | ( number ) in units, in world coordinates, converted to meters |
| anchorB_Y | ( number ) in units, in world coordinates, converted to meters |
| ratio | ( number ) |
| maxLengthA | ( number ) in units, converted to meters |
| maxLengthB | ( number ) in units, converted to meters |
Create and add a joint to the world. See Box2D documentation.
function addRevoluteJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number anchorX, number anchorY )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| anchorX | ( number ) in units, in world coordinates, converted to meters |
| anchorY | ( number ) in units, in world coordinates, converted to meters |
Create and add a rope joint to the world. See Box2D documentation.
function addRopeJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number maxLength [, number anchorAX, number anchorAY, number anchorBX, number anchorBY, boolean collideConnected ] )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| maxLength | ( number ) in units, converted to meters |
| anchorAX | ( number ) Optional. in units, in world coordinates, converted to meters |
| anchorAY | ( number ) Optional. in units, in world coordinates, converted to meters |
| anchorBX | ( number ) Optional. in units, in world coordinates, converted to meters |
| anchorBY | ( number ) Optional. in units, in world coordinates, converted to meters |
| collideConnected | ( boolean ) Optional. Default value is false |
Create and add a joint to the world. See Box2D documentation.
function addWeldJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number anchorX, number anchorY )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| anchorX | ( number ) in units, in world coordinates, converted to meters |
| anchorY | ( number ) in units, in world coordinates, converted to meters |
Create and add a joint to the world. See Box2D documentation.
function addWheelJoint ( MOAIBox2DWorld self, MOAIBox2DBody bodyA, MOAIBox2DBody bodyB, number anchorX, number anchorY, number axisX, number axisY )
| self | ( MOAIBox2DWorld ) |
| bodyA | ( MOAIBox2DBody ) |
| bodyB | ( MOAIBox2DBody ) |
| anchorX | ( number ) in units, in world coordinates, converted to meters |
| anchorY | ( number ) in units, in world coordinates, converted to meters |
| axisX | ( number ) translation axis vector X component (no units) |
| axisY | ( number ) translation axis vector Y component (no units) |
See Box2D documentation.
function getAngularSleepTolerance ( MOAIBox2DWorld self )
| self | ( MOAIBox2DWorld ) |
See Box2D documentation.
function getAutoClearForces ( MOAIBox2DWorld self )
| self | ( MOAIBox2DWorld ) |
See Box2D documentation.
function getGravity ( MOAIBox2DWorld self )
| self | ( MOAIBox2DWorld ) |
See Box2D documentation.
function getLinearSleepTolerance ( MOAIBox2DWorld self )
| self | ( MOAIBox2DWorld ) |
return RayCast 1st point hit
function getRayCast ( MOAIBox2DWorld self, number p1x, number p1y, number p2x, number p2y )
| self | ( MOAIBox2DWorld ) |
| p1x | ( number ) |
| p1y | ( number ) |
| p2x | ( number ) |
| p2y | ( number ) |
See Box2D documentation.
function getTimeToSleep ( MOAIBox2DWorld self )
| self | ( MOAIBox2DWorld ) |
See Box2D documentation.
function setAngularSleepTolerance ( MOAIBox2DWorld self [, number angularSleepTolerance ] )
| self | ( MOAIBox2DWorld ) |
| angularSleepTolerance | ( number ) Optional. in degrees/s, converted to radians/s. Default value is 0.0f. |
See Box2D documentation.
function setAutoClearForces ( MOAIBox2DWorld self [, boolean autoClearForces ] )
| self | ( MOAIBox2DWorld ) |
| autoClearForces | ( boolean ) Optional. Default value is 'true' |
enable/disable debug drawing.
function setDebugDrawEnabled ( MOAIBox2DWorld self, boolean enable )
| self | ( MOAIBox2DWorld ) |
| enable | ( boolean ) |
Sets mask for debug drawing.
function setDebugDrawFlags ( MOAIBox2DWorld self [, number flags ] )
| self | ( MOAIBox2DWorld ) |
| flags | ( number ) Optional. One of MOAIBox2DWorld.DEBUG_DRAW_SHAPES, MOAIBox2DWorld.DEBUG_DRAW_JOINTS, MOAIBox2DWorld.DEBUG_DRAW_BOUNDS, MOAIBox2DWorld.DEBUG_DRAW_PAIRS, MOAIBox2DWorld.DEBUG_DRAW_CENTERS. Default value is MOAIBox2DWorld.DEBUG_DRAW_DEFAULT. |
See Box2D documentation.
function setGravity ( MOAIBox2DWorld self [, number gravityX, number gravityY ] )
| self | ( MOAIBox2DWorld ) |
| gravityX | ( number ) Optional. in units/s^2, converted to m/s^2. Default value is 0. |
| gravityY | ( number ) Optional. in units/s^2, converted to m/s^2. Default value is 0. |
See Box2D documentation.
function setIterations ( MOAIBox2DWorld self [, number velocityIteratons, number positionIterations ] )
| self | ( MOAIBox2DWorld ) |
| velocityIteratons | ( number ) Optional. Default value is current value of velocity iterations. |
| positionIterations | ( number ) Optional. Default value is current value of positions iterations. |
See Box2D documentation.
function setLinearSleepTolerance ( MOAIBox2DWorld self [, number linearSleepTolerance ] )
| self | ( MOAIBox2DWorld ) |
| linearSleepTolerance | ( number ) Optional. in units/s, converted to m/s. Default value is 0.0f. |
See Box2D documentation.
function setTimeToSleep ( MOAIBox2DWorld self [, number timeToSleep ] )
| self | ( MOAIBox2DWorld ) |
| timeToSleep | ( number ) Optional. Default value is 0.0f. |
Sets a scale factor for converting game world units to Box2D meters.
function setUnitsToMeters ( MOAIBox2DWorld self [, number unitsToMeters ] )
| self | ( MOAIBox2DWorld ) |
| unitsToMeters | ( number ) Optional. Default value is 1. |