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

tbogdala/cubez

master
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?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
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.

Examples

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

ballistic

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

cubedrop

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.

Dependencies

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.

Installation

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 github.com/go-gl/gl/v3.3-core/gl
go get github.com/go-gl/mathgl/mgl32
go get github.com/go-gl/glfw/v3.1/glfw

The library itself can be installed with the following command:

go get github.com/tbogdala/cubez

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

 cd $GOPATH/src/github.com/tbogdala/cubez/examples
./build.sh

Documentation

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

Roadmap

  • 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

License

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

Release History

No tagged releases yet.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages