Interface Collision

Represents a collision between two entities in the game world. It contains information about the colliding entities, their collider components, and resolution data for handling the collision response.

// Example collision between player and enemy
const collision: Collision = {
localEntity: playerEntity,
localCollider: playerCollider,
remoteEntity: enemyEntity,
remoteCollider: enemyCollider,
resolution: {
normal: new Vector2(1, 0),
depth: 5
}
};
interface Collision {
    localCollider: Collider;
    localEntity: number;
    remoteCollider: Collider;
    remoteEntity: number;
    resolution: CollisionResolution;
}

Properties

localCollider: Collider

The local collider component

localEntity: number

The local entity

remoteCollider: Collider

The remote collider component

remoteEntity: number

The remote collider

Contains the information about the collision