public abstract class CollisionHandler extends Object
| Constructor and Description |
|---|
CollisionHandler(Object a,
Object b)
The order of types determines the order of entities in callbacks.
|
| Modifier and Type | Method and Description |
|---|---|
CollisionHandler |
copyFor(Object a,
Object b)
Returns a copy of the collision handler with different entity types.
|
boolean |
equal(T a,
T b)
Note: order doesn't matter.
|
boolean |
equals(Object o) |
int |
hashCode() |
protected void |
onCollision(com.almasb.ents.Entity a,
com.almasb.ents.Entity b)
Called if entities A and B are currently colliding.
|
protected void |
onCollisionBegin(com.almasb.ents.Entity a,
com.almasb.ents.Entity b)
Called when entities A and B have just collided and weren't colliding in the last tick.
|
protected void |
onCollisionEnd(com.almasb.ents.Entity a,
com.almasb.ents.Entity b)
Called when entities A and B have just stopped colliding and were colliding in the last tick.
|
protected void |
onHitBoxTrigger(com.almasb.ents.Entity a,
com.almasb.ents.Entity b,
HitBox boxA,
HitBox boxB)
Called once per collision during the same tick when collision occurred.
|
protected void onHitBoxTrigger(com.almasb.ents.Entity a,
com.almasb.ents.Entity b,
HitBox boxA,
HitBox boxB)
a - first entityb - second entityboxA - hit box of first entityboxB - hit box of second entityprotected void onCollisionBegin(com.almasb.ents.Entity a,
com.almasb.ents.Entity b)
a - first entityb - second entityprotected void onCollision(com.almasb.ents.Entity a,
com.almasb.ents.Entity b)
a - first entityb - second entityprotected void onCollisionEnd(com.almasb.ents.Entity a,
com.almasb.ents.Entity b)
a - first entityb - second entitypublic final CollisionHandler copyFor(Object a, Object b)
a - entity type Ab - entity type Bpublic boolean equal(T a,
T b)
a - pair elementb - pair elementCopyright © 2016. All rights reserved.