Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIBox2DFixture Class Reference

Inherits MOAIBox2DPrim.

List of all members.

Function List

  destroy
  getBody
  getFilter
  setCollisionHandler
  setDensity
  setFilter
  setFriction
  setRestitution
  setSensor

Function Documentation

Schedule fixture for destruction.


function destroy ( MOAIBox2DFixture self )
Parameters:
self ( MOAIBox2DFixture )
Returns:
nil

Returns the body that owns the fixture.


function getBody ( MOAIBox2DFixture self )
Parameters:
self ( MOAIBox2DFixture )
Returns:
body ( MOAIBox2DBody )

See Box2D documentation.


function getFilter ( MOAIBox2DFixture self )
Parameters:
self ( MOAIBox2DFixture )
Returns:
categoryBits ( number ), maskBits ( number ), groupIndex ( number )

Sets a Lua function to call when collisions occur. The handler should accept the following parameters: ( phase, fixtureA, fixtureB, arbiter ). 'phase' will be one of the phase masks. 'fixtureA' will be the fixture receiving the collision. 'fixtureB' will be the other fixture in the collision. 'arbiter' will be the MOAIArbiter. Note that the arbiter is only good for the current collision: do not keep references to it for later use.


function setCollisionHandler ( MOAIBox2DFixture self, function handler [, number phaseMask, number categoryMask ] )
Parameters:
self ( MOAIBox2DFixture )
handler ( function )
phaseMask ( number ) Optional. Any bitwise combination of MOAIBox2DArbiter.BEGIN, MOAIBox2DArbiter.END, MOAIBox2DArbiter.POST_SOLVE, MOAIBox2DArbiter.PRE_SOLVE, MOAIBox2DArbiter.ALL
categoryMask ( number ) Optional. Check against opposing fixture's category bits and generate collision events if match.
Returns:
nil

See Box2D documentation.


function setDensity ( MOAIBox2DFixture self, number density )
Parameters:
self ( MOAIBox2DFixture )
density ( number ) In kg/units^2, converted to kg/m^2
Returns:
nil

See Box2D documentation.


function setFilter ( MOAIBox2DFixture self, number categoryBits [, number maskBits, number groupIndex ] )
Parameters:
self ( MOAIBox2DFixture )
categoryBits ( number )
maskBits ( number ) Optional.
groupIndex ( number ) Optional.
Returns:
nil

See Box2D documentation.


function setFriction ( MOAIBox2DFixture self, number friction )
Parameters:
self ( MOAIBox2DFixture )
friction ( number )
Returns:
nil

See Box2D documentation.


function setRestitution ( MOAIBox2DFixture self, number restitution )
Parameters:
self ( MOAIBox2DFixture )
restitution ( number )
Returns:
nil

See Box2D documentation.


function setSensor ( MOAIBox2DFixture self [, boolean isSensor ] )
Parameters:
self ( MOAIBox2DFixture )
isSensor ( boolean ) Optional. Default value is 'true'
Returns:
nil