Moai SDK
1.5 revision 1 (MoaiEdition)
|
Activates shapes that are currently touching the specified shape.
function activateShapesTouchingShape ( MOAICpSpace self, MOAICpShape shape )
self | ( MOAICpSpace ) |
shape | ( MOAICpShape ) |
Returns the current damping in the space.
function getDamping ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Returns the current gravity as two return values (x grav, y grav).
function getGravity ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Returns the speed threshold which indicates whether a body is idle (less than or equal to threshold) or in motion (greater than threshold).
function getIdleSpeedThreshold ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Returns the number of iterations the space is configured to perform.
function getIterations ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Returns the sleep time threshold.
function getSleepTimeThreshold ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Returns the static body associated with this space.
function getStaticBody ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Inserts a new prop into the world (can be used as a body, joint, etc.)
function insertProp ( MOAICpSpace self, MOAICpPrim prop )
self | ( MOAICpSpace ) |
prop | ( MOAICpPrim ) |
Updates the shape in the spatial hash.
function rehashShape ( MOAICpSpace self, MOAICpShape shape )
self | ( MOAICpSpace ) |
shape | ( MOAICpShape ) |
Updates the static shapes in the spatial hash.
function rehashStatic ( MOAICpSpace self )
self | ( MOAICpSpace ) |
Removes a prop (body, joint, etc.) from the space.
function removeProp ( MOAICpSpace self, MOAICpPrim prop )
self | ( MOAICpSpace ) |
prop | ( MOAICpPrim ) |
Sets the dimensions of the active object hash.
function resizeActiveHash ( MOAICpSpace self, number dim, number count )
self | ( MOAICpSpace ) |
dim | ( number ) |
count | ( number ) |
Sets the dimensions of the static object hash.
function resizeStaticHash ( MOAICpSpace self, number dim, number count )
self | ( MOAICpSpace ) |
dim | ( number ) |
count | ( number ) |
Sets a function to handle the specific collision type on this object. If nil is passed as the handler, the collision handler is unset.
function setCollisionHandler ( MOAICpSpace self, number collisionTypeA, number collisionTypeB, number mask, function handler )
self | ( MOAICpSpace ) |
collisionTypeA | ( number ) |
collisionTypeB | ( number ) |
mask | ( number ) |
handler | ( function ) |
Sets the current damping in the space.
function setDamping ( MOAICpSpace self, number damping )
self | ( MOAICpSpace ) |
damping | ( number ) |
Sets the current gravity in the space.
function setGravity ( MOAICpSpace self, number xGrav, number yGrav )
self | ( MOAICpSpace ) |
xGrav | ( number ) |
yGrav | ( number ) |
Sets the speed threshold which indicates whether a body is idle (less than or equal to threshold) or in motion (greater than threshold).
function setIdleSpeedThreshold ( MOAICpSpace self, number threshold )
self | ( MOAICpSpace ) |
threshold | ( number ) |
Sets the number of iterations performed each simulation step.
function setIterations ( MOAICpSpace self, number iterations )
self | ( MOAICpSpace ) |
iterations | ( number ) |
Sets the sleep time threshold. This is the amount of time it takes bodies at rest to fall asleep.
function setSleepTimeThreshold ( MOAICpSpace self, number threshold )
self | ( MOAICpSpace ) |
threshold | ( number ) |
Retrieves a shape located at the specified X and Y position, that exists on the specified layer (or any layer if nil) and is part of the specified group (or any group if nil).
function shapeForPoint ( MOAICpSpace self, number x, number y [, number layers, number group ] )
self | ( MOAICpSpace ) |
x | ( number ) |
y | ( number ) |
layers | ( number ) Optional. |
group | ( number ) Optional. |
Retrieves a shape that crosses the segment specified, that exists on the specified layer (or any layer if nil) and is part of the specified group (or any group if nil).
function shapeForSegment ( MOAICpSpace self, number x1, number y1, number x2, number y2 [, number layers, number group ] )
self | ( MOAICpSpace ) |
x1 | ( number ) |
y1 | ( number ) |
x2 | ( number ) |
y2 | ( number ) |
layers | ( number ) Optional. |
group | ( number ) Optional. |
Retrieves a list of shapes that overlap the point specified, that exists on the specified layer (or any layer if nil) and is part of the specified group (or any group if nil).
function shapeListForPoint ( MOAICpSpace self, number x, number y [, number layers, number group ] )
self | ( MOAICpSpace ) |
x | ( number ) |
y | ( number ) |
layers | ( number ) Optional. |
group | ( number ) Optional. |
Retrieves a list of shapes that overlap the rect specified, that exists on the specified layer (or any layer if nil) and is part of the specified group (or any group if nil).
function shapeListForRect ( MOAICpSpace self, number xMin, number yMin, number xMax, number yMax [, number layers, number group ] )
self | ( MOAICpSpace ) |
xMin | ( number ) |
yMin | ( number ) |
xMax | ( number ) |
yMax | ( number ) |
layers | ( number ) Optional. |
group | ( number ) Optional. |
Retrieves a list of shapes that overlap the segment specified, that exists on the specified layer (or any layer if nil) and is part of the specified group (or any group if nil).
function shapeListForSegment ( MOAICpSpace self, number x1, number y1, number x2, number y2 [, number layers, number group ] )
self | ( MOAICpSpace ) |
x1 | ( number ) |
y1 | ( number ) |
x2 | ( number ) |
y2 | ( number ) |
layers | ( number ) Optional. |
group | ( number ) Optional. |