import { Vector3 } from "three";
import { CollisionDetectionMode, RigidbodyConstraints } from "../engine/engine_physics.types.js";
import type { IRigidbody, Vec3 } from "../engine/engine_types.js";
import { Behaviour } from "./Component.js";
/**
 * Rigidbody component for realistic physics simulation and dynamic interactions.
 * Used together with a {@link Collider} to enable physical behavior like gravity, collisions,
 * forces, and constraints. Powered by the Rapier physics engine.
 *
 * ![](https://cloud.needle.tools/-/media/slYWnXyaxdlrCqu8GP_lFQ.gif)
 *
 * **Key features:**
 * - Dynamic, kinematic, or static body types
 * - Automatic or manual mass calculation
 * - Gravity, drag, and angular drag control
 * - Position and rotation constraints (locking axes)
 * - Force, impulse, and velocity manipulation
 * - Sleep/wake optimization for performance
 * - Continuous collision detection (CCD) support
 *
 * @example Basic dynamic rigidbody
 * ```ts
 * const rb = this.gameObject.getComponent(Rigidbody);
 * rb.useGravity = true;
 * rb.mass = 2.0;
 * rb.drag = 0.5;
 * ```
 *
 * @example Apply force to move object
 * ```ts
 * const rb = this.gameObject.getComponent(Rigidbody);
 * rb.applyForce(new Vector3(0, 10, 0)); // Upward force
 * rb.applyImpulse(new Vector3(5, 0, 0)); // Instant velocity change
 * ```
 *
 * @example Kinematic rigidbody (manually controlled)
 * ```ts
 * const rb = this.gameObject.getComponent(Rigidbody);
 * rb.isKinematic = true; // Not affected by forces
 * rb.teleport({ x: 0, y: 5, z: 0 }); // Move without physics
 * ```
 *
 * @example Lock rotation on Y axis (useful for characters)
 * ```ts
 * const rb = this.gameObject.getComponent(Rigidbody);
 * rb.lockRotationY = true;
 * // Or use constraints for multiple axes:
 * rb.constraints = RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezePositionZ;
 * ```
 *
 * @summary Enables physics simulation with forces, gravity, and collisions
 * @category Physics
 * @group Components
 * @see {@link BoxCollider} for box-shaped colliders
 * @see {@link SphereCollider} for sphere-shaped colliders
 * @see {@link CapsuleCollider} for capsule-shaped colliders
 * @see {@link MeshCollider} for mesh-based colliders
 * @see {@link Collider} for collider base class
 * @see {@link CharacterController} for character movement
 * @see {@link Joint} for connecting bodies
 * @see {@link RapierPhysics} for physics engine implementation
 * @see {@link Physics} for raycasting and physics utilities
 * @link https://engine.needle.tools/samples/physics-basic/
 * @link https://engine.needle.tools/samples/physics-playground/
 * @link https://engine.needle.tools/samples/physics-&-animation/
 * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies
 */
