| Package | org.generalrelativity.foam.dynamics.collision.fine.sat |
| Class | public class CircleCircleDetector |
| Implements | IFineCollisionDetector |
| Property | Defined by | ||
|---|---|---|---|
| circle1 : Circle
circle 1 to check for collision
| CircleCircleDetector | ||
| circle2 : Circle
circle 2 to check for collision
| CircleCircleDetector | ||
| dist : Number distance between circles
| CircleCircleDetector | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new CircleCircleDetector
| CircleCircleDetector | ||
|
getContacts():Array
| CircleCircleDetector | ||
|
hasCollision():Boolean
Determines whether 2 circles are overlapping
This method simply decides whether the circles are closer than the sum of their radii. | CircleCircleDetector | ||
| circle1 | property |
public var circle1:Circlecircle 1 to check for collision
| circle2 | property |
public var circle2:Circlecircle 2 to check for collision
| dist | property |
public var dist:Numberdistance between circles
| CircleCircleDetector | () | constructor |
public function CircleCircleDetector(circle1:Circle, circle2:Circle)Creates a new CircleCircleDetector
Parameterscircle1:Circle — circle 1 to check for collisions
|
|
circle2:Circle — circle 2 to check for collisions
|
| getContacts | () | method |
public function getContacts():Array
Returns
Array |
| hasCollision | () | method |
public function hasCollision():BooleanDetermines whether 2 circles are overlapping
This method simply decides whether the circles are closer than the sum of their radii. It does so using the square of the distance to avoid an expensive square root call given the quite likely scenario that the circle's do not collide.
ReturnsBoolean — true if they intersect, false otherwise
|