Packageorg.MARS.dynamics.collision.fine.sat
Classpublic class PolygonAxisProjection
InheritancePolygonAxisProjection Inheritance AxisProjection

Projects a polygon onto a given axis

This type is intimately tied to SAT collision detection. By projecting a polygon onto an axis, we turn our collision detection, per axis, into a one-dimensional query.

See also

PolygonPolygonDetector
IBody
CircleAxisProjection


Public Properties
 PropertyDefined by
 Inheritedmax : Number
maximum point of projection along axis
AxisProjection
 Inheritedmin : Number
minimum point of projection along axis
AxisProjection
Public Methods
 MethodDefined by
  
Creates a new AxisProjection
PolygonAxisProjection
 Inherited
getDistance(projection:AxisProjection):Number
Gets a signed distance- negative indicates range overlap, zero indicates coincidence and positive indicates a separation
AxisProjection
Protected Methods
 MethodDefined by
  
project(body:Shape, axis:Vector):void
Projects the body onto the axis
PolygonAxisProjection
Constructor detail
PolygonAxisProjection()constructor
public function PolygonAxisProjection(body:Polygon, axis:Vector)

Creates a new AxisProjection

Parameters
body:Polygon — IBody to project onto axis
 
axis:Vector — axis to project onto

See also

Method detail
project()method
protected function project(body:Shape, axis:Vector):void

Projects the body onto the axis

Parameters
body:Shape — IBody to project
 
axis:Vector — Vector to project onto