Inherits MOAILuaObject.
Inherited by MOAICollisionWorld [virtual]
.
Constants |
MOAIPartition.PLANE_XY |
MOAIPartition.PLANE_XZ |
MOAIPartition.PLANE_YZ |
|
Remove all props from the partition.
function clear ( MOAIPartition self )
- Parameters
-
- Returns
- nil
Returns the hull with the highest priority that contains the given world space point.
function hullForPoint ( MOAIPartition self, number x, number y, number z [, number sortMode, number xScale, number yScale, number zScale, number priorityScale, number interfaceMask, number queryMask ] )
- Parameters
-
MOAIPartition | self |
number | x |
number | y |
number | z |
number | sortMode Optional. One of the MOAIPartitionViewLayer sort modes. Default value is SORT_PRIORITY_ASCENDING. |
number | xScale Optional. X scale for vector sort. Default value is 0. |
number | yScale Optional. Y scale for vector sort. Default value is 0. |
number | zScale Optional. Z scale for vector sort. Default value is 0. |
number | priorityScale Optional. Priority scale for vector sort. Default value is 1. |
number | interfaceMask Optional. |
number | queryMask Optional. |
- Returns
- MOAIPartitionHull hull
Returns the first hull that intersects the given ray.
function hullForRay ( MOAIPartition self, number x, number y, number z, number xdirection, number ydirection, number zdirection [, number interfaceMask, number queryMask ] )
- Parameters
-
MOAIPartition | self |
number | x |
number | y |
number | z |
number | xdirection |
number | ydirection |
number | zdirection |
number | interfaceMask Optional. |
number | queryMask Optional. |
- Returns
- MOAIPartitionHull hull
Returns all props.
function hullList ( MOAIPartition self [, number sortMode, number xScale, number yScale, number zScale, number priorityScale, number interfaceMask, number queryMask ] )
- Parameters
-
MOAIPartition | self |
number | sortMode Optional. One of the MOAIPartitionViewLayer sort modes. Default value is SORT_NONE. |
number | xScale Optional. X scale for vector sort. Default value is 0. |
number | yScale Optional. Y scale for vector sort. Default value is 0. |
number | zScale Optional. Z scale for vector sort. Default value is 0. |
number | priorityScale Optional. Priority scale for vector sort. Default value is 1. |
number | interfaceMask Optional. |
number | queryMask Optional. |
- Returns
- ...
Returns all props under a given world space point.
function hullListForPoint ( MOAIPartition self, number x, number y, number z [, number sortMode, number xScale, number yScale, number zScale, number priorityScale, number interfaceMask, number queryMask ] )
- Parameters
-
MOAIPartition | self |
number | x |
number | y |
number | z |
number | sortMode Optional. One of the MOAIPartitionViewLayer sort modes. Default value is SORT_NONE. |
number | xScale Optional. X scale for vector sort. Default value is 0. |
number | yScale Optional. Y scale for vector sort. Default value is 0. |
number | zScale Optional. Z scale for vector sort. Default value is 0. |
number | priorityScale Optional. Priority scale for vector sort. Default value is 1. |
number | interfaceMask Optional. |
number | queryMask Optional. |
- Returns
- ...
Returns all props that intersect the given ray.
function hullListForRay ( MOAIPartition self, number x, number y, number z, number xdirection, number ydirection, number zdirection [, number sortMode, number xScale, number yScale, number zScale, number priorityScale, number interfaceMask, number queryMask ] )
- Parameters
-
MOAIPartition | self |
number | x |
number | y |
number | z |
number | xdirection |
number | ydirection |
number | zdirection |
number | sortMode Optional. One of the MOAIPartitionViewLayer sort modes. Default value is SORT_KEY_ASCENDING. |
number | xScale Optional. X scale for vector sort. Default value is 0. |
number | yScale Optional. Y scale for vector sort. Default value is 0. |
number | zScale Optional. Z scale for vector sort. Default value is 0. |
number | priorityScale Optional. Priority scale for vector sort. Default value is 1. |
number | interfaceMask Optional. |
number | queryMask Optional. |
- Returns
- ...
Returns all props under a given world space rect.
function hullListForRect ( MOAIPartition self, number xMin, number yMin, number xMax, number yMax [, number sortMode, number xScale, number yScale, number zScale, number priorityScale, number interfaceMask, number queryMask ] )
- Parameters
-
MOAIPartition | self |
number | xMin |
number | yMin |
number | xMax |
number | yMax |
number | sortMode Optional. One of the MOAIPartitionViewLayer sort modes. Default value is SORT_NONE. |
number | xScale Optional. X scale for vector sort. Default value is 0. |
number | yScale Optional. Y scale for vector sort. Default value is 0. |
number | zScale Optional. Z scale for vector sort. Default value is 0. |
number | priorityScale Optional. Priority scale for vector sort. Default value is 1. |
number | interfaceMask Optional. |
number | queryMask Optional. |
- Returns
- ...
Inserts a hull into the partition. A hull can only be in one partition at a time.
function insertHull ( MOAIPartition self, MOAIPartitionHull hull )
- Parameters
-
- Returns
- nilRemoves a hull from the partition.
function removeHull ( MOAIPartition self, MOAIPartitionHull hull )
- Parameters
-
- Returns
- nilReserves a stack of levels in the partition. Levels must be initialized with setLevel (). This will trigger a full rebuild of the partition if it contains any props.
function reserveLevels ( MOAIPartition self, number nLevels )
- Parameters
-
- Returns
- nil
Initializes a level previously created by reserveLevels (). This will trigger a full rebuild of the partition if it contains any props. Each level is a loose grid. Props of a given size may be placed by the system into any level with cells large enough to accommodate them. The dimensions of a level control how many cells the level contains. If an object goes off of the edge of a level, it will wrap around to the other side. It is possible to model a quad tree by initializing levels correctly, but for some simulations better structures may be possible.
function setLevel ( MOAIPartition self, number levelID, number cellSize, number xCells, number yCells )
- Parameters
-
MOAIPartition | self |
number | levelID |
number | cellSize Dimensions of the level's cells. |
number | xCells Width of level in cells. |
number | yCells Height of level in cells. |
- Returns
- nil
Selects the plane the partition will use. If this is different from the current plane then all non-global props will be redistributed. Redistribution works by moving all props to the 'empties' cell and then scheduling them all for a dep node update (which refreshes the prop's bounds and may also flag it as global).
function setPlane ( MOAIPartition self, number planeID )
- Parameters
-
MOAIPartition | self |
number | planeID One of MOAIPartition::PLANE_XY, MOAIPartition::PLANE_XZ, MOAIPartition::PLANE_YZ. Default value is MOAIPartition::PLANE_XY. |
- Returns
- nil