Skip to content
Box2D.go - Go port of Box2D - a 2D Physics Engine for Games.
Branch: master
Clone or download
netgusto Merge pull request #16 from maxfish/fix_circles_collision
Fixes a typo that breaks circle collisions
Latest commit 05f3eab Aug 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore First commit Sep 20, 2017
.travis.yml test: remove test against Go master Sep 22, 2017
CollisionB2BroadPhase.go First commit Sep 20, 2017
CollisionB2CollideCircle.go First commit Sep 20, 2017
CollisionB2CollideEdge.go First commit Sep 20, 2017
CollisionB2CollidePolygon.go First commit Sep 20, 2017
CollisionB2Collision.go First commit Sep 20, 2017
CollisionB2Distance.go First commit Sep 20, 2017
CollisionB2DynamicTree.go First commit Sep 20, 2017
CollisionB2Shape.go First commit Sep 20, 2017
CollisionB2ShapeChain.go
CollisionB2ShapeCircle.go First commit Sep 20, 2017
CollisionB2ShapeEdge.go
CollisionB2ShapePolygon.go
CollisionB2TimeOfImpact.go First commit Sep 20, 2017
CommonB2GrowableStack.go First commit Sep 20, 2017
CommonB2Math.go Replace wrong variable in Solve Aug 18, 2018
CommonB2Settings.go First commit Sep 20, 2017
CommonB2Timer.go First commit Sep 20, 2017
CommonUtils.go First commit Sep 20, 2017
DynamicsB2Body.go
DynamicsB2Contact.go First commit Sep 20, 2017
DynamicsB2ContactChainAndCircle.go First commit Sep 20, 2017
DynamicsB2ContactChainAndPolygon.go
DynamicsB2ContactCircle.go Fixes a typo that breaks circle collisions Aug 24, 2018
DynamicsB2ContactEdgeAndCircle.go
DynamicsB2ContactEdgeAndPolygon.go
DynamicsB2ContactManager.go First commit Sep 20, 2017
DynamicsB2ContactPolygon.go
DynamicsB2ContactPolygonAndCircle.go
DynamicsB2ContactSolver.go First commit Sep 20, 2017
DynamicsB2Fixture.go First commit Sep 20, 2017
DynamicsB2Island.go First commit Sep 20, 2017
DynamicsB2Joint.go Fixing a few things to make jounts work Aug 19, 2018
DynamicsB2JointDistance.go
DynamicsB2JointFriction.go
DynamicsB2JointGear.go First commit Sep 20, 2017
DynamicsB2JointMotor.go Applying fix for issue 487 from box2d orig repo Aug 18, 2018
DynamicsB2JointMouse.go First commit Sep 20, 2017
DynamicsB2JointPrismatic.go Fixes a sign mistake on WarmStart Aug 18, 2018
DynamicsB2JointPulley.go First commit Sep 20, 2017
DynamicsB2JointRevolute.go
DynamicsB2JointRope.go First commit Sep 20, 2017
DynamicsB2JointWeld.go Fix wrong sign of the operation Aug 18, 2018
DynamicsB2JointWheel.go First commit Sep 20, 2017
DynamicsB2Rope.go First commit Sep 20, 2017
DynamicsB2TimeStep.go
DynamicsB2World.go Fixing a few things to make jounts work Aug 19, 2018
DynamicsB2WorldCallbacks.go
LICENSE.md
README.md Update README.md Sep 22, 2017
cpp_compliance_expected_test.go Make the command a more idiomatic Go test Sep 21, 2017
cpp_compliance_test.go Fix import collision error in test file Oct 20, 2017

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 (https://github.com/erincatto/Box2D/commit/f655c603ba9d83f07fc566d38d2654ba35739102)

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.

You can’t perform that action at this time.