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

    Class AttackMovementPhysics

    Attack Movement Physics Engine.

    Korean: 공격 이동 물리 엔진

    Calculates realistic forward movement during attack animations based on technique type, stance modifiers, and animation timing. Provides smooth lunge and recovery phases for authentic martial arts feel.

    const physics = new AttackMovementPhysics();

    // Calculate movement for roundhouse kick
    const config: AttackMovementConfig = {
    animationType: AnimationType.ROUNDHOUSE_KICK,
    currentStance: TrigramStance.LI, // Fire stance (aggressive)
    direction: new THREE.Vector3(1, 0, 0).normalize(),
    animationDuration: 0.48, // 480ms kick animation
    };

    const result = physics.calculateAttackMovement(config);
    // Result: 1.0m base * 1.3 (Fire bonus) = ~1.3m forward lunge
    // lungeDuration: 0.24s (50% of animation)
    // recoveryDuration: 0.24s (50% of animation)

    공격이동물리

    Index

    Constructors

    Methods

    • Applies attack movement force to attacker position over time.

      Korean: 공격 이동 적용 (Apply Attack Movement)

      Uses smooth ease-out cubic curve for realistic lunge feel:

      • Fast initial forward movement (attack commitment)
      • Gradual deceleration at peak extension
      • Smooth return during recovery phase

      Parameters

      • basePosition: Vector3

        Original stance position (does not change during attack)

      • result: AttackMovementResult

        Attack movement result with displacement

      • elapsedTime: number

        Time elapsed since attack started

      • isRecoveryPhase: boolean

        Whether in recovery (return) phase

      Returns Vector3

      New position with attack displacement applied

      // In animation update loop (60fps)
      const basePos = new THREE.Vector3(0, 0, 0); // Original stance position

      if (elapsedTime < result.lungeDuration) {
      // Lunge forward phase
      const newPosition = physics.applyAttackMovement(
      basePos,
      result,
      elapsedTime,
      false
      );
      } else if (elapsedTime < result.totalDuration) {
      // Recovery return phase
      const newPosition = physics.applyAttackMovement(
      basePos,
      result,
      elapsedTime,
      true
      );
      }

      공격이동적용

    • Calculates attack movement displacement and timing.

      Korean: 공격 이동 계산 (Calculate Attack Movement)

      Determines forward lunge distance and recovery timing based on:

      1. Base movement from animation type
      2. Stance movement modifier (8 trigram effects)
      3. Animation phase durations (lunge vs recovery)

      Parameters

      Returns AttackMovementResult

      Attack movement result with displacement and timing

      // Front kick with Heaven stance
      const kick = physics.calculateAttackMovement({
      animationType: AnimationType.FRONT_KICK,
      currentStance: TrigramStance.GEON,
      direction: attackVector,
      animationDuration: 0.4,
      });
      // Result: ~0.88m forward (0.8m * 1.1 Geon modifier)

      // Jab with Mountain stance
      const jab = physics.calculateAttackMovement({
      animationType: AnimationType.JAB,
      currentStance: TrigramStance.GAN,
      direction: attackVector,
      animationDuration: 0.25,
      });
      // Result: ~0.24m forward (0.3m * 0.8 Gan modifier)

      공격이동계산

    • Private

      Gets base forward movement distance for animation type.

      Korean: 기본 이동 거리 (Base Movement Distance)

      Movement distances by technique category:

      • Kicks: 0.8-1.2m (leg extension, longest reach)
      • Punches: 0.3-0.5m (arm extension, body lunge)
      • Elbows/Knees: 0.2-0.3m (close range techniques)
      • Spinning: 0.5-0.8m (rotation carries momentum)

      Parameters

      Returns number

      Base movement distance in meters

      기본이동거리

    • Gets bilingual Korean-English name for lunge phase.

      Korean: 돌진 단계 이름 (Lunge Phase Name)

      Returns { english: string; korean: string }

      Korean and English phase names

      돌진단계이름

    • Gets bilingual Korean-English name for recovery phase.

      Korean: 복귀 단계 이름 (Recovery Phase Name)

      Returns { english: string; korean: string }

      Korean and English phase names

      복귀단계이름

    • Private

      Gets stance movement modifier for attack lunge.

      Korean: 자세 이동 배율 (Stance Movement Modifier)

      Trigram stance movement modifiers based on combat philosophy:

      • ☰ 건 (Geon/Heaven): +30% movement (aggressive, drives forward with pure yang)
      • ☳ 진 (Jin/Thunder): +20% movement (explosive power, shocking force)
      • ☴ 손 (Son/Wind): +15% movement (continuous flow, mobile)
      • ☲ 리 (Li/Fire): +10% movement (precision strikes, controlled aggression)
      • ☱ 태 (Tae/Lake): 0% (neutral, fluid and adaptive)
      • ☵ 감 (Gam/Water): 0% (neutral, flowing and flexible)
      • ☷ 곤 (Gon/Earth): -10% movement (grounded, stable techniques)
      • ☶ 간 (Gan/Mountain): -20% movement (defensive mastery, minimal advance)

      Parameters

      Returns number

      Movement multiplier (0.8 to 1.3)

      자세이동배율

    • Checks if attacker is currently in lunge phase.

      Korean: 돌진 상태 확인 (Check Lunge State)

      Parameters

      • elapsedTime: number

        Time elapsed since attack started

      • lungeDuration: number

        Total lunge phase duration

      Returns boolean

      True if in forward lunge phase

      돌진상태확인

    • Checks if attacker is in recovery return phase.

      Korean: 회복 상태 확인 (Check Recovery State)

      Parameters

      • elapsedTime: number

        Time elapsed since attack started

      • result: AttackMovementResult

        Attack movement result with timing

      Returns boolean

      True if in recovery return phase

      회복상태확인