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(Entity a,
Entity b)
Called if entities A and B are currently colliding.
|
protected void |
onCollisionBegin(Entity a,
Entity b)
Called when entities A and B have just collided and weren't colliding in the last tick.
|
protected void |
onCollisionEnd(Entity a,
Entity b)
Called when entities A and B have just stopped colliding and were colliding in the last tick.
|
protected void |
onHitBoxTrigger(Entity a,
Entity b,
HitBox boxA,
HitBox boxB)
Called once per collision during the same tick when collision occurred.
|
protected void onHitBoxTrigger(Entity a, Entity b, HitBox boxA, HitBox boxB)
a
- first entityb
- second entityboxA
- hit box of first entityboxB
- hit box of second entityprotected void onCollisionBegin(Entity a, Entity b)
a
- first entityb
- second entityprotected void onCollision(Entity a, Entity b)
a
- first entityb
- second entityprotected void onCollisionEnd(Entity a, 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 © 2018. All rights reserved.