@rpgjs/physic
Version:
A deterministic 2D top-down physics library for RPG, sandbox and MMO games
27 lines • 958 B
TypeScript
import { AABB } from '../core/math/AABB';
import { Collider, CollisionInfo, ContactPoint } from './Collider';
import { Entity } from '../physics/Entity';
import { Ray, RaycastHit } from './Ray';
/**
* Capsule collider
*
* Represents a capsule shape (pill shape) defined by a line segment and a radius.
* Useful for character controllers as it handles steps and slopes better than AABBs.
*/
export declare class CapsuleCollider implements Collider {
private entity;
constructor(entity: Entity);
getBounds(): AABB;
getEntity(): Entity;
raycast(ray: Ray): RaycastHit | null;
testCollision(other: Collider): CollisionInfo | null;
getContactPoints(other: Collider): ContactPoint[];
private getCapsuleConfig;
private getSegment;
private testCircle;
private testAABB;
private testCapsule;
private closestPointOnSegment;
private closestPointsSegmentSegment;
}
//# sourceMappingURL=CapsuleCollider.d.ts.map