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

    Function clampPositionToBounds

    • Clamp a 3D position to stay within arena boundaries.

      Only clamps X and Z axes (horizontal plane). Y axis (height) is unchanged. Arena is centered at origin with bounds extending ±width/2 and ±depth/2.

      Korean: 위치를 경기장 경계로 제한 (Clamp Position To Bounds)

      Parameters

      Returns Vector3

      Clamped position as new THREE.Vector3

      const position = new THREE.Vector3(6, 0, 4); // Outside bounds
      const bounds = calculateArenaBounds(config);
      const clamped = clampPositionToBounds(position, bounds);
      // Result: Vector3(4.7, 0, 3.45) - clamped to edges