Added a compile time option to use double precision body positions. Most
math remains single precision with minimal performance loss.

`BOX3D_DOUBLE_PRECISION`

Improved accuracy of body inertia computation when shapes are far from
the body origin.

WARNING: several APIs changed but migration should be straight forward
if doubles are not enabled.
This commit is contained in:
Erin Catto 2026-06-18 20:51:16 -07:00 • committed by GitHub
commit 09c65b08ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
115 changed files with 7591 additions and 5295 deletions

View file

@ -99,7 +99,43 @@ jobs:
- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/${{env.BUILD_TYPE}}/test
build-ubuntu-double:
name: ubuntu-double-precision
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.draft == false
timeout-minutes: 4
steps:
- uses: actions/checkout@v6
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX3D_DOUBLE_PRECISION=ON -DBOX3D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DBOX3D_VALIDATE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/test
build-windows-double:
name: windows-double-precision
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.draft == false
timeout-minutes: 4
steps:
- uses: actions/checkout@v6
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX3D_DOUBLE_PRECISION=ON -DBOX3D_SAMPLES=OFF -DBOX3D_VALIDATE=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/${{env.BUILD_TYPE}}/test
samples-windows:
name: samples-windows
runs-on: windows-latest
@ -130,7 +166,27 @@ jobs:
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBOX3D_SAMPLES=ON -DBUILD_SHARED_LIBS=OFF -DBOX3D_UNIT_TESTS=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
samples-windows-double:
name: samples-windows-double-precision
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.draft == false
timeout-minutes: 6
steps:
- uses: actions/checkout@v6
- name: Setup MSVC dev command prompt
uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DBOX3D_DOUBLE_PRECISION=ON -DBOX3D_SAMPLES=ON -DBUILD_SHARED_LIBS=OFF -DBOX3D_UNIT_TESTS=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release