Function worldToRTCCenter

  • Converts a World-space 3D position to its RTC center.

    Given a World-space position, this function calculates the nearest RTC center, ensuring that the position aligns with a grid defined by RTC_CELL_SIZE.

    Parameters

    • worldCenter: Vec3

      The World-space position to convert.

    • rtcCenter: Vec3

      The resulting RTC center position.

    • tileSize: number

      The size of the RTC tile, which determines the grid spacing for the RTC centers.

    Returns Vec3

    The RTC center position.