You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Net Gusto 05f3eabc37
Merge pull request #16 from maxfish/fix_circles_collision
1 year ago
.gitignore First commit 2 years ago
.travis.yml test: remove test against Go master 2 years ago
CollisionB2BroadPhase.go First commit 2 years ago
CollisionB2CollideCircle.go First commit 2 years ago
CollisionB2CollideEdge.go First commit 2 years ago
CollisionB2CollidePolygon.go First commit 2 years ago
CollisionB2Collision.go First commit 2 years ago
CollisionB2Distance.go First commit 2 years ago
CollisionB2DynamicTree.go First commit 2 years ago
CollisionB2Shape.go First commit 2 years ago
CollisionB2ShapeChain.go First commit 2 years ago
CollisionB2ShapeCircle.go First commit 2 years ago
CollisionB2ShapeEdge.go First commit 2 years ago
CollisionB2ShapePolygon.go First commit 2 years ago
CollisionB2TimeOfImpact.go First commit 2 years ago
CommonB2GrowableStack.go First commit 2 years ago
CommonB2Math.go Replace wrong variable in Solve 1 year ago
CommonB2Settings.go First commit 2 years ago
CommonB2Timer.go First commit 2 years ago
CommonUtils.go First commit 2 years ago
DynamicsB2Body.go First commit 2 years ago
DynamicsB2Contact.go First commit 2 years ago
DynamicsB2ContactChainAndCircle.go First commit 2 years ago
DynamicsB2ContactChainAndPolygon.go First commit 2 years ago
DynamicsB2ContactCircle.go Fixes a typo that breaks circle collisions 1 year ago
DynamicsB2ContactEdgeAndCircle.go First commit 2 years ago
DynamicsB2ContactEdgeAndPolygon.go First commit 2 years ago
DynamicsB2ContactManager.go First commit 2 years ago
DynamicsB2ContactPolygon.go First commit 2 years ago
DynamicsB2ContactPolygonAndCircle.go First commit 2 years ago
DynamicsB2ContactSolver.go First commit 2 years ago
DynamicsB2Fixture.go First commit 2 years ago
DynamicsB2Island.go First commit 2 years ago
DynamicsB2Joint.go Fixing a few things to make jounts work 1 year ago
DynamicsB2JointDistance.go First commit 2 years ago
DynamicsB2JointFriction.go First commit 2 years ago
DynamicsB2JointGear.go First commit 2 years ago
DynamicsB2JointMotor.go Applying fix for issue 487 from box2d orig repo 1 year ago
DynamicsB2JointMouse.go First commit 2 years ago
DynamicsB2JointPrismatic.go Fixes a sign mistake on WarmStart 1 year ago
DynamicsB2JointPulley.go First commit 2 years ago
DynamicsB2JointRevolute.go First commit 2 years ago
DynamicsB2JointRope.go First commit 2 years ago
DynamicsB2JointWeld.go Fix wrong sign of the operation 1 year ago
DynamicsB2JointWheel.go First commit 2 years ago
DynamicsB2Rope.go First commit 2 years ago
DynamicsB2TimeStep.go First commit 2 years ago
DynamicsB2World.go Fixing a few things to make jounts work 1 year ago
DynamicsB2WorldCallbacks.go First commit 2 years ago
LICENSE.md First commit 2 years ago
README.md Update README.md 2 years ago
cpp_compliance_expected_test.go Make the command a more idiomatic Go test 2 years ago
cpp_compliance_test.go Fix import collision error in test file 2 years ago

README.md

Box2D.go

What is this ?

This is Go a port of Box2D (https://github.com/erincatto/Box2D), a 2D physics engine for games written in C++ by Erin Catto.

The port is complete and based on the latest Box2D commit as of 2017-09-20 (f655c603ba)

Who did this ?

The ByteArena team did. Erin Catto, the author of the original software, was not involved in the port.

https://s3.eu-central-1.amazonaws.com/bytearena-public/ba-prod-twitter.mp4

Documentation

We kept the source code as close to the C++ as we possibly could. So the documentation you’ll find on Box2D is relevant.

http://box2d.org/manual.pdf

API changes

The API had to change a tiny bit due to the fact that :

  • Go has no constructors as a language feature, thus code for constructors has been placed in Make$NAME_OF_TYPE functions
  • Go has no support for function overloading; some functions implemented multiple times for different sets of parameters under the same name in C++ are distinguished by name in the golang version; we tried to make names explicit so that should not be an issue
  • Go has no support for operator overloading; this C++ feature is used extensively throughout the C++ version of Box2D (mainly for the vector and matrix arithmethic), and has been converted to good old, albeit verbose function calls

Tests

No opengl testbed for the moment.

Our tests verify the output of position and rotation of bodies over time against those generared by the C++ reference.

Right now, there’s a test (passing) checking all the supported body shape collisions in cmd/test-character-collision.

Usage example

Have a look at cpp_compliance_test.go.

License of the original Box2D (C++)

The original Box2D is developed by Erin Catto, and has the zlib license. Thank you Erin for this incredible piece of software.

License of this port (Go)

Box2D.go is developed by ByteArena (https://github.com/bytearena), and has the zlib license. While the zlib license does not require acknowledgement, we encourage you to give credit to Box2D.go in your product.