export declare class Rigidbody extends Behaviour implements IRigidbody {
    get isRigidbody(): boolean;
    /** When true the mass will be automatically calculated by the attached colliders */
    autoMass: boolean;
    /** By default the mass will be automatically calculated (see `autoMass`) by the physics engine using the collider sizes
     * To set the mass manually you can either set the `mass` value or set `autoMass` to `false`
     */
    set mass(value: number);
    get mass(): number;
    private _mass;
    /**
     * Use gravity is a flag that can be set to false to disable gravity for a specific rigid-body.
     */
    useGravity: boolean;
    /**
     * The center of mass is the point around which the mass of the rigid-body is evenly distributed. It is used to compute the torque applied to the rigid-body when forces are applied to it.
     */
    centerOfMass: Vector3;
    /**
     * Constraints are used to lock the position or rotation of an object in a specific axis.
     */
    constraints: RigidbodyConstraints;
    /**
     * IsKinematic is a flag that can be set to true to make a rigid-body kinematic. Kinematic rigid-bodies are not affected by forces and collisions. They are meant to be animated by the user.
     */
    isKinematic: boolean;
    /** Drag is a force that resists the motion of the rigid-body. It is applied to the center-of-mass of the rigid-body.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#damping */
    drag: number;
    /** Angular drag is a force that resists the rotation of the rigid-body. It is applied to the center-of-mass of the rigid-body.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#damping */
    angularDrag: number;
    /**
     * Detect collisions is a flag that can be set to false to disable collision detection for a specific rigid-body.
     */
    detectCollisions: boolean;
    /** The sleeping threshold is the minimum velocity below which a dynamic rigid-body will be put to sleep by the physics engine.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#sleeping */
    sleepThreshold: number;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#continuous-collision-detection */
    collisionDetectionMode: CollisionDetectionMode;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    get lockPositionX(): boolean;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    get lockPositionY(): boolean;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    get lockPositionZ(): boolean;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    get lockRotationX(): boolean;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    get lockRotationY(): boolean;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    get lockRotationZ(): boolean;
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    set lockPositionX(v: boolean);
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    set lockPositionY(v: boolean);
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    set lockPositionZ(v: boolean);
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    set lockRotationX(v: boolean);
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    set lockRotationY(v: boolean);
    /** @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#locking-translationsrotations */
    set lockRotationZ(v: boolean);
    /** Gravity is such a common force that it is implemented as a special case (even if it could easily be implemented by the user using force application). Note however that a change of gravity won't automatically wake-up the sleeping bodies so keep in mind that you may want to wake them up manually before a gravity change.
     *
     * It is possible to change the way gravity affects a specific rigid-body by setting the rigid-body's gravity scale to a value other than 1.0. The magnitude of the gravity applied to this body will be multiplied by this scaling factor. Therefore, a gravity scale set to 0.0 will disable gravity for the rigid-body whereas a gravity scale set to 2.0 will make it twice as strong. A negative value will flip the direction of the gravity for this rigid-body.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#gravity
     */
    set gravityScale(val: number);
    get gravityScale(): number;
    private _gravityScale;
    /** Rigidbodies with higher dominance will be immune to forces originating from contacts with rigidbodies of lower dominance.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#dominance
     */
    dominanceGroup: number;
    private static tempPosition;
    private _propertiesChanged;
    private _currentVelocity;
    private _smoothedVelocity;
    private _smoothedVelocityGetter;
    private _lastPosition;
    private _watch?;
    awake(): void;
    onEnable(): void;
    onDisable(): void;
    onDestroy(): void;
    onValidate(): void;
    beforePhysics(): Generator<undefined, void, unknown>;
    /** Teleport the rigidbody to a new position in the world.
     * Will reset forces before setting the object world position
     * @param pt The new position to teleport the object to (world space)
     * @param localspace When true the object will be teleported in local space, otherwise in world space
     * */
    teleport(pt: {
        x: number;
        y: number;
        z: number;
    }, localspace?: boolean): void;
    resetForces(wakeup?: boolean): void;
    resetTorques(wakeup?: boolean): void;
    resetVelocities(): void;
    resetForcesAndTorques(): void;
    /** When a dynamic rigid-body doesn't move (or moves very slowly) during a few seconds, it will be marked as sleeping by the physics pipeline. Rigid-bodies marked as sleeping are no longer simulated by the physics engine until they are woken up. That way the physics engine doesn't waste any computational resources simulating objects that don't actually move. They are woken up automatically whenever another non-sleeping rigid-body starts interacting with them (either with a joint, or with one of its attached colliders generating contacts).
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#sleeping */
    wakeUp(): void;
    get isSleeping(): boolean | undefined;
    /** Call to force an update of the rigidbody properties in the physics engine */
    updateProperties(): any;
    /** Forces affect the rigid-body's acceleration whereas impulses affect the rigid-body's velocity
     * the acceleration change is equal to the force divided by the mass:
     * @link see https://rapier.rs/docs/user_guides/javascript/rigid_bodies#forces-and-impulses */
    applyForce(vec: Vector3 | Vec3, _rel?: Vector3, wakeup?: boolean): void;
    /** Forces affect the rigid-body's acceleration whereas impulses affect the rigid-body's velocity
     * the velocity change is equal to the impulse divided by the mass
     * @link see https://rapier.rs/docs/user_guides/javascript/rigid_bodies#forces-and-impulses */
    applyImpulse(vec: Vector3 | Vec3, wakeup?: boolean): void;
    /** @link see https://rapier.rs/docs/user_guides/javascript/rigid_bodies#forces-and-impulses */
    setForce(x: Vector3 | Vec3 | number, y?: number, z?: number, wakeup?: boolean): void;
    /** The velocity of a dynamic rigid-body controls how fast it is moving in time. The velocity is applied at the center-of-mass of the rigid-body. This method returns the current linear velocity of the rigid-body.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#velocity */
    getVelocity(): Vector3;
    setVelocity(x: number | Vector3, y?: number, z?: number, wakeup?: boolean): void;
    /** The velocity of a dynamic rigid-body controls how fast it is moving in time. The velocity is applied at the center-of-mass of the rigid-body. This method returns the current angular velocity of the rigid-body.
     * @link https://rapier.rs/docs/user_guides/javascript/rigid_bodies#velocity */
    getAngularVelocity(): Vector3;
    setAngularVelocity(x: Vec3, wakeup?: boolean): any;
    setAngularVelocity(x: number, y: number, z: number, wakeup?: boolean): any;
    /** Set the angular velocity of a rigidbody (equivalent to calling `setAngularVelocity`) */
    setTorque(x: Vec3): any;
    setTorque(x: number, y: number, z: number): any;
    /**
     * Returns the rigidbody velocity smoothed over ~ 10 frames
     */
    get smoothedVelocity(): Vector3;
    /**d
     * @deprecated not used anymore and will be removed in a future update
     */
    setBodyFromGameObject(_velocity?: Vector3 | null | {
        x: number;
        y: number;
        z: number;
    }): void;
    private captureVelocity;
}
