@rpgjs/physic
Version:
A deterministic 2D top-down physics library for RPG, sandbox and MMO games
31 lines • 1.02 kB
TypeScript
import { Entity } from '../physics/Entity';
import { Collider, CollisionInfo } from './Collider';
/**
* Collision detector
*
* Handles collision detection between entities using their colliders.
* Supports efficient broad-phase and narrow-phase detection.
*/
/**
* Creates a collider for an entity based on its shape
*
* @param entity - Entity to create collider for
* @returns Appropriate collider instance
*/
export declare function createCollider(entity: Entity): Collider | null;
/**
* Tests collision between two entities
*
* @param entityA - First entity
* @param entityB - Second entity
* @returns Collision info if collision detected, null otherwise
*/
export declare function testCollision(entityA: Entity, entityB: Entity): CollisionInfo | null;
/**
* Finds all collisions between entities
*
* @param entities - Array of entities to test
* @returns Array of collision infos
*/
export declare function findCollisions(entities: Entity[]): CollisionInfo[];
//# sourceMappingURL=detector.d.ts.map