Package ecs
Class CollisionHandler
java.lang.Object
ecs.Component
ecs.CollisionHandler
- All Implemented Interfaces:
Comparable<Component>
A component to handle and react to collisions using a collider.
Can be attached to an object if it should react to collisions in any way.
- Since:
- 07.12.2021
- Author:
- Juyas
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ecs.Component
Component.ComponentOrder -
Field Summary
Fields inherited from class ecs.Component
gameObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcollision(Collider environment, CollisionInformation collisionInformation) Will be called in the update loop if a collision happensCollisionInformation.collision()with the given environment collider and the defined one of this handler {@link this#getCollider()}.protected Collidervoidstart()Called once on Component initialization.voidupdate(float dt) Called once per frame for each Component
-
Constructor Details
-
CollisionHandler
-
-
Method Details
-
start
public void start()Description copied from class:ComponentCalled once on Component initialization. -
update
public void update(float dt) Description copied from class:ComponentCalled once per frame for each Component -
getCollider
-
collision
Will be called in the update loop if a collision happensCollisionInformation.collision()with the given environment collider and the defined one of this handler {@link this#getCollider()}.- Parameters:
environment- the other collider in the environmentcollisionInformation- the data about the collision
-