import "@babylonjs/core/Physics/v2/physicsEngineComponent";
import { Matrix } from "@babylonjs/core/Maths/math.vector";
import type { Mesh } from "@babylonjs/core/Meshes/mesh";
import { TransformNode } from "@babylonjs/core/Meshes/transformNode";
import { PhysicsBody } from "@babylonjs/core/Physics/v2/physicsBody";
import type { PhysicsConstraint } from "@babylonjs/core/Physics/v2/physicsConstraint";
import type { Scene } from "@babylonjs/core/scene";
import type { Nullable } from "@babylonjs/core/types";
import { PmxObject } from "../../Loader/Parser/pmxObject";
import type { ILogger } from "../ILogger";
import type { IMmdRuntimeBone } from "../IMmdRuntimeBone";
import type { IMmdPhysics, IMmdPhysicsModel } from "./IMmdPhysics";
declare class MmdPhysicsTransformNode extends TransformNode {
    readonly linkedBone: IMmdRuntimeBone;
    physicsMode: PmxObject.RigidBody.PhysicsMode;
    readonly bodyOffsetMatrix: Matrix;
    readonly bodyOffsetInverseMatrix: Matrix;
    constructor(name: string, scene: Scene, linkedBone: IMmdRuntimeBone, physicsMode: PmxObject.RigidBody.PhysicsMode, isPure?: boolean);
    private static readonly _ParentWorldMatrixInverse;
    private static readonly _WorldMatrix;
    computeBodyOffsetMatrix(): void;
}
/**
 * MMD physics model is container of the physics resources of the MMD model
 */
export declare class MmdPhysicsModel implements IMmdPhysicsModel {
    private readonly _mmdPhysics;
    private readonly _nodes;
    private readonly _bodies;
    private readonly _constraints;
    /**
     * Create a new MMD physics model
     * @param mmdPhysics MMD physics
     * @param nodes MMD physics transform nodes
     * @param bodies Physics bodies
     * @param constraints Physics constraints
     */
    constructor(mmdPhysics: MmdPhysics, nodes: readonly Nullable<MmdPhysicsTransformNode>[], bodies: readonly Nullable<PhysicsBody>[], constraints: readonly Nullable<PhysicsConstraint>[]);
    /**
     * Dispose the physics resources
     */
    dispose(): void;
    private static readonly _NodeWorldMatrix;
    private static readonly _ZeroVector;
    /**
     * Reset the rigid body positions and velocities
     */
    initialize(): void;
    private static readonly _NodeWorldPosition;
    private static readonly _NodeWorldRotation;
    /**
     * Set the rigid bodies transform to the bones transform
     */
    syncBodies(): void;
    private static readonly _BoneWorldPosition;
    /**
     * Set the bones transform to the rigid bodies transform
     */
    syncBones(): void;
}
/**
 * Use the v2 physics engine to build the physics model of the MMD model
 *
 * If you do not want to use a physics engine, you can reduce the bundling size by not import this class
 */
export declare class MmdPhysics implements IMmdPhysics {
    /**
     * Set a threshold in radian to clamp the constraint's angular limit to 0 (default: 5 * Math.PI / 180)
     *
     * If your model's constraints have an odd bend, try increasing the value appropriately.
     *
     * A value of 5 * Math.PI / 180  to 30 * Math.PI / 180 is expected to work well.
     */
    angularLimitClampThreshold: number;
    private readonly _scene;
    private readonly _enablePreStepOnces;
    /**
     * Create a new MMD physics
     *
     * Scene must have a physics engine enabled
     * @param scene The scene to build the physics model
     */
    constructor(scene: Scene);
    private _convertParameter;
    private _clampAngularLimit;
    /**
     * Build the physics model of the MMD model
     * @param rootMesh Root mesh of the MMD model
     * @param bones MMD runtime bones
     * @param rigidBodies rigid bodies information
     * @param joints joints information
     * @param logger Logger
     * @returns MMD physics model
     * @throws If the havok physics engine is not enabled
     */
    buildPhysics(rootMesh: Mesh, bones: readonly IMmdRuntimeBone[], rigidBodies: PmxObject["rigidBodies"], joints: PmxObject["joints"], logger: ILogger): MmdPhysicsModel;
    private readonly _onAfterPhysics;
    /** @internal */
    _enablePreStepOnce(body: PhysicsBody): void;
}
export {};
