Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.0
    Preparing search index...

    Function applyLaterality

    • Apply laterality transformation to a skeletal animation.

      Korean: 애니메이션 측면성 적용

      Transforms a skeletal animation to match the specified laterality (left/right stance). Right laterality returns the original animation; left laterality creates a mirrored version with left/right bones swapped and lateral rotations negated.

      Transformation Rules:

      • Swap left ↔ right bone names (e.g., "shoulder_L" ↔ "shoulder_R")
      • Negate Y rotation (lateral twist around vertical axis)
      • Negate Z rotation (roll around forward-back axis)
      • Preserve X rotation (forward/back bend)
      • Maintain timing, duration, and easing information

      Performance: <1ms for typical animation (verified in tests)

      Parameters

      Returns SkeletalAnimation

      Transformed animation with mirrored bone rotations for left laterality

      // Get right-handed punch animation
      const rightPunch = GEON_BONE_BREAKING_STRIKE_1;

      // Create left-handed version
      const leftPunch = applyLaterality(rightPunch, "left");
      // leftPunch has left hand as striking hand, mirrored rotations

      // Right laterality returns original (no transformation cost)
      const sameAnimation = applyLaterality(rightPunch, "right");
      // sameAnimation === rightPunch (same reference)

      애니메이션측면성적용