Moai SDK  1.5 revision 1 (MoaiEdition)
MOAICpSpace Class Reference
Inheritance diagram for MOAICpSpace:
MOAIAction MOAIInstanceEventSource MOAIEventSource

List of all members.

Function List

  activateShapesTouchingShape
  getDamping
  getGravity
  getIdleSpeedThreshold
  getIterations
  getSleepTimeThreshold
  getStaticBody
  insertProp
  rehashShape
  rehashStatic
  removeProp
  resizeActiveHash
  resizeStaticHash
  setCollisionHandler
  setDamping
  setGravity
  setIdleSpeedThreshold
  setIterations
  setSleepTimeThreshold
  shapeForPoint
  shapeForSegment
  shapeListForPoint
  shapeListForRect
  shapeListForSegment

Function Documentation

Activates shapes that are currently touching the specified shape.


function activateShapesTouchingShape ( MOAICpSpace self, MOAICpShape shape )
Parameters:
self ( MOAICpSpace )
shape ( MOAICpShape )
Returns:
nil

Returns the current damping in the space.


function getDamping ( MOAICpSpace self )
Parameters:
self ( MOAICpSpace )
Returns:
damping ( number )

Returns the current gravity as two return values (x grav, y grav).


function getGravity ( MOAICpSpace self )
Parameters:
self ( MOAICpSpace )
Returns:
xGrav ( number ), yGrav ( number )

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 )
Parameters:
self ( MOAICpSpace )
Returns:
idleThreshold ( number )

Returns the number of iterations the space is configured to perform.


function getIterations ( MOAICpSpace self )
Parameters:
self ( MOAICpSpace )
Returns:
iterations ( number )

Returns the sleep time threshold.


function getSleepTimeThreshold ( MOAICpSpace self )
Parameters:
self ( MOAICpSpace )
Returns:
sleepTimeThreshold ( number )

Returns the static body associated with this space.


function getStaticBody ( MOAICpSpace self )
Parameters:
self ( MOAICpSpace )
Returns:
staticBody ( MOAICpBody )

Inserts a new prop into the world (can be used as a body, joint, etc.)


function insertProp ( MOAICpSpace self, MOAICpPrim prop )
Parameters:
self ( MOAICpSpace )
prop ( MOAICpPrim )
Returns:
nil

Updates the shape in the spatial hash.


function rehashShape ( MOAICpSpace self, MOAICpShape shape )
Parameters:
self ( MOAICpSpace )
shape ( MOAICpShape )
Returns:
nil

Updates the static shapes in the spatial hash.


function rehashStatic ( MOAICpSpace self )
Parameters:
self ( MOAICpSpace )
Returns:
nil

Removes a prop (body, joint, etc.) from the space.


function removeProp ( MOAICpSpace self, MOAICpPrim prop )
Parameters:
self ( MOAICpSpace )
prop ( MOAICpPrim )
Returns:
nil

Sets the dimensions of the active object hash.


function resizeActiveHash ( MOAICpSpace self, number dim, number count )
Parameters:
self ( MOAICpSpace )
dim ( number )
count ( number )
Returns:
nil

Sets the dimensions of the static object hash.


function resizeStaticHash ( MOAICpSpace self, number dim, number count )
Parameters:
self ( MOAICpSpace )
dim ( number )
count ( number )
Returns:
nil

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 )
Parameters:
self ( MOAICpSpace )
collisionTypeA ( number )
collisionTypeB ( number )
mask ( number )
handler ( function )
Returns:
nil

Sets the current damping in the space.


function setDamping ( MOAICpSpace self, number damping )
Parameters:
self ( MOAICpSpace )
damping ( number )
Returns:
nil

Sets the current gravity in the space.


function setGravity ( MOAICpSpace self, number xGrav, number yGrav )
Parameters:
self ( MOAICpSpace )
xGrav ( number )
yGrav ( number )
Returns:
nil

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 )
Parameters:
self ( MOAICpSpace )
threshold ( number )
Returns:
nil

Sets the number of iterations performed each simulation step.


function setIterations ( MOAICpSpace self, number iterations )
Parameters:
self ( MOAICpSpace )
iterations ( number )
Returns:
nil

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 )
Parameters:
self ( MOAICpSpace )
threshold ( number )
Returns:
nil

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 ] )
Parameters:
self ( MOAICpSpace )
x ( number )
y ( number )
layers ( number ) Optional.
group ( number ) Optional.
Returns:
shape ( MOAICpShape )

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 ] )
Parameters:
self ( MOAICpSpace )
x1 ( number )
y1 ( number )
x2 ( number )
y2 ( number )
layers ( number ) Optional.
group ( number ) Optional.
Returns:
shape ( MOAICpShape )

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 ] )
Parameters:
self ( MOAICpSpace )
x ( number )
y ( number )
layers ( number ) Optional.
group ( number ) Optional.
Returns:
shapes ( MOAICpShape )

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 ] )
Parameters:
self ( MOAICpSpace )
xMin ( number )
yMin ( number )
xMax ( number )
yMax ( number )
layers ( number ) Optional.
group ( number ) Optional.
Returns:
shapes ( MOAICpShape )

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 ] )
Parameters:
self ( MOAICpSpace )
x1 ( number )
y1 ( number )
x2 ( number )
y2 ( number )
layers ( number ) Optional.
group ( number ) Optional.
Returns:
shapes ( MOAICpShape )