Package | org.rapidphysics.islands |
Class | public class Island |
Inheritance | Island ![]() |
Subclasses | PointCircleIsland, PointLineIsland |
Property | Defined By | ||
---|---|---|---|
collisionsResolvedThisFrame : Number [read-only] | Island |
Property | Defined By | ||
---|---|---|---|
collectCollisionsCount : Number | Island | ||
collectCollisionsMax : Number = 15
A mechanism to prevent infinite loops. | Island | ||
collisions : RapidHeap
A collection of collisions sorted by time (very fast)
| Island | ||
doubleDict : Dictionary
Double dictionary of resolved collision times
maps [obj1][obj2] => [time of latest collision resolution]
| Island | ||
m_collisionsResolvedThisFrame : Number
How many collisions resolved this frame. | Island |
Method | Defined By | ||
---|---|---|---|
Island() | Island | ||
solve():void
Solves all of the collisions in the island. | Island |
Method | Defined By | ||
---|---|---|---|
addCollision(c:Collision):void
Call this function in your implementation of collectCollisions()
| Island | ||
collectCollisions(frameTime:Number):void
Override this method with your collision detection code
| Island | ||
Island | |||
solveCollisions():void
This is the core collision solving algorithm for all of RapidPhysics. | Island |
collectCollisionsCount | property |
protected var collectCollisionsCount:Number
collectCollisionsMax | property |
protected var collectCollisionsMax:Number = 15
A mechanism to prevent infinite loops. Don't try to solve collisions more than this number of times per frame
collisions | property |
protected var collisions:RapidHeap
A collection of collisions sorted by time (very fast)
collisionsResolvedThisFrame | property |
collisionsResolvedThisFrame:Number
[read-only] public function get collisionsResolvedThisFrame():Number
doubleDict | property |
protected var doubleDict:Dictionary
Double dictionary of resolved collision times maps [obj1][obj2] => [time of latest collision resolution]
m_collisionsResolvedThisFrame | property |
protected var m_collisionsResolvedThisFrame:Number
How many collisions resolved this frame. Useful for debugging!
Island | () | Constructor |
public function Island()
addCollision | () | method |
protected function addCollision(c:Collision):void
Call this function in your implementation of collectCollisions()
Parameters
c:Collision |
collectCollisions | () | method |
protected function collectCollisions(frameTime:Number):void
Override this method with your collision detection code
Parameters
frameTime:Number |
recycleCollision | () | method |
solve | () | method |
public function solve():void
Solves all of the collisions in the island. Called by an IslandManager each frame.
solveCollisions | () | method |
protected function solveCollisions():void
This is the core collision solving algorithm for all of RapidPhysics. Don't override this unless you know what you're doing! While there are collisions to resolve, resolve them. This algorithm solves collisions perfectly, but is somewhat slow. Try to avoid large numbers of objects that frequently collide with each other.