| Package | org.generalrelativity.foam.dynamics.collision.fine.sat |
| Class | public class CirclePolygonDetector |
| Implements | IFineCollisionDetector |
| Property | Defined by | ||
|---|---|---|---|
| body : IBody
IBody to detect
| CirclePolygonDetector | ||
| circle : Circle
Circle to detect
| CirclePolygonDetector | ||
| minDistance : Number minimum distance along the pentration axis required to resolve penetration
| CirclePolygonDetector | ||
| penetrationAxis : Vector
most direct vector out of penetration
| CirclePolygonDetector | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new CirclePolygonDetector
| CirclePolygonDetector | ||
|
getContacts():Array
Gets point of contact in world-coordinates
In the case of Circle vs. | CirclePolygonDetector | ||
|
hasCollision():Boolean
Determines whether the
#circle and #body are intersecting. | CirclePolygonDetector | ||
| body | property |
public var body:IBodyIBody to detect
| circle | property |
public var circle:CircleCircle to detect
| minDistance | property |
public var minDistance:Numberminimum distance along the pentration axis required to resolve penetration
| penetrationAxis | property |
public var penetrationAxis:Vectormost direct vector out of penetration
| CirclePolygonDetector | () | constructor |
public function CirclePolygonDetector(circle:Circle, body:IBody)Creates a new CirclePolygonDetector
Parameterscircle:Circle — Circle to check for collision
|
|
body:IBody — body to check for collision against
|
| getContacts | () | method |
public function getContacts():ArrayGets point of contact in world-coordinates
In the case of Circle vs. anything, there will be at most 1 point of contact. That point of contact will always be on the circle's edge and can be found by moving out from the circle's position in the direction of the penetration axis by the length of the radius.
ReturnsArray — Array with single Contact
|
See also
| hasCollision | () | method |
public function hasCollision():Boolean
Determines whether the #circle and #body are intersecting.
We check each axis as a contender for separation between the bodies. It's usually quite more likely in an application that objects AREN'T intersecting. For that reason, this algorithm is constructed such that it terminates as soon as possible given non-intersection. It's good to think of collision as absolute worst case scenario- its detection and resolution are the most processor intensive aspects of FOAM.
With the case of a circle, we check each of the polygon's offered axes and then the axis that's created between the closest vertex on the polygon and the Circle.
ReturnsBoolean — true given penetration, false otherwise
|
See also