Moai SDK  2.0
MOAIBox2DArbiter Class Reference

Inherits MOAILuaObject, and b2ContactListener.

Function List

getContactNormal
 
getContactPoints
 
getNormalImpulse
 
getTangentImpulse
 
setContactEnabled
 

Detailed Description

Flags
MOAIBox2DArbiter.BEGIN
MOAIBox2DArbiter.END
MOAIBox2DArbiter.POST_SOLVE
MOAIBox2DArbiter.PRE_SOLVE
MOAIBox2DArbiter.ALL

Function Documentation

getContactNormal

Returns the normal for the contact.


function getContactNormal ( MOAIBox2DArbiter self )

Parameters
MOAIBox2DArbiterself
Returns
number normal.x, number normal.y
getContactPoints

Returns the contact points in world space. There can be 0, 1 or 2 points (see box2d manual section 4.11)


function getContactPoints ( MOAIBox2DArbiter self )

Parameters
MOAIBox2DArbiterself
Returns
number p1.x, number p1.y, number p2.x, number p2.y
getNormalImpulse

Returns total normal impulse for contact.


function getNormalImpulse ( MOAIBox2DArbiter self )

Parameters
MOAIBox2DArbiterself
Returns
number impulse
getTangentImpulse

Returns total tangent impulse for contact.


function getTangentImpulse ( MOAIBox2DArbiter self )

Parameters
MOAIBox2DArbiterself
Returns
number impulse
setContactEnabled

Enabled or disable the contact.


function setContactEnabled ( MOAIBox2DArbiter self, boolean enabled )

Parameters
MOAIBox2DArbiterself
booleanenabled
Returns
nil