import { Vector3 } from "@babylonjs/core/Maths/math.vector.js"; import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js"; import { PhysicsBody } from "@babylonjs/core/Physics/v2/physicsBody.js"; import { type IRaycastQuery } from "@babylonjs/core/Physics/physicsRaycastResult.js"; import "@babylonjs/core/Physics/joinedPhysicsEngineComponent.js"; import type { Scene } from "@babylonjs/core/scene.js"; import { type PhysicsWorldConfig, type PhysicsBodyConfig, type PhysicsCharacterConfig, type TransformUpdate, type Vector3Value, type QuaternionValue, type JsonValue } from "@skenora/contracts"; import type { RuntimeLoop } from "./runtime-loop.js"; import type { RuntimeServiceInstance } from "./runtime-service-registry.js"; export interface PhysicsTransformLease { readonly active: boolean; setTransform(transform: TransformUpdate): void; release(): void; } export interface PhysicsCollision { readonly type: string; readonly bodyId: string; readonly targetEntityId: string; readonly otherBodyId: string; readonly otherEntityId: string; readonly point?: Vector3Value; readonly normal?: Vector3Value; readonly impulse?: number; } export interface PhysicsWorldOptions { readonly havok: unknown; readonly maxBodies?: number; readonly maxCharacters?: number; readonly maxEventsPerStep?: number; } /** Owns exactly one native world, driven exclusively by the existing Runtime fixed phase. */ export declare class HavokPhysicsWorld implements RuntimeServiceInstance { #private; readonly gravity: Vector3; constructor(scene: Scene, loop: RuntimeLoop, config: PhysicsWorldConfig, options: PhysicsWorldOptions); start(): void; stop(): void; reset(): void; addBody(id: string, targetEntityId: string, target: TransformNode, config: PhysicsBodyConfig, acquire: () => PhysicsTransformLease): PhysicsBodyService; addCharacter(id: string, targetEntityId: string, target: TransformNode, config: PhysicsCharacterConfig, acquire: () => PhysicsTransformLease): PhysicsCharacterService; /** Internal adapter ownership, not an AI-visible handle. */ get scene(): Scene; releaseBody(id: string, body: PhysicsBody): void; releaseCharacter(id: string): void; teleportBody(body: PhysicsBody, node: TransformNode): void; raycast(from: Vector3Value, to: Vector3Value, query?: Omit): { hit: true; bodyId: string | null; entityId: string | null; point: Vector3Value; normal: Vector3Value; distance: number; } | { hit: false; bodyId?: never; entityId?: never; point?: never; normal?: never; distance?: never; }; subscribe(listener: (event: PhysicsCollision) => void): () => void; invoke(operation: string, input: JsonValue): JsonValue; getState(): JsonValue; dispose(): void; } export declare class PhysicsBodyService implements RuntimeServiceInstance { #private; readonly world: HavokPhysicsWorld; readonly id: string; readonly targetEntityId: string; readonly nativeBody: PhysicsBody; constructor(world: HavokPhysicsWorld, id: string, targetEntityId: string, target: TransformNode, config: PhysicsBodyConfig, acquire: () => PhysicsTransformLease); start(): void; stop(): void; reset(): void; assertWriter(): void; beforeStep(): void; setVelocity(v: Vector3Value): void; setAngularVelocity(v: Vector3Value): void; applyImpulse(v: Vector3Value, point?: Vector3Value): void; applyForce(v: Vector3Value, point?: Vector3Value): void; teleport(position: Vector3Value, orientation?: QuaternionValue): void; setTarget(position: Vector3Value, orientation?: QuaternionValue): void; getState(): JsonValue; invoke(operation: string, input: JsonValue): JsonValue; dispose(): void; } export declare class PhysicsCharacterService implements RuntimeServiceInstance { #private; readonly world: HavokPhysicsWorld; readonly id: string; readonly targetEntityId: string; constructor(world: HavokPhysicsWorld, id: string, targetEntityId: string, target: TransformNode, config: PhysicsCharacterConfig, acquire: () => PhysicsTransformLease); start(): void; stop(): void; reset(): void; setVelocity(v: Vector3Value): void; teleport(position: Vector3Value): void; advance(dt: number): void; getState(): JsonValue; invoke(operation: string, input: JsonValue): JsonValue; dispose(): void; } //# sourceMappingURL=physics-world.d.ts.map