import { Object3D, Quaternion, Vector3 } from "three";
import { MutableRefObject } from "react";
export declare type UUID = string;
export declare type WorkerRequestId = number;
export declare type SerializedVector3 = Vector3 | {
    x: number;
    y: number;
    z: number;
};
export interface WorldConfig {
    epsilon?: number;
    debugDrawMode?: number;
    maxSubSteps?: number;
    fixedTimeStep?: number;
    gravity?: Vector3;
    solverIterations?: number;
}
export declare enum BodyActivationState {
    ACTIVE_TAG = 1,
    ISLAND_SLEEPING = 2,
    WANTS_DEACTIVATION = 3,
    DISABLE_DEACTIVATION = 4,
    DISABLE_SIMULATION = 5
}
export declare enum BodyType {
    STATIC = "static",
    DYNAMIC = "dynamic",
    KINEMATIC = "kinematic"
}
export interface BodyConfig {
    loadedEvent?: string;
    mass?: number;
    gravity?: Vector3;
    enableCCD?: boolean;
    ccdMotionThreshold?: number;
    ccdSweptSphereRadius?: number;
    linearDamping?: number;
    angularDamping?: number;
    linearSleepingThreshold?: number;
    angularSleepingThreshold?: number;
    angularFactor?: Vector3;
    activationState?: BodyActivationState;
    type?: BodyType;
    emitCollisionEvents?: boolean;
    disableCollision?: boolean;
    collisionFilterGroup?: number;
    collisionFilterMask?: number;
    scaleAutoUpdate?: boolean;
}
export declare enum SoftBodyFCollisionFlag {
    RVSmask = 15,
    SDF_RS = 1,
    CL_RS = 2,
    SVSmask = 48,
    VF_SS = 16,
    CL_SS = 32,
    CL_SELF = 64,
    Default = 1
}
export interface SoftBodyConfig {
    type?: SoftBodyType;
    mass?: number;
    margin?: number;
    clusters?: number;
    viterations?: number;
    piterations?: number;
    friction?: number;
    damping?: number;
    pressure?: number;
    linearStiffness?: number;
    angularStiffness?: number;
    volumeStiffness?: number;
    randomizeConstraints?: boolean;
    activationState?: BodyActivationState;
    collisionFilterGroup?: number;
    collisionFilterMask?: number;
    collisionFlag?: number;
    anchors?: SoftBodyAnchor[];
}
export interface SoftBodyWorldAnchor {
    nodeIndex: number;
    worldPosition: Vector3;
}
export interface SoftBodyRigidBodyAnchor {
    nodeIndex: number;
    rigidBodyUUID: UUID;
    localOffset?: Vector3;
    disableCollisionBetweenLinkedBodies?: boolean;
    influence?: number;
}
export declare type SoftBodyRigidBodyAnchorRef = Omit<SoftBodyRigidBodyAnchor, "rigidBodyUUID"> & {
    rigidBodyRef: MutableRefObject<Object3D | undefined>;
};
export declare type SoftBodyAnchor = SoftBodyWorldAnchor | SoftBodyRigidBodyAnchor;
export declare type SoftBodyAnchorRef = SoftBodyWorldAnchor | SoftBodyRigidBodyAnchorRef;
export declare enum SoftBodyType {
    TRIMESH = "trimesh",
    ROPE = "rope"
}
export declare type UpdateBodyOptions = Pick<BodyConfig, "type" | "disableCollision" | "activationState" | "collisionFilterGroup" | "collisionFilterMask" | "linearDamping" | "angularDamping" | "gravity" | "linearSleepingThreshold" | "angularSleepingThreshold" | "angularFactor">;
export declare enum ShapeType {
    BOX = "box",
    CYLINDER = "cylinder",
    SPHERE = "sphere",
    CAPSULE = "capsule",
    CONE = "cone",
    HULL = "hull",
    HACD = "hacd",
    VHACD = "vhacd",
    MESH = "mesh",
    HEIGHTFIELD = "heightfield"
}
export declare enum ShapeFit {
    ALL = "all",
    MANUAL = "manual"
}
export interface ShapeConfig {
    type: ShapeType;
    margin?: number;
    includeInvisible?: boolean;
    offset?: Vector3;
    orientation?: Quaternion;
    fit?: ShapeFit;
    halfExtents?: Vector3;
    minHalfExtents?: number;
    maxHalfExtents?: number;
    cylinderAxis?: "x" | "y" | "z";
    sphereRadius?: number;
    hullMaxVertices?: number;
    compacityWeight?: number;
    volumeWeight?: number;
    nClusters?: number;
    nVerticesPerCH?: number;
    resolution?: any;
    depth?: any;
    planeDownsampling?: any;
    convexhullDownsampling?: any;
    alpha?: any;
    beta?: any;
    gamma?: any;
    pca?: any;
    mode?: any;
    maxNumVerticesPerCH?: any;
    minVolumePerCH?: any;
    convexhullApproximation?: any;
    oclAcceleration?: any;
    concavity?: number;
    heightfieldDistance?: number;
    heightfieldData?: any[];
    heightScale?: number;
    upAxis?: number;
    heightDataType?: "short" | "float";
    flipQuadEdges?: boolean;
}
export declare enum ConstraintType {
    CONE_TWIST = "coneTwist",
    GENERIC_6_DOF = "generic6DOF",
    GENERIC_6_DOF_SPRING = "generic6DOFSpring",
    FIXED = "fixed",
    HINGE = "hinge",
    POINT_TO_POINT = "pointToPoint",
    SLIDER = "slider"
}
interface ConeTwistConstraintDynamicConfig {
    type: ConstraintType.CONE_TWIST;
    angularOnly?: boolean;
    swingSpan1?: number;
    swingSpan2?: number;
    twistSpan?: number;
    damping?: number;
    motorEnabled?: boolean;
    maxMotorImpulse?: number;
    motorTarget?: Quaternion;
    fixThresh?: number;
}
interface Generic6DOFDynamicConfig {
    type: ConstraintType.GENERIC_6_DOF;
    linearLowerLimit?: Vector3;
    linearUpperLimit?: Vector3;
    angularLowerLimit?: Vector3;
    angularUpperLimit?: Vector3;
}
interface Generic6DOFSpringDynamicConfig {
    type: ConstraintType.GENERIC_6_DOF_SPRING;
    springEnabled?: [boolean, boolean, boolean, boolean, boolean, boolean];
    equilibriumPoint?: [number, number, number, number, number, number];
    stiffness?: [number, number, number, number, number, number];
    damping?: [number, number, number, number, number, number];
}
interface HingeDynamicConfig {
    type: ConstraintType.HINGE;
    angularOnly?: boolean;
    enableAngularMotor?: boolean;
    motorTargetVelocity?: number;
    maxMotorImpulse?: number;
    lowerLimit?: number;
    upperLimit?: number;
}
interface FixedDynamicConfig {
    type: ConstraintType.FIXED;
}
interface PointToPointDynamicConfig {
    type: ConstraintType.POINT_TO_POINT;
}
interface SliderDynamicConfig {
    type: ConstraintType.SLIDER;
    linearLowerLimit?: number;
    linearUpperLimit?: number;
    angularLowerLimit?: number;
    angularUpperLimit?: number;
    softnessDirLin?: number;
    restitutionDirLin?: number;
    dampingDirLin?: number;
    softnessDirAng?: number;
    restitutionDirAng?: number;
    dampingDirAng?: number;
    softnessLimLin?: number;
    restitutionLimLin?: number;
    dampingLimLin?: number;
    softnessLimAng?: number;
    restitutionLimAng?: number;
    dampingLimAng?: number;
    softnessOrthoLin?: number;
    restitutionOrthoLin?: number;
    dampingOrthoLin?: number;
    softnessOrthoAng?: number;
    restitutionOrthoAng?: number;
    dampingOrthoAng?: number;
    poweredLinearMotor?: boolean;
    targetLinMotorVelocity?: number;
    maxLinMotorForce?: number;
    poweredAngularMotor?: boolean;
    targetAngMotorVelocity?: number;
    maxAngMotorForce?: number;
}
export declare type DynamicConstraintConfig = ConeTwistConstraintDynamicConfig | Generic6DOFDynamicConfig | FixedDynamicConfig | Generic6DOFSpringDynamicConfig | HingeDynamicConfig | PointToPointDynamicConfig | SliderDynamicConfig;
export interface Transform {
    position: Vector3;
    rotation: Quaternion;
}
export declare type TwoBodyConstraintConfig = ({
    type: ConstraintType.CONE_TWIST;
    frameInA: Transform;
    frameInB: Transform;
} & ConeTwistConstraintDynamicConfig) | ({
    type: ConstraintType.GENERIC_6_DOF;
    frameInA: Transform;
    frameInB: Transform;
    useLinearReferenceFrameA: boolean;
} & Generic6DOFDynamicConfig) | ({
    type: ConstraintType.FIXED;
    frameInA: Transform;
    frameInB: Transform;
} & FixedDynamicConfig) | ({
    type: ConstraintType.GENERIC_6_DOF_SPRING;
    frameInA: Transform;
    frameInB: Transform;
    useLinearReferenceFrameA: boolean;
} & Generic6DOFSpringDynamicConfig) | ({
    type: ConstraintType.HINGE;
    pivot: Vector3;
    axis: Vector3;
    targetPivot: Vector3;
    targetAxis: Vector3;
    useReferenceFrameA: boolean;
} & HingeDynamicConfig) | ({
    type: ConstraintType.POINT_TO_POINT;
    pivot: Vector3;
    targetPivot: Vector3;
} & PointToPointDynamicConfig) | ({
    type: ConstraintType.SLIDER;
    frameInA: Transform;
    frameInB: Transform;
    useLinearReferenceFrameA: boolean;
} & SliderDynamicConfig);
export declare type SingleBodyConstraintConfig = ({
    type: ConstraintType.CONE_TWIST;
    frameInA: Transform;
} & ConeTwistConstraintDynamicConfig) | ({
    type: ConstraintType.GENERIC_6_DOF;
    frameInB: Transform;
    useLinearReferenceFrameA: boolean;
} & Generic6DOFDynamicConfig) | ({
    type: ConstraintType.GENERIC_6_DOF_SPRING;
    frameInB: Transform;
    useLinearReferenceFrameB: boolean;
} & Generic6DOFSpringDynamicConfig) | ({
    type: ConstraintType.HINGE;
    frameInA: Transform;
    useReferenceFrameA: boolean;
} & HingeDynamicConfig) | ({
    type: ConstraintType.POINT_TO_POINT;
    pivot: Vector3;
} & PointToPointDynamicConfig) | ({
    type: ConstraintType.SLIDER;
    frameInB: Transform;
    useLinearReferenceFrameA: boolean;
} & SliderDynamicConfig);
export interface CommonConstraintConfig {
    disableCollisionsBetweenLinkedBodies?: boolean;
}
export declare type ConstraintConfig = CommonConstraintConfig & (SingleBodyConstraintConfig | TwoBodyConstraintConfig);
export declare enum BufferState {
    UNINITIALIZED = 0,
    READY = 1,
    CONSUMED = 2
}
export declare enum MessageType {
    INIT = 0,
    TRANSFER_BUFFERS = 1,
    SET_SIMULATION_SPEED = 2,
    ADD_RIGIDBODY = 3,
    UPDATE_RIGIDBODY = 4,
    REMOVE_RIGIDBODY = 5,
    ADD_SHAPES = 6,
    REMOVE_SHAPES = 7,
    ADD_SOFTBODY = 8,
    REMOVE_SOFTBODY = 9,
    ADD_CONSTRAINT = 10,
    UPDATE_CONSTRAINT = 11,
    REMOVE_CONSTRAINT = 12,
    ENABLE_DEBUG = 13,
    RESET_DYNAMIC_BODY = 14,
    ACTIVATE_BODY = 15,
    SET_SHAPES_OFFSET = 16,
    SET_MOTION_STATE = 17,
    SET_LINEAR_VELOCITY = 18,
    SET_ANGULAR_VELOCITY = 19,
    APPLY_FORCE = 20,
    APPLY_CENTRAL_FORCE = 21,
    APPLY_IMPULSE = 22,
    APPLY_CENTRAL_IMPULSE = 23,
    APPLY_TORQUE_IMPULSE = 24,
    CLEAR_FORCES = 25,
    SET_RESTITUTION = 26,
    SET_FRICTION = 27,
    SET_SPINNING_FRICTION = 28,
    SET_ROLLING_FRICTION = 29,
    RAYCAST_REQUEST = 30
}
export declare enum ClientMessageType {
    READY = 0,
    RIGIDBODY_READY = 1,
    SOFTBODY_READY = 2,
    TRANSFER_BUFFERS = 3,
    RAYCAST_RESPONSE = 4
}
export declare enum CollisionFlag {
    STATIC_OBJECT = 1,
    KINEMATIC_OBJECT = 2,
    NO_CONTACT_RESPONSE = 4,
    CUSTOM_MATERIAL_CALLBACK = 8,
    CHARACTER_OBJECT = 16,
    DISABLE_VISUALIZE_OBJECT = 32,
    DISABLE_SPU_COLLISION_PROCESSING = 64
}
export interface SharedSoftBodyBuffers {
    uuid: UUID;
    indexIntArray: Uint32Array | Uint16Array;
    vertexFloatArray: Float32Array;
    normalFloatArray: Float32Array;
}
export interface SharedBuffers {
    rigidBodies: {
        headerIntArray: Int32Array;
        headerFloatArray: Float32Array;
        objectMatricesFloatArray: Float32Array;
        objectMatricesIntArray: Int32Array;
    };
    softBodies: SharedSoftBodyBuffers[];
    debug: {
        indexIntArray: Uint32Array;
        vertexFloatArray: Float32Array;
        colorFloatArray: Float32Array;
    };
}
export interface AsyncRequestOptions {
    requestId: WorkerRequestId;
}
export declare enum RaycastFlag {
    filterBackfaces = 1,
    keepUnflippedNormal = 2,
    useSubSimplexConvexCastRaytest = 4,
    useGjkConvexCastRaytest = 8,
    disableHeightfieldAccelerator = 16,
    terminator = 4294967295
}
export interface RaycastOptions {
    from: Vector3;
    to: Vector3;
    multiple?: boolean;
    collisionFilterGroup?: number;
    collisionFilterMask?: number;
}
export interface RaycastHitMessage {
    uuid: string;
    hitPosition: SerializedVector3;
    normal: SerializedVector3;
}
export interface RaycastHit {
    object?: Object3D;
    hitPosition: Vector3;
    normal: Vector3;
}
export {};
