import * as THREE from 'three'; import type { GLTF } from 'three-stdlib'; import type { RapierRigidBody } from '@react-three/rapier'; export type ActionName = 'idle' | 'forwardWalk' | 'backwardWalk' | 'runForward' | 'runBackward' | 'strafeLeft' | 'strafeRight'; export interface GLTFAction extends THREE.AnimationClip { name: ActionName; } export type GLTFResult = GLTF & { nodes: { Slide_Highlight_0_1: THREE.Mesh; Slide_Highlight_0_2: THREE.Mesh; Slide_Highlight_0_3: THREE.Mesh; Alpha_Joints: THREE.SkinnedMesh; Alpha_Surface: THREE.SkinnedMesh; mixamorigHips: THREE.Bone; }; materials: { Highlight: THREE.MeshStandardMaterial; Primary: THREE.MeshStandardMaterial; Secondary: THREE.MeshStandardMaterial; Alpha_Joints_MAT: THREE.MeshStandardMaterial; Alpha_Body_MAT: THREE.MeshStandardMaterial; }; animations: GLTFAction[]; }; export interface PlayerProps extends React.ComponentProps<'group'> { modelPath?: string; animationPaths?: { idle?: string; walkForward?: string; walkBackward?: string; runForward?: string; runBackward?: string; strafeLeft?: string; strafeRight?: string; jumpStart?: string; jumpEnd?: string; }; audioPath?: string; colliderArgs?: [height: number, radius: number]; mass?: number; restitution?: number; friction?: number; linearDamping?: number; angularDamping?: number; castShadow?: boolean; receiveShadow?: boolean; } export interface PlayerState { wait: boolean; isJumping: boolean; action: THREE.AnimationAction | null; } export interface PlayerRefs { group: React.RefObject; controls: React.RefObject; mouseRotationRef: React.MutableRefObject<{ x: number; y: number; }>; jumpPressedRef: React.MutableRefObject; shoot: React.MutableRefObject; zoom: React.MutableRefObject; shotSfxRef: React.RefObject; leftHandBone: React.MutableRefObject; rightHandBone: React.MutableRefObject; rightPalmBone: React.MutableRefObject; recoilActive: React.MutableRefObject; recoilStartTime: React.MutableRefObject; leftHandOriginalRotation: React.MutableRefObject; rightHandOriginalRotation: React.MutableRefObject; muzzleFlashRef: React.RefObject; muzzleFlashLightRef: React.RefObject; muzzleFlashActive: React.MutableRefObject; muzzleFlashStartTime: React.MutableRefObject; gunBarrelRef: React.MutableRefObject; smoothedPlayerPosition: React.MutableRefObject; smoothedCameraPosition: React.MutableRefObject; shootRayDirection: React.MutableRefObject; dotRef: React.RefObject; } export interface JumpParams { jumpPressed: boolean; isGrounded: boolean; wait: boolean; isJumping: boolean; actions: THREE.AnimationAction[]; controls: React.RefObject; setAction: (action: THREE.AnimationAction) => void; setIsJumping: (jumping: boolean) => void; setWait: (wait: boolean) => void; } export interface MovementParams { forward: boolean; backward: boolean; left: boolean; right: boolean; run: boolean; jump: boolean; wait: boolean; isJumping: boolean; actions: THREE.AnimationAction[]; setAction: (action: THREE.AnimationAction) => void; } export interface RecoilParams { recoilActive: React.MutableRefObject; recoilStartTime: React.MutableRefObject; leftHandBone: React.MutableRefObject; rightHandBone: React.MutableRefObject; leftHandOriginalRotation: React.MutableRefObject; rightHandOriginalRotation: React.MutableRefObject; } export interface MuzzleFlashParams { muzzleFlashActive: React.MutableRefObject; muzzleFlashStartTime: React.MutableRefObject; muzzleFlashRef: React.RefObject; muzzleFlashLightRef: React.RefObject; gunBarrelRef: React.MutableRefObject; group: React.RefObject; bones: THREE.Bone[]; pitch: number; yaw: number; camera: THREE.Camera; } export interface CameraParams { zoom: React.MutableRefObject; smoothedPlayerPosition: React.MutableRefObject; smoothedCameraPosition: React.MutableRefObject; playerYRotation: THREE.Quaternion; pitch: number; yaw: number; camera: THREE.Camera; world?: any; } export interface MovementPhysicsParams { forward: boolean; backward: boolean; left: boolean; right: boolean; run: boolean; playerYRotation: THREE.Quaternion; controls: React.RefObject; smoothedPlayerPosition: React.MutableRefObject; }