Giter Club home page Giter Club logo

bulletcapi's Introduction

Depricated not suggested for use

Unfortunately over the years I have found the bullet API to be quite fragile often new versions of bullet have caused breaking changes. Contrast this with the much more straight forward and more importantly stable API of OpenDE for example...

Why?

I wanted to use bullet physics from C (not a C++ fan)

But doesn't bullet already have a C API?

Yes but alas its tightly enmeshed with the rest of the example code, like the exampleBrowser, I want to just use the core code of bullet I need and also provide my own graphics routines.

So whats the point again?

The primary goal of this C API is to provide the core functionallity of bullet without weighing it down with unrelated graphics or other utility code

Instructions

start off in the capi sub directory

compiling this project will provide you with a textual demonstration and also a static library of the parts bullet the C API is currently using. In addition this is where the C header lives (capi.h) In order for the makefile to work you will have to locate where you have extracted the bullet sdk. Look inside bullet.mk

# root of bullet source code
BULL=../../bullet3/src/

adjust this path to point to the source directory of bullet, this part of the build system is possibly less than optimal but it does ensure complete independence from the bullet build system.

Once you have verified that the CAPI example works you can move onto the simple graphical example.

alternativly if you are not bothered about playing with the console test you can just do

make lib/libbullet.a

in addition to libbullet.a you will need capi.o (compiled from capi.cpp)

gluTest

This is a horror, no truly, its NOT an example of how you should produce graphics. That said its a minimum amount of code that can show some kind of 3d graphics, without there being the confusion of a mini graphics engine, with model loaders, shaders and lots of other things that could enmesh it into a very specific use case... This example does show using some basic modifications to a body such as changing basic properties like friction and restitution to make a pleasing demonstration

external to this folder gluTest links in libbullet.a and compiles capi.cpp and links that to main.o the C frontend of this example.

GL3v3

while a better (though probably not ideal) example of producing 3d graphics this does add a bunch of extra clutter (theres way more OpenGL and support stuff than actual bullet use!) This example is where new features are introduced you will need to adjust the makefile for its dependancy (https://github.com/Kazade/kazmath) if you clone it to a location alongside bulletCapi you should be good to go

cppHello

This is a simple cpp reference example, building this with libraries compiled by bullets own build system lead to difficult to diagnose memory corruption (hence I decided to implement bullet.mk...) it was initially used to provide a reference design that I used to begin writing capi.cpp and capi.hpp which constitutes the C++ layer between the C front end and the C++ backend This will be removed before long as the "wrapper" is already more fully featured that this example.

The API

please see the doxygen docs

Conclusion

This is very early days, there is lots to do, any contributions especially examples most apreciated, if an example needs some missing functionallity please do post an issue.

bulletcapi's People

Contributors

chriscamacho 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bulletcapi's Issues

Build fails with undefined reference

When running Make in the capi folder I get this error:

g++ obj/test.o capi.a lib/libbullet.a -o test
/usr/bin/ld: lib/libbullet.a(btCollisionWorld.o): in function `btCollisionWorld::rayTestSingleInternal(btTransform const&, btTransform const&, btCollisionObjectWrapper const*, btCollisionWorld::RayResultCallback&)':
btCollisionWorld.cpp:(.text+0x42d3): undefined reference to `btHeightfieldTerrainShape::performRaycast(btTriangleCallback*, btVector3 const&, btVector3 const&) const'
collect2: error: ld returned 1 exit status
make: *** [Makefile:15: test] Error 1

I'm pretty sure it's a breaking change in Bullet but when I try to build an older version (3.17) CMake spits out loads of errors :(

Thanks!

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.