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

    Function metersToPixels

    • Convert physics position (meters) to screen position (pixels).

      IMPORTANT: Only handles scaling conversion between meters and pixels. Does NOT account for arena position offsets (bounds.x and bounds.y). Callers must add these offsets separately when rendering to screen.

      Example:

      const pixelPos = metersToPixels(physicsPos, bounds);
      const screenX = bounds.x + pixelPos.x; // Add arena offset
      const screenY = bounds.y + pixelPos.y; // Add arena offset

      Korean: 미터를픽셀로 (Meters To Pixels)

      Parameters

      Returns { x: number; y: number }

      Position in pixels RELATIVE to arena origin (add bounds.x/y for screen position)

      Error if position is invalid