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

    Interface BodyFacing

    Body facing direction system state

    Manages automatic character rotation to face opponent with:

    • Smooth torso rotation (45°/sec, ±90° range)
    • Independent head tracking (±45° range)
    • 180° turn animations for repositioning
    • Facing lock during attack/defend animations

    Korean terminology:

    • 정면향하기 (Jeongmyeon Hyanghagi) - Face forward
    • 몸회전 (Mom Hoejeon) - Body rotation
    • 머리추적 (Meori Chujok) - Head tracking
    • 180도회전 (180-do Hoejeon) - 180-degree turn

    몸향하기상태

    interface BodyFacing {
        currentAngle: number;
        headAngleOffset: number;
        hipRotation?: number;
        isLocked: boolean;
        isTurning: boolean;
        rotationSpeed: number;
        targetAngle: number;
        torsoRotation?: number;
        turnDirection?: "left" | "right";
        turnStartTime?: number;
    }
    Index

    Properties

    currentAngle: number

    Current facing direction in degrees (0-360)

    • 0° = facing right (+X axis)
    • 90° = facing down (+Z axis)
    • 180° = facing left (-X axis)
    • 270° = facing up (-Z axis)

    현재각도

    headAngleOffset: number

    Head rotation offset relative to torso (-45° to +45°) Head can track independently within limited range

    • Positive = head turned right
    • Negative = head turned left

    머리회전각도

    hipRotation?: number

    Hip/pelvis rotation in radians (lower body facing direction) Base rotation for the lower body, torsoRotation is relative to this

    골반회전 (Golbanhwoejeon)

    isLocked: boolean

    Whether facing direction is locked True during attack/defend animations to lock attack direction False during idle/movement to allow dynamic tracking

    회전잠금

    isTurning: boolean

    Whether character is currently executing a 180° turn animation Used to prevent movement and other actions during repositioning

    180도회전중

    rotationSpeed: number

    Rotation speed in degrees per second Default: 45°/sec for smooth, realistic rotation

    회전속도

    targetAngle: number

    Desired facing direction in degrees (0-360) Typically pointing toward opponent position

    목표각도

    torsoRotation?: number

    Torso rotation relative to hips in radians Range: ±π/2 (±90°) for anatomically correct movement

    • Positive = torso rotated right relative to hips
    • Negative = torso rotated left relative to hips

    허리회전 (Heorhwoejeon)

    turnDirection?: "left" | "right"

    Direction of current 180° turn ('left' or 'right') Determines which turn animation to play

    회전방향

    turnStartTime?: number

    Timestamp when 180° turn animation started Used to track turn animation progress (200ms duration)

    회전시작시간