| Property | Defined by | ||
|---|---|---|---|
| maxX : Number maximum point on body along world x-axis
| AABR | ||
| maxY : Number maximum point on body along world y-axis
| AABR | ||
| minX : Number minimum point on body along world x-axis
| AABR | ||
| minY : Number minimum point on body along world y-axis
| AABR | ||
| Method | Defined by | ||
|---|---|---|---|
|
Positions this AABR to bound the given body as tightly as possible
TODO: This is obviously pretty sloppy and needs to be thought out- it's important that optimizations are decoupled as much as possible from the nuts & bolts of what is needed to simulate. | AABR | ||
|
hasCollision(rect:AABR):Boolean
Indicates whether instance is intersecting with
rect
This is a simple algorithm. | AABR | ||
| maxX | property |
public var maxX:Numbermaximum point on body along world x-axis
| maxY | property |
public var maxY:Numbermaximum point on body along world y-axis
| minX | property |
public var minX:Numberminimum point on body along world x-axis
| minY | property |
public var minY:Numberminimum point on body along world y-axis
| bound | () | method |
public function bound(body:IBody):voidPositions this AABR to bound the given body as tightly as possible
TODO: This is obviously pretty sloppy and needs to be thought out- it's important that optimizations are decoupled as much as possible from the nuts & bolts of what is needed to simulate. Otherwise it would make sense to include these methods within the RigidBody class for instance.
In all likelihood it will end up being treated much like the solution of ODEs. Rigid bodies will implement IBoundable and there will be a getBoundingVolume method. This would solve the current sloppy type check, amongst other things.
Parametersbody:IBody — IBody to bound
|
See also
| hasCollision | () | method |
public function hasCollision(rect:AABR):Boolean
Indicates whether instance is intersecting with rect
This is a simple algorithm. If the furthest reaching extent of 1 body along the x-axis is LESS than the least reaching extent of the other body in question, the AABR's do NOT overlap. This query is repeated along each axis in each direction.
Parametersrect:AABR — AABR to check for collision against instance
|
Boolean — true if the AABRs are coincident, false otherwise
|