Giter Club home page Giter Club logo

cubez's Introduction

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.

cubez's People

Contributors

tbogdala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cubez's Issues

some questions

  1. why in cubez you use type Real float64, instead just float64?
  2. your engine fizzle use mgl32.Vec3 for vectors, and cubez .../cubez/math.Vector3 - what is the reason? it is possible to standardize?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.