Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Cubez v0.1.0

Cubez is a 3d physics library written in the Go programming language. It is mostly a port of cyclone-physics by Ian Millington and using his book "Game Physics Engine Design" as a reference.

Current Features

  • Full 3d rigid body real-time physics simulation suitable for games; meaning both linear velocity as well as angular velocity are calculated.
  • Collision detection between collider primitives.
  • Primitives supported: planes, spheres, cubes.
  • Math library defaults to 64-bit floats but can easily be tuned down to 32-bit.


Ballistic: shoot spheres at a cube by pressing the space bar.


Cubedrop: hit the space bar to drop some cubes onto the ground


OS Support

Cubez is known to work on the following:

  • Windows 7 x64 with mingw-w64 (see this tutorial if necessary)
  • Linux (Ubuntu 14.04)

At present, I suspect it should work on any Windows or Linux 64-bit system for which there is an acceptable Go x64 and gcc x64 compiler set available.

Support for 32-bit systems is untested.


The only dependency on the core cubez package is the math package included in cubez.

For the examples, you will need GLFW 3.1.x installed on your system, and you will need to install the go-gl project's gl, glfw and mathgl libraries. Your system will also need to be OpenGL 3.3 capable.

The examples use a basic OpenGL framework-in-a-file inspired by my graphics engine called fizzle. This way the full fizzle library is not a dependency.


If you don't have the dependencies for the examples and wish to install them, you can do so with the following commands:

go get
go get
go get

The library itself can be installed with the following command:

go get

To build the examples, run the following in a shell:

 cd $GOPATH/src/


Currently, you'll have to use godoc to read the API documentation and check out the examples to figure out how to use the library.

Known Limitations

  • slim down the public interface to the library to only export what's needed
  • introduce a way to set the restitution and friction for contacts


  • more benchmarks
  • unit tests for collisions
  • more collision primitives
  • include some coarse collision detection to ease the O(n^2) pain with resolving contacts in one big slice


Cubez is released under the BSD license. See the LICENSE file for more details.

Release History

No tagged releases yet.


Cubez is a 3d physics engine written natively in Go.







No packages published