import { Collider, type ColliderDescriptor } from "./Collider.js";
import { type CollisionEvent, type Contact } from "./CollisionEvents.js";
import { Constraint, type ConstraintDescriptor } from "./Constraint.js";
import { type RaycastHit, type RaycastOptions, type SphereCastHit } from "./Raycast.js";
import { RigidBody, type RigidBodyDescriptor, type RigidBodySnapshot } from "./RigidBody.js";
import { type Vec3 } from "./Shape.js";
export type PhysicsWorldDescriptor = {
    readonly backend?: PhysicsBackendPreference;
    readonly gravity?: Vec3;
    readonly fixedDelta?: number;
    readonly solverIterations?: number;
    readonly enableSleeping?: boolean;
    readonly sleepVelocityThreshold?: number;
    readonly sleepDelay?: number;
};
export type PhysicsBackend = "cannon-es" | "aura-js";
export type PhysicsBackendPreference = PhysicsBackend | "auto";
export type PhysicsBackendSelection = {
    readonly requested: PhysicsBackendPreference;
    readonly active: PhysicsBackend;
    readonly fallback?: string;
    readonly deterministic: boolean;
    readonly jsFallbackAvailable: boolean;
};
export type PhysicsStepStats = {
    readonly steps: number;
    readonly bodies: number;
    readonly colliders: number;
    readonly constraints: number;
    readonly broadphasePairs: number;
    readonly broadphaseFiniteColliders: number;
    readonly broadphaseInfiniteColliders: number;
    readonly broadphaseCandidateTests: number;
    readonly broadphaseActiveMax: number;
    readonly broadphaseRejectedByBounds: number;
    readonly contacts: number;
    readonly events: number;
    readonly sleepingBodies: number;
    readonly kineticEnergy: number;
    readonly maxContactPenetration: number;
};
export type PhysicsSnapshot = {
    readonly backend: PhysicsBackendSelection;
    readonly bodies: readonly RigidBodySnapshot[];
    readonly contacts: readonly Contact[];
    readonly stats: PhysicsStepStats;
};
export declare class PhysicsWorld {
    readonly gravity: [number, number, number];
    readonly fixedDelta: number;
    private readonly solverIterations;
    private readonly enableSleeping;
    private readonly sleepVelocityThreshold;
    private readonly sleepDelay;
    private readonly bodiesById;
    private readonly collidersById;
    private readonly constraintsList;
    private readonly bodyColliders;
    private readonly eventQueue;
    private readonly requestedBackend;
    private backendSelection;
    private cannonWorld;
    private readonly cannonBodiesByAuraId;
    private nextBodyId;
    private nextColliderId;
    private lastEvents;
    private lastBroadphasePairs;
    private lastBroadphaseProfile;
    private steps;
    constructor(descriptor?: PhysicsWorldDescriptor);
    createRigidBody(descriptor?: RigidBodyDescriptor): RigidBody;
    createCollider(body: RigidBody | number, descriptor: ColliderDescriptor): Collider;
    createConstraint(descriptor: ConstraintDescriptor): Constraint;
    getBody(id: number): RigidBody | undefined;
    getCollider(id: number): Collider | undefined;
    bodies(): readonly RigidBody[];
    colliders(): readonly Collider[];
    private bodyValues;
    private colliderValues;
    constraints(): readonly Constraint[];
    removeRigidBody(id: number): void;
    removeCollider(id: number): void;
    step(dt?: number): readonly CollisionEvent[];
    drainEvents(): readonly CollisionEvent[];
    raycast(origin: Vec3, direction: Vec3, options?: RaycastOptions): RaycastHit | undefined;
    raycastAll(origin: Vec3, direction: Vec3, options?: RaycastOptions): readonly RaycastHit[];
    sphereCast(origin: Vec3, radius: number, direction: Vec3, options?: RaycastOptions): SphereCastHit | undefined;
    sphereCastAll(origin: Vec3, radius: number, direction: Vec3, options?: RaycastOptions): readonly SphereCastHit[];
    snapshot(): PhysicsSnapshot;
    private detectContacts;
    private collectPotentialPairs;
    private resolveContact;
    private effectiveMaterial;
    private applyImpulsePair;
    private updateSleeping;
    private createCannonBody;
    private addCannonCollider;
    private disableCannonBackend;
    private stepCannon;
}
//# sourceMappingURL=PhysicsWorld.d.ts.map