Skip to content

Commit ca27b77

Browse files
committed
Merge remote-tracking branch 'origin/master' into Replace_Proxy_With_Int
# Conflicts: # src/box2dx/Box2D.NetStandard/Collision/BroadPhase.cs # src/box2dx/Box2D.NetStandard/Dynamics/Contacts/ContactSolver.cs
2 parents eedac1d + d330e76 commit ca27b77

File tree

125 files changed

+12370
-12050
lines changed

Some content is hidden

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

125 files changed

+12370
-12050
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Bug Report'
2+
description: Report a bug in Box2D .NET Standard
3+
labels: ["bug"]
4+
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: Description
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: reproduce
14+
attributes:
15+
label: How To Reproduce
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: expected
20+
attributes:
21+
label: Expected Behavior
22+
validations:
23+
required: true
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Docs Report'
2+
description: Report an issue in Box2D .NET Standard's documentation
3+
labels: ["documentation"]
4+
5+
body:
6+
- type: textarea
7+
id: description
8+
attributes:
9+
label: Description
10+
validations:
11+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- Thank you!
2+
Please read the contributing guidelines: https://github.com/benukhanov/box2d-netstandard/blob/v2.4/CONTRIBUTING.md
3+
-->
4+
5+
Fixes # (issue)

.github/workflows/unit-tests.yml renamed to .github/workflows/box2d-build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit Tests
1+
name: Box2D Build & Unit Tests
22

33
on:
44
push:
@@ -19,6 +19,8 @@ jobs:
1919
- name: Setup .NET Core
2020
uses: actions/setup-dotnet@v1
2121
with:
22-
dotnet-version: "3.1.x"
23-
- name: Execute Tests
22+
dotnet-version: "5.0.x"
23+
- name: Build
24+
run: dotnet build src/ -c Release
25+
- name: Unit Tests
2426
run: dotnet test src/ -c Release
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Build
1+
name: Box2D Examples Build
22

