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

    Class PhysicalReachCalculator

    Physical Reach Calculator.

    Korean: 물리적 도달 계산기

    Calculates reality-based reach using archetype physical attributes and animation timing.

    물리적도달계산기

    Index

    Constructors

    Methods

    • Calculate maximum possible reach for a technique.

      Korean: 기술의 최대 가능 도달 거리

      Calculates reach at peak animation time (maximum extension). Uses hybrid reach system with reachConfig if provided.

      Parameters

      Returns number

      Maximum effective reach in meters

      const calculator = new PhysicalReachCalculator();

      // With reachConfig for accurate designed reach
      const maxReachWithConfig = calculator.calculateMaxReach(
      MUSA_PHYSICAL,
      AnimationType.FRONT_KICK,
      TrigramStance.GEON,
      { bodyPart: "leg", techniqueType: "kick", baseExtension: 1.05 }
      );
      // Uses max(1.05, 1.0) = 1.05

      // Without reachConfig (backward compatible)
      const maxReachLegacy = calculator.calculateMaxReach(
      MUSA_PHYSICAL,
      AnimationType.FRONT_KICK,
      TrigramStance.GEON
      );
      // Uses animation multiplier only (1.0)

      최대도달계산

    • Calculate effective reach for a technique at a specific animation time.

      Korean: 특정 애니메이션 시간의 유효 도달 거리 계산

      This is the core method that integrates:

      1. Physical attributes (archetype-specific limb length)
      2. Animation timing (hit window and extension phase)
      3. Technique baseExtension (designer-specified reach)
      4. Stance modifiers (Eight Trigrams reach bonuses)
      5. Body pivot contribution (hip rotation and torso lean for kicks)

      Hybrid Reach System: Uses the maximum of:

      • reachConfig.baseExtension (designer-specified reach)
      • maxReachMultiplier (animation-driven reach)

      This ensures techniques get at least their designed reach while allowing animations to extend beyond the base if needed.

      Body Pivot Mechanics for Kicks: Kicks benefit from whole-body rotation that punches don't utilize:

      • Hip rotation adds ~0.15m (pelvis width + pivot)
      • Torso lean adds ~0.1m (forward lean during kick)
      • Total body pivot: ~0.25m additional reach

      This accounts for the biomechanics of kicks where the fighter rotates their entire body to extend reach, unlike punches which rely primarily on arm extension.

      Parameters

      • physicalAttributes: PhysicalAttributes

        Fighter's physical attributes

      • animationType: AnimationType

        Animation being executed

      • animationTime: number

        Current time in animation (seconds)

      • stance: TrigramStance

        Current trigram stance

      • OptionalreachConfig: PhysicalReachConfig

        Optional technique reach configuration with baseExtension

      Returns PhysicalReachResult

      Physical reach calculation result

      const calculator = new PhysicalReachCalculator();

      // With reachConfig (uses max of baseExtension and animation multiplier)
      const frontKick = calculator.calculateReach(
      MUSA_PHYSICAL,
      AnimationType.FRONT_KICK,
      0.27, // Peak time
      TrigramStance.GEON,
      { bodyPart: "leg", techniqueType: "kick", baseExtension: 1.05 }
      );
      // Uses max(1.05, 1.0) = 1.05 for proper designed reach

      // Without reachConfig (uses only animation multiplier - backward compatible)
      const legacyKick = calculator.calculateReach(
      MUSA_PHYSICAL,
      AnimationType.FRONT_KICK,
      0.27,
      TrigramStance.GEON
      );
      // Uses animation multiplier (1.0) only

      도달계산