Skip to content

Commit ec0e21c

Browse files
authored
Update to Version 3 (#769)
This code is migrated from https://github.com/erincatto/box2c - readme - build scripts - maximum linear velocity in world def, fast rotation in body def
1 parent 411acc3 commit ec0e21c

File tree

468 files changed

+105272
-123955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

468 files changed

+105272
-123955
lines changed

.clang-format

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Reference: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2+
# /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/bin
3+
# https://clang-format-configurator.site/
4+
# default values:
5+
# https://github.com/llvm/llvm-project/blob/main/clang/lib/Format/Format.cpp
6+
---
7+
Language: Cpp
8+
BasedOnStyle: Microsoft
9+
10+
# BreakBeforeBraces: Allman
11+
BreakBeforeBraces: Custom
12+
BraceWrapping:
13+
AfterCaseLabel: true
14+
AfterUnion: true
15+
BeforeWhile: true
16+
# BreakBeforeBinaryOperators: All
17+
18+
ColumnLimit: 130
19+
PointerAlignment: Left
20+
UseTab: Always
21+
BreakConstructorInitializers: BeforeComma
22+
23+
InsertNewlineAtEOF: true
24+
IncludeBlocks: Regroup
25+
26+
IncludeCategories:
27+
- Regex: '^"(box2d\/)'
28+
Priority: 2
29+
- Regex: '^<.*'
30+
Priority: 3
31+
- Regex: '^".*'
32+
Priority: 1
33+
34+
IndentExternBlock: NoIndent
35+
IndentCaseLabels: true
36+
IndentPPDirectives: BeforeHash
37+
IndentAccessModifiers: false
38+
AccessModifierOffset: -4
39+
40+
# AlignArrayOfStructures: Left
41+
# AlignAfterOpenBracket: BlockIndent
42+
43+
SpacesInParens: Custom
44+
SpacesInParensOptions:
45+
Other: true
46+

.gitattributes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto
2+
3+
*.c text
4+
*.cpp text
5+
*.h text
6+
*.md text
7+
*.txt text
8+
*.sh text eol=lf
9+
10+
*.ttf binary

.github/FUNDING.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# These are supported funding model platforms
22

3-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
3+
github: [erincatto]
4+
patreon: Box2D
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
@@ -10,5 +10,3 @@ liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
1212
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13-
14-
github: [erincatto]

.github/issue_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Make sure these boxes are checked before submitting your issue - thank you!
22

3-
- [ ] Ask for help on [discord](https://discord.gg/NKYgCBP) and/or [reddit](https://www.reddit.com/r/box2d)
3+
- [ ] Ask for help on [discord](https://discord.gg/NKYgCBP)
44
- [ ] Consider providing a dump file using b2World::Dump

.github/pull_request_template.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Pull requests for core Box2D code are generally not accepted. Please consider filing an issue instead.
22

3-
However, pull requests for build system improvements are often accepted.

.github/workflows/build.yml

+40-29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CMake
1+
name: CI Build
22

33
on:
44
push:
@@ -7,72 +7,83 @@ on:
77
branches: [ main ]
88

99
env:
10-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11-
BUILD_TYPE: Release
10+
BUILD_TYPE: Debug
1211

1312
jobs:
14-
build-ubuntu:
15-
name: ubuntu
16-
17-
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18-
# You can convert this to a matrix build if you need cross-platform coverage.
19-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
13+
build-ubuntu-gcc:
14+
name: ubuntu-gcc
2015
runs-on: ubuntu-latest
21-
16+
timeout-minutes: 4
2217
steps:
23-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
19+
20+
- name: Configure CMake
21+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF
2422

25-
- name: Install dependencies
26-
run: |
27-
sudo apt update
28-
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
23+
- name: Build
24+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
2925

26+
- name: Test
27+
working-directory: ${{github.workspace}}/build
28+
run: ./bin/test
29+
30+
build-ubuntu-clang:
31+
name: ubuntu-clang
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
3037
- name: Configure CMake
31-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
32-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
33-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
38+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF
3439

3540
- name: Build
36-
# Build your program with the given configuration
3741
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
3842

3943
- name: Test
4044
working-directory: ${{github.workspace}}/build
41-
# Execute tests defined by the CMake configuration.
42-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
43-
run: ./bin/unit_test
45+
run: ./bin/test
4446

4547
build-macos:
4648
name: macos
4749
runs-on: macos-latest
4850

4951
steps:
50-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v4
5153

5254
- name: Configure CMake
53-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
55+
# some problem with simde
56+
# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBOX2D_SANITIZE=ON -DBUILD_SHARED_LIBS=OFF
57+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF
5458

5559
- name: Build
5660
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
5761

5862
- name: Test
5963
working-directory: ${{github.workspace}}/build
60-
run: ./bin/unit_test
64+
run: ./bin/test
6165

6266
build-windows:
6367
name: windows
6468
runs-on: windows-latest
65-
6669
steps:
67-
- uses: actions/checkout@v2
70+
71+
- uses: actions/checkout@v4
72+
73+
- name: Setup MSVC dev command prompt
74+
uses: TheMrMilchmann/setup-msvc-dev@v3
75+
with:
76+
arch: x64
6877

6978
- name: Configure CMake
70-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
79+
# enkiTS is failing ASAN on windows
80+
# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBOX2D_SANITIZE=ON -DBUILD_SHARED_LIBS=OFF
81+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBUILD_SHARED_LIBS=OFF
7182

7283
- name: Build
7384
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
7485

7586
- name: Test
7687
working-directory: ${{github.workspace}}/build
77-
run: ./bin/${{env.BUILD_TYPE}}/unit_test
88+
run: ./bin/${{env.BUILD_TYPE}}/test
7889

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ build/
22
imgui.ini
33
settings.ini
44
.vscode/
5-
CMakeSettings.json
6-
out/
75
.vs/
6+
.cap
7+
.DS_Store
8+
CMakeUserPresets.json
9+
.cache/

CHANGELOG.md

-60
This file was deleted.

0 commit comments

Comments
 (0)