Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x 56x | /**
* Skeletal rigging types for articulated body model
*
* Defines bone hierarchy, skeletal rig structure, and animation keyframes
* for realistic human-like fighter animations with independent limb movement.
*
* @module types/skeletal
* @category Type Definitions
* @korean 골격타입
*/
import * as THREE from "three";
/**
* Bone in skeletal rig hierarchy
*
* Represents a single bone with position, rotation, scale, and parent-child relationships.
* Bones form a tree structure for realistic articulated body movement.
*
* @public
* @category Skeletal System
* @korean 뼈
*/
export interface Bone {
/**
* Unique identifier for the bone
* @korean 이름
*/
readonly name: string;
/**
* Parent bone (null for root bone)
* @korean 부모뼈
*/
parent: Bone | null;
/**
* Local position relative to parent
* @korean 위치
*/
position: THREE.Vector3;
/**
* Local rotation in Euler angles
* @korean 회전
*/
rotation: THREE.Euler;
/**
* Local scale
* @korean 크기
*/
scale: THREE.Vector3;
/**
* Child bones
* @korean 자식뼈들
*/
children: Bone[];
/**
* Length of the bone (for rendering)
* @korean 길이
*/
readonly length: number;
/**
* Rest pose position (default pose)
* @korean 기본위치
*/
readonly restPosition: THREE.Vector3;
/**
* Rest pose rotation (default pose)
* @korean 기본회전
*/
readonly restRotation: THREE.Euler;
}
/**
* Skeletal rig with complete bone hierarchy
*
* Contains root bone and map of all bones for efficient lookup.
* Maximum 30 bones for 60fps performance.
*
* @public
* @category Skeletal System
* @korean 골격
*/
export interface SkeletalRig {
/**
* Root bone (pelvis/center)
* @korean 뿌리뼈
*/
readonly root: Bone;
/**
* Map of bone name to bone for fast lookup
* @korean 뼈맵
*/
readonly bones: Map<string, Bone>;
/**
* Total number of bones in rig
* @korean 뼈개수
*/
readonly boneCount: number;
}
/**
* Animation keyframe for skeletal animation
*
* Defines bone transformations at a specific time in the animation.
* Keyframes are interpolated for smooth animation between poses.
*
* @public
* @category Animation
* @korean 애니메이션키프레임
*/
export interface AnimationKeyframe {
/**
* Time in seconds from animation start
* @korean 시간
*/
readonly time: number;
/**
* Bone rotations at this keyframe
* Map of bone name to rotation
* @korean 뼈회전들
*/
readonly boneRotations: Map<string, THREE.Euler>;
/**
* Bone positions at this keyframe (optional, for IK or special moves)
* Map of bone name to position offset from rest pose
* @korean 뼈위치들
*/
readonly bonePositions: Map<string, THREE.Vector3>;
/**
* Optional easing function name for interpolation
* @korean 이징함수
*/
readonly easing?: "linear" | "ease-in" | "ease-out" | "ease-in-out";
}
/**
* Complete skeletal animation sequence
*
* Sequence of keyframes defining a complete animation
* (e.g., jab, cross, roundhouse kick).
*
* @public
* @category Animation
* @korean 골격애니메이션
*/
export interface SkeletalAnimation {
/**
* Animation identifier
* @korean 이름
*/
readonly name: string;
/**
* Korean name for animation
* @korean 한글이름
*/
readonly koreanName: string;
/**
* Animation keyframes in chronological order
* @korean 키프레임들
*/
readonly keyframes: AnimationKeyframe[];
/**
* Total duration in seconds
* @korean 지속시간
*/
readonly duration: number;
/**
* Whether animation loops
* @korean 반복여부
*/
readonly loop: boolean;
/**
* Animation type (attack, defense, stance change, movement, etc.)
* @korean 애니메이션타입
*/
readonly type: "attack" | "defense" | "stance" | "walk" | "idle" | "movement";
}
/**
* Bone chain definition for IK (Inverse Kinematics)
*
* Defines a chain of bones for IK solving (e.g., arm chain, leg chain).
* Used for realistic limb positioning and movement.
*
* @public
* @category Skeletal System
* @korean 뼈체인
*/
export interface BoneChain {
/**
* Chain identifier
* @korean 이름
*/
readonly name: string;
/**
* Start bone (e.g., shoulder for arm chain)
* @korean 시작뼈
*/
readonly startBone: string;
/**
* End bone (e.g., hand for arm chain)
* @korean 끝뼈
*/
readonly endBone: string;
/**
* Bones in chain from start to end
* @korean 뼈들
*/
readonly bones: string[];
/**
* IK target position (for end effector)
* @korean IK목표
*/
ikTarget?: THREE.Vector3;
}
/**
* Hand bone structure with 5 fingers
*
* Simplified hand model with palm and 5 fingers.
* Each finger has 3 segments (proximal, middle, distal).
*
* @public
* @category Skeletal System
* @korean 손뼈
*/
export interface HandBones {
/**
* Palm bone
* @korean 손바닥
*/
readonly palm: Bone;
/**
* Thumb bones (3 segments)
* @korean 엄지손가락
*/
readonly thumb: [Bone, Bone, Bone];
/**
* Index finger bones (3 segments)
* @korean 검지손가락
*/
readonly index: [Bone, Bone, Bone];
/**
* Middle finger bones (3 segments)
* @korean 중지손가락
*/
readonly middle: [Bone, Bone, Bone];
/**
* Ring finger bones (3 segments)
* @korean 약지손가락
*/
readonly ring: [Bone, Bone, Bone];
/**
* Pinky finger bones (3 segments)
* @korean 새끼손가락
*/
readonly pinky: [Bone, Bone, Bone];
}
/**
* Joint constraint for realistic movement
*
* Defines rotation limits for joints (e.g., elbow can't bend backward).
* Ensures anatomically correct movement.
*
* @public
* @category Skeletal System
* @korean 관절제약
*/
export interface JointConstraint {
/**
* Bone name this constraint applies to
* @korean 뼈이름
*/
readonly boneName: string;
/**
* Minimum rotation angles (X, Y, Z) in radians
* @korean 최소회전
*/
readonly minRotation: THREE.Vector3;
/**
* Maximum rotation angles (X, Y, Z) in radians
* @korean 최대회전
*/
readonly maxRotation: THREE.Vector3;
/**
* Whether this joint can twist (rotate around its length)
* @korean 비틀기가능
*/
readonly canTwist: boolean;
}
/**
* Bone names for humanoid rig
*
* Standard bone naming convention for humanoid skeleton.
* Total: 28 bones base + optional 38 hand bones (19 per hand) = 66 bones max.
*
* Hand bones are optional and can be excluded for performance (LOD system).
*
* @public
* @category Skeletal System
* @korean 뼈이름들
*/
export enum BoneName {
// Core (1 bone)
PELVIS = "pelvis",
// Spine (3 bones)
SPINE_LOWER = "spine_lower",
SPINE_MIDDLE = "spine_middle",
SPINE_UPPER = "spine_upper",
// Head (2 bones)
NECK = "neck",
HEAD = "head",
// Left Arm (6 bones)
SHOULDER_L = "shoulder_L",
UPPER_ARM_L = "upper_arm_L",
ELBOW_L = "elbow_L",
FOREARM_L = "forearm_L",
WRIST_L = "wrist_L",
HAND_L = "hand_L",
// Right Arm (6 bones)
SHOULDER_R = "shoulder_R",
UPPER_ARM_R = "upper_arm_R",
ELBOW_R = "elbow_R",
FOREARM_R = "forearm_R",
WRIST_R = "wrist_R",
HAND_R = "hand_R",
// Left Leg (5 bones)
HIP_L = "hip_L",
THIGH_L = "thigh_L",
KNEE_L = "knee_L",
SHIN_L = "shin_L",
FOOT_L = "foot_L",
// Right Leg (5 bones)
HIP_R = "hip_R",
THIGH_R = "thigh_R",
KNEE_R = "knee_R",
SHIN_R = "shin_R",
FOOT_R = "foot_R",
// Left Hand Fingers (19 bones - optional for LOD)
THUMB_META_L = "thumb_meta_L",
THUMB_PROX_L = "thumb_prox_L",
THUMB_DIST_L = "thumb_dist_L",
INDEX_META_L = "index_meta_L",
INDEX_PROX_L = "index_prox_L",
INDEX_INTER_L = "index_inter_L",
INDEX_DIST_L = "index_dist_L",
MIDDLE_META_L = "middle_meta_L",
MIDDLE_PROX_L = "middle_prox_L",
MIDDLE_INTER_L = "middle_inter_L",
MIDDLE_DIST_L = "middle_dist_L",
RING_META_L = "ring_meta_L",
RING_PROX_L = "ring_prox_L",
RING_INTER_L = "ring_inter_L",
RING_DIST_L = "ring_dist_L",
PINKY_META_L = "pinky_meta_L",
PINKY_PROX_L = "pinky_prox_L",
PINKY_INTER_L = "pinky_inter_L",
PINKY_DIST_L = "pinky_dist_L",
// Right Hand Fingers (19 bones - optional for LOD)
THUMB_META_R = "thumb_meta_R",
THUMB_PROX_R = "thumb_prox_R",
THUMB_DIST_R = "thumb_dist_R",
INDEX_META_R = "index_meta_R",
INDEX_PROX_R = "index_prox_R",
INDEX_INTER_R = "index_inter_R",
INDEX_DIST_R = "index_dist_R",
MIDDLE_META_R = "middle_meta_R",
MIDDLE_PROX_R = "middle_prox_R",
MIDDLE_INTER_R = "middle_inter_R",
MIDDLE_DIST_R = "middle_dist_R",
RING_META_R = "ring_meta_R",
RING_PROX_R = "ring_prox_R",
RING_INTER_R = "ring_inter_R",
RING_DIST_R = "ring_dist_R",
PINKY_META_R = "pinky_meta_R",
PINKY_PROX_R = "pinky_prox_R",
PINKY_INTER_R = "pinky_inter_R",
PINKY_DIST_R = "pinky_dist_R",
}
/**
* Animation state for skeletal player
*
* Tracks current animation playback state for skeletal animations.
*
* @public
* @category Animation
* @korean 애니메이션상태
*/
export interface SkeletalAnimationState {
/**
* Current animation being played
* @korean 현재애니메이션
*/
currentAnimation: SkeletalAnimation | null;
/**
* Current time in animation (seconds)
* @korean 현재시간
*/
currentTime: number;
/**
* Whether animation is playing
* @korean 재생중
*/
isPlaying: boolean;
/**
* Animation playback speed multiplier
* @korean 재생속도
*/
playbackSpeed: number;
/**
* Previous keyframe index
* @korean 이전키프레임
*/
previousKeyframeIndex: number;
/**
* Next keyframe index
* @korean 다음키프레임
*/
nextKeyframeIndex: number;
}
|