Moai SDK  2.0
MOAIBox2DFixture Class Reference

Inherits MOAIBox2DPrim.

Function List

destroy
 
getBody
 
getFilter
 
setCollisionHandler
 
setDensity
 
setFilter
 
setFriction
 
setRestitution
 
setSensor
 

Function Documentation

destroy

Schedule fixture for destruction.


function destroy ( MOAIBox2DFixture self )

Parameters
MOAIBox2DFixtureself
Returns
nil
getBody

Returns the body that owns the fixture.


function getBody ( MOAIBox2DFixture self )

Parameters
MOAIBox2DFixtureself
Returns
MOAIBox2DBody body
getFilter

See Box2D documentation.


function getFilter ( MOAIBox2DFixture self )

Parameters
MOAIBox2DFixtureself
Returns
number categoryBits, number maskBits, number groupIndex
setCollisionHandler

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
MOAIBox2DFixtureself
functionhandler
numberphaseMask Optional. Any bitwise combination of MOAIBox2DArbiter.BEGIN, MOAIBox2DArbiter.END, MOAIBox2DArbiter.POST_SOLVE, MOAIBox2DArbiter.PRE_SOLVE, MOAIBox2DArbiter.ALL
numbercategoryMask Optional. Check against opposing fixture's category bits and generate collision events if match.
Returns
nil
setDensity

See Box2D documentation.


function setDensity ( MOAIBox2DFixture self, number density )

Parameters
MOAIBox2DFixtureself
numberdensity In kg/units^2, converted to kg/m^2
Returns
nil
setFilter

See Box2D documentation.


function setFilter ( MOAIBox2DFixture self, number categoryBits [, number maskBits, number groupIndex ] )

Parameters
MOAIBox2DFixtureself
numbercategoryBits
numbermaskBits Optional.
numbergroupIndex Optional.
Returns
nil
setFriction

See Box2D documentation.


function setFriction ( MOAIBox2DFixture self, number friction )

Parameters
MOAIBox2DFixtureself
numberfriction
Returns
nil
setRestitution

See Box2D documentation.


function setRestitution ( MOAIBox2DFixture self, number restitution )

Parameters
MOAIBox2DFixtureself
numberrestitution
Returns
nil
setSensor

See Box2D documentation.


function setSensor ( MOAIBox2DFixture self [, boolean isSensor ] )

Parameters
MOAIBox2DFixtureself
booleanisSensor Optional. Default value is 'true'
Returns
nil