Moai SDK
1.5 revision 1 (MoaiEdition)
|
Inherits MOAILuaObject, and MOAICpPrim.
Returns the area for a ring or circle.
function areaForCircle ( number radius )
radius | ( number ) |
function areaForCircle ( number innerRadius, number outerRadius )
innerRadius | ( number ) |
outerRadius | ( number ) |
Returns the area for a polygon.
function areaForPolygon ( table vertices )
vertices | ( table ) Array containing vertex coordinate components ( t[1] = x0, t[2] = y0, t[3] = x1, t[4] = y1... ) |
Returns the area for the specified rectangle.
function areaForRect ( number x1, number y1, number x2, number y2 )
x1 | ( number ) |
y1 | ( number ) |
x2 | ( number ) |
y2 | ( number ) |
Returns the area for the specified segment.
function areaForSegment ( number x1, number y1, number x2, number y2, number r )
x1 | ( number ) |
y1 | ( number ) |
x2 | ( number ) |
y2 | ( number ) |
r | ( number ) |
Returns the current body for the shape.
function getBody ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns the current elasticity.
function getElasticity ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns the current friction.
function getFriction ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns the current group ID.
function getGroup ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns the current layer ID.
function getLayers ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns the current surface velocity?
function getSurfaceVel ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns the current collision type.
function getType ( MOAICpShape self )
self | ( MOAICpShape ) |
Returns whether the specified point is inside the shape.
function inside ( MOAICpShape self, number x, number y )
self | ( MOAICpShape ) |
x | ( number ) |
y | ( number ) |
Returns whether the current shape is a sensor.
function isSensor ( MOAICpShape self )
self | ( MOAICpShape ) |
Return the moment of inertia for the circle.
function momentForCircle ( number m, number r1, number r2, number ox, number oy )
m | ( number ) |
r1 | ( number ) |
r2 | ( number ) |
ox | ( number ) |
oy | ( number ) |
Returns the moment of intertia for the polygon.
function momentForPolygon ( number m, table polygon )
m | ( number ) |
polygon | ( table ) |
Returns the moment of intertia for the rect.
function momentForRect ( number m, number x1, number y1, number x2, number y2 )
m | ( number ) |
x1 | ( number ) |
y1 | ( number ) |
x2 | ( number ) |
y2 | ( number ) |
Returns the moment of intertia for the segment.
function momentForSegment ( number m, number x1, number y1, number x2, number y2 )
m | ( number ) |
x1 | ( number ) |
y1 | ( number ) |
x2 | ( number ) |
y2 | ( number ) |
Sets the current elasticity.
function setElasticity ( MOAICpShape self, number elasticity )
self | ( MOAICpShape ) |
elasticity | ( number ) The elasticity. |
Sets the current friction.
function setFriction ( MOAICpShape self, number friction )
self | ( MOAICpShape ) |
friction | ( number ) The friction. |
Sets the current group ID.
function setGroup ( MOAICpShape self, number group )
self | ( MOAICpShape ) |
group | ( number ) The group ID. |
Sets whether this shape is a sensor.
function setIsSensor ( MOAICpShape self, boolean sensor )
self | ( MOAICpShape ) |
sensor | ( boolean ) Whether this shape is a sensor. |
Sets the current layer ID.
function setLayers ( MOAICpShape self, number layer )
self | ( MOAICpShape ) |
layer | ( number ) The layer ID. |
Sets the current surface velocity.
function setSurfaceVel ( MOAICpShape self, number x, number y )
self | ( MOAICpShape ) |
x | ( number ) The X component of the surface velocity. |
y | ( number ) The Y component of the surface velocity. |
Sets the current collision type.
function setType ( MOAICpShape self, number type )
self | ( MOAICpShape ) |
type | ( number ) The collision type. |