33
on:
44
push:
55
branches: [v2.4]
66
paths:
7-
- src/box2dx/Box2D.NetStandard/**
7+
- examples/**
8+
pull_request:
9+
branches: [v2.4]
10+
paths:
11+
- examples/**
812

913
jobs:
1014
build:
@@ -16,5 +20,5 @@ jobs:
1620
uses: actions/setup-dotnet@v1
1721
with:
1822
dotnet-version: "5.0.x"
19-
- name: Box2D Build
20-
run: dotnet build src/box2dx/Box2D.NetStandard -c Release
23+
- name: Build
24+
run: dotnet build examples/ -c Release

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
GitHub.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available
119+
[here](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ
127+
[here](https://www.contributor-covenant.org/faq). Translations are available
128+
[here](https://www.contributor-covenant.org/translations).

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to Box2D .NET Standard
2+
3+
No new features will be developed. Bug reports and any other improvements are welcome.
4+
5+
## Table of Contents
6+
7+
- [Code of Conduct](#coc)
8+
- [Bug Report](#bug)
9+
- [Submission Guidelines](#submit-pr)
10+
11+
## <a name="coc"></a> Code of Conduct
12+
13+
Please read the [Code of Conduct](https://github.com/benukhanov/box2d-netstandard/blob/v2.4/CODE_OF_CONDUCT.md).
14+
15+
## <a name="bug"></a> Bug Report
16+
17+
Please open an [issue](https://github.com/benukhanov/box2d-netstandard/issues/new/choose) with details.
18+
19+
## <a name="submit-pr"></a> Submission Guidelines
20+
21+
1. [Fork](https://github.com/benukhanov/box2d-netstandard/fork) the repository.
22+
2. Clone the forked repository and then create a new branch.
23+
3. Commit your changes.
24+
4. Push your new branch.
25+
5. Send a pull request to `v2.4` or `v1.0` branch.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
![Box2D Logo](https://box2d.org/images/logo.svg)
22

33
# Box2D .NET Standard
4-
[![Build](https://github.com/benukhanov/box2d-netstandard/actions/workflows/build.yml/badge.svg)](https://github.com/benukhanov/box2d-netstandard/actions/workflows/build.yml)
5-
[![Unit Tests](https://github.com/benukhanov/box2d-netstandard/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/benukhanov/box2d-netstandard/actions/workflows/unit-tests.yml)
4+
[![Build](https://github.com/benukhanov/box2d-netstandard/actions/workflows/box2d-build.yml/badge.svg)](https://github.com/benukhanov/box2d-netstandard/actions/workflows/box2d-build.yml)
5+
[![Box2D Examples Build](https://github.com/benukhanov/box2d-netstandard/actions/workflows/box2d-examples-build.yml/badge.svg)](https://github.com/benukhanov/box2d-netstandard/actions/workflows/box2d-examples-build.yml)
66

77
Box2D .NET Standard is the port of Box2D from C++ to C# by Ben Ukhanov & Hugh Phoenix-Hulme 2020.
88

@@ -25,6 +25,7 @@ In v1.0.x:
2525

2626
In v2.4.x:
2727
- Code Optimisation must be enabled for things to work properly, and you **must not** have a debugger attached.
28+
- If you create two Bodies at the same Position, *Bad Things* will happen. It might crash, or it might just poison the DynamicTree. This could be fixed by checking *every* contact to make sure the objects are never in the exact same position, but this should never happen once the simulation is running, so the number of times the check would be useful is statistically insignificant. Just don't put things at the same place as other things. They only need to be different by float.Epsilon in either dimension.
2829

2930
## Source
3031

@@ -56,10 +57,7 @@ In v2.4.x:
5657

5758
## Contributing
5859

59-
Anyone who wants to contribute to this repository:
60-
- The changes will be in the new branch (feature/new or feature/bug-fix).
61-
- The new pull request will be started.
62-
- The new version will be published.
60+
Please read and follow the [contributing guidelines](CONTRIBUTING.md).
6361

6462
## Features
6563

@@ -90,7 +88,7 @@ Anyone who wants to contribute to this repository:
9088
### System
9189

9290
- Centralized tuning parameters.
93-
- Pure .NET Standard 2.0+ library.
91+
- Pure .NET Standard 2.1+ library.[^1]
9492
- Please [See .NET Implementation Support](https://docs.microsoft.com/en-us/dotnet/standard/net-standard).
9593

9694
## Documentation
@@ -102,3 +100,5 @@ Anyone who wants to contribute to this repository:
102100
## License
103101

104102
Original C++ Box2D is developed by Erin Catto, under the [MIT license](https://en.wikipedia.org/wiki/MIT_License).
103+
104+
[^1] .net standard 2.0 lacks System.MathF which is a dependency. System.Numerics.Vectors is not part of .net standard 2.0, but it is available as a Nuget package. There is a discussion [here](https://github.com/dotnet/runtime/issues/20113) about including System.MathF in System.Runtime.Extensions but it was decided not to do so. We also use stackalloc, Span<T>, System.HashCode, Math.Clamp and range expressions, which are not supported in .net standard 2.0.

examples/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Box2D Examples
2+
3+
Box2D Examples in a simulation window. Use different worlds [here](https://github.com/benukhanov/box2d-netstandard/blob/v2.4/examples/Box2D.WindowTests/Program.cs#L29).
4+
5+
## Dependencies
6+
7+
- [OpenTK.NetStandard](https://www.nuget.org/packages/OpenTK.NetStandard/)
8+
- [Box2D.NetStandard](https://www.nuget.org/packages/Box2D.NetStandard)

src/box2dx/Box2D.NetStandard.UnitTests/AddPairTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Box2D.NetStandard.UnitTests
88
public class AddPairTest
99
{
1010
[Fact]
11-
public void AddPairs()
11+
public void Test()
1212
{
1313
for (int j = 0; j < 1; j++)
1414
{

0 commit comments

Comments
 (0)