Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.eside.flingbox.physics.collisions
Class Collider

    java.lang.Object
      edu.eside.flingbox.physics.collisions.Collider

All Implemented Interfaces:
  PhysicBody.OnMovementListener, PositionComparator.Positionable

Direct Known Subclasses:
  ColliderPolygon

    public abstract class Collider

extends java.lang.Object
implements PhysicBody.OnMovementListener, PositionComparator.Positionable

Abstract collision manager for any object.

Constructor Summary
`Collider(PhysicBody physicBody)` Local constructor for any collider.

Method Summary
`boolean` | `canContact(Collider collider)`
`abstract Contact[]` | `checkContacts(Collider collider)` Checks if objects can collide
`PhysicBody` | `getAssociatedBody()`
`float` | `getBoundingCircle()`
`Vector2D` | `getPosition()`
`void` | `onMovement(Vector2D newPosition, float newAngle)` Called when a movement occurs

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Collider

    public Collider(PhysicBody physicBody)

  Local constructor for any collider.

  Parameters:
    `listener` - Collision listener

Method Detail

### checkContacts

    public abstract Contact[] checkContacts(Collider collider)

  Checks if objects can collide

  Parameters:
    `collider` - other objects collider.
  Returns:
    true if objects can collide

### canContact

    public boolean canContact(Collider collider)

  Returns:
    true if there are a chance of collision

### onMovement

    public void onMovement(Vector2D newPosition,
                           float newAngle)

  Called when a movement occurs

  Specified by:
    `onMovement` in interface `PhysicBody.OnMovementListener`
  Parameters:
    `newPosition` - new body's position

### getPosition

    public Vector2D getPosition()

  Specified by:
    `getPosition` in interface `PositionComparator.Positionable`

### getBoundingCircle

    public float getBoundingCircle()

  Returns:
    Bounding circle's radius

### getAssociatedBody

    public PhysicBody getAssociatedBody()

  Returns:
    associated PhysicBody

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD