Packageorg.generalrelativity.foam.dynamics.collision.geom
Classpublic class AABR



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined by
  
bound(body:IBody):void
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
Property detail
maxXproperty
public var maxX:Number

maximum point on body along world x-axis

maxYproperty 
public var maxY:Number

maximum point on body along world y-axis

minXproperty 
public var minX:Number

minimum point on body along world x-axis

minYproperty 
public var minY:Number

minimum point on body along world y-axis

Method detail
bound()method
public function bound(body:IBody):void

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. 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.

Parameters
body:IBody — IBody to bound

See also

AABRDetector
updateBounds
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.

Parameters
rect:AABR — AABR to check for collision against instance

Returns
Boolean — true if the AABRs are coincident, false otherwise