addCollisionComponent abstract method
Future
addCollisionComponent(
- ThermionEntity entity, {
- void callback()?,
- bool affectsTransform = false,
Makes entity
collidable.
This allows you to call testCollisions with any other entity ("entity B") to see if entity
has collided with entity B. The callback will be invoked if so.
Alternatively, if affectsTransform
is true and this entity collides with another entity, any queued position updates to the latter entity will be ignored.
Implementation
Future addCollisionComponent(ThermionEntity entity,
{void Function(int entityId1, int entityId2)? callback,
bool affectsTransform = false});