/*! * BVHEcctrl * https://github.com/pmndrs/BVHEcctrl * (c) 2025 @ErdongChen-Andrew * Released under the MIT License. */ /** * Physics formulas: * 1. F = m * a * 2. v = d / t (constant velocity) * 3. a = Δv / t * 4. d = v0t + 1/2 * a * t^2 * 5. v = v0 + a * t * 6. J = F * Δt * 7. Δv = F * Δt / m * 8. E = 1/2 * m * v^2 * 9. F_drag = -kv * * Usefull formulas in ecctrl: * 1. pos += velocity * delta * 2. vel += acceleration * delta * 3. Fg = mass * gravity * 4. F(spring) = -k(x - x0) * 5. F(damping) = -c * v * 6. linVel = radius x angVel * 7. K < 1 / (Δt)^2 (60Hz => 3600) * 8. C < 2 / Δt (60Hz => 120) */ import * as THREE from "three"; import React, { type ReactNode } from "react"; import type { MovementInput, CharacterAnimationStatus, FloatCheckType } from "."; declare const _default: React.ForwardRefExoticComponent>; export default _default; /** * Export values/features/functions */ export declare const characterStatus: CharacterStatus; /** * Export ecctrl types */ export interface EcctrlProps extends Omit, 'ref'> { children?: ReactNode; debug?: boolean; colliderCapsuleArgs?: [radius: number, length: number, capSegments: number, radialSegments: number]; paused?: boolean; delay?: number; gravity?: number; fallGravityFactor?: number; maxFallSpeed?: number; mass?: number; sleepTimeout?: number; slowMotionFactor?: number; turnSpeed?: number; maxWalkSpeed?: number; maxRunSpeed?: number; acceleration?: number; deceleration?: number; counterAccFactor?: number; airDragFactor?: number; jumpVel?: number; floatCheckType?: FloatCheckType; maxSlope?: number; floatHeight?: number; floatPullBackHeight?: number; floatSensorRadius?: number; floatSpringK?: number; floatDampingC?: number; collisionCheckIteration?: number; collisionPushBackVelocity?: number; collisionPushBackDamping?: number; collisionPushBackThreshold?: number; } export interface BVHEcctrlApi { group: THREE.Group | null; model: THREE.Group | null; resetLinVel: () => void; addLinVel: (v: THREE.Vector3) => void; setLinVel: (v: THREE.Vector3) => void; setMovement: (input: MovementInput) => void; } export interface CharacterStatus { position: THREE.Vector3; linvel: THREE.Vector3; quaternion: THREE.Quaternion; inputDir: THREE.Vector3; movingDir: THREE.Vector3; isOnGround: boolean; isOnMovingPlatform: boolean; animationStatus: CharacterAnimationStatus; }