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