/*! * Ecctrl * https://github.com/pmndrs/ecctrl * * SPDX-FileCopyrightText: 2023-2026 Erdong Chen * SPDX-License-Identifier: MIT */ import * as THREE from "three"; import { type RapierRigidBody, type RigidBodyProps, type RapierCollider } from "@react-three/rapier"; import React, { type ReactNode } from "react"; import { type CurveData } from "../curves/CurveLUT"; import type { MovementInput, ReadonlyMovementInput } from "./types"; declare const _default: React.NamedExoticComponent & React.RefAttributes>; export default _default; export interface EcctrlHandle { body: RapierRigidBody; collider: RapierCollider; readonly upAxis: THREE.Vector3; readonly gravityDir: THREE.Vector3; readonly gravityMag: number; readonly currPos: THREE.Vector3; readonly currQuat: THREE.Quaternion; readonly currLinVel: THREE.Vector3; readonly currAngVel: THREE.Vector3; readonly input: ReadonlyMovementInput; readonly inputDir: THREE.Vector3; readonly movingDirection: THREE.Vector3; readonly relativeVel: THREE.Vector3; readonly relativeVelOnPlane: THREE.Vector3; readonly relativeVelOnUp: THREE.Vector3; readonly moveImpulse: THREE.Vector3; readonly floatingImpulse: THREE.Vector3; readonly dragFrictionImpulse: THREE.Vector3; readonly bodyXAxis: THREE.Vector3; readonly bodyYAxis: THREE.Vector3; readonly bodyZAxis: THREE.Vector3; readonly standCollider: RapierRigidBody | null; readonly standPoint: THREE.Vector3; readonly standNormal: THREE.Vector3; readonly isOnGround: boolean; readonly isFalling: boolean; readonly isOnPlatform: boolean; readonly slopeAngle: number; readonly actualSlopeAngle: number; readonly standFriction: number; readonly slideFriction: number; readonly isMoving: boolean; readonly moveSpeed: number; readonly verticalSpeed: number; readonly runActive: boolean; readonly jumpActive: boolean; readonly lockForward: boolean; readonly turnOnYQuat: THREE.Quaternion; setMovement: (state: MovementInput) => void; setLockForward: (lock: boolean) => void; setForwardDir: (dir: THREE.Vector3) => void; } export interface EcctrlProps extends RigidBodyProps { children?: ReactNode; debug?: boolean; enable?: boolean; capsuleHalfHeight?: number; capsuleRadius?: number; lockForward?: boolean; useCustomForward?: boolean; useCharacterUpAxis?: boolean; enableCustomGravity?: boolean; gravityDirLerpSpeed?: number; maxWalkVel?: number; maxRunVel?: number; accDeltaTime?: number; decDeltaTime?: number; rejectVelFactor?: number; moveImpulsePointOffset?: number; jumpVel?: number; jumpDuration?: number; slopeJumpFactor?: number; airDragFactor?: number; slideGripFactor?: number; fallingGravityScale?: number; fallingMaxVel?: number; enableToggleRun?: boolean; groundDetection?: "shapeCast" | "rayCast"; slopeMaxAngle?: number; floatHeight?: number; rayOriginOffest?: number; rayHitForgiveness?: number; rayLength?: number; rayRadius?: number; springK?: number; dampingC?: number; autoBalance?: boolean; autoBalanceSpringK?: number; autoBalanceDampingC?: number; autoBalanceSpringOnY?: number; autoBalanceDampingOnY?: number; followPlatform?: boolean; massRatioFallOffCurveData?: CurveData; applyCounterMass?: boolean; applyCounterJumpImp?: boolean; counterJumpImpFactor?: number; applyCounterMoveImp?: boolean; counterMoveImpFactor?: number; props?: RigidBodyProps; }