Advertisement

Beginning Bullet SDK Collision

Started by December 26, 2014 05:47 PM
9 comments, last by Cacks 10 years, 1 month ago

Hi Guys,

after my last post I decided to go with Bullet SDK for my Collision detection.

My game is set in an arena. how would I go about creating the bounding volumes for the walls in Bullet SDK?

Any pointers on starting Bullet SDK, any pitfalls?

cheers

Reject the basic asumption of civialisation especially the importance of material possessions

The best way to start is by looking at their documentation. The link text is small on their main page but here is the link. You should start with the tutorials.

I have used Bullet before, chose it because it completely separates the notion of physics shapes with graphics (I didn't really like decoupling the DrawStuff code with Open Dynamics Engine). Most of the collision shapes as used in the engine are put inside Rigid Bodies. So you can use planes or boxes for your walls, and have them set to zero mass if they are immovable.

As it has no notion of graphics, you need to pass along the location of your objects in the physics engine to set their locations for your graphics rendering code.

New game in progress: Project SeedWorld

My development blog: Electronic Meteor

Advertisement

http://www.gamedev.net/topic/641213-bullet-cameraobject-positions/

Hi CC Ricers,

I'm reading Game Coding Complete;

For 1 game character do I have 3 classes? Geometry object, game object, Bullet SDK shape object?

or have I gotten it wrong?

cheers

Reject the basic asumption of civialisation especially the importance of material possessions

I've read in the past about Bullet. This is a quick review of what I've read (don't know if applies to the present):

CollisionObject is an instance of a CollisionShape;

RigidBody inherits from CollisionObject and have mass and particle properties such position, velocity, gravity, etc.;

CollisionWorld (I don't know if this is its real name) is where the pool of collision objects lives;

You also have to setup broad phase, narrow phase, the dynamics world, etc. Really, just google around, you'll find lots of examples. Bullet docs are okayish for the most part, you can always check their repo on GitHub for specific methods and such.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Advertisement

Seems as though Game objects & their collision hulls are separate

Update the physics engine hulls

Game objects movement reported back via events

Reject the basic asumption of civialisation especially the importance of material possessions

Somewhere in the Bullet examples is a program that runs in a command prompt, creates a floor and a box, then runs the simulation 100 times, outputting the position of the box each time to the console. Its an excellent bare-bones example of setting up Bullet, adding some bodies and stepping the simulation.

I started figuring Bullet out by making sure I could build and run this example, then moving these basic operations into my real project. If you already have rendering working in your real project, the only thing you should need to figure out to bridge that gap is getting a world matrix for each object from Bullet and applying it to your rendered objects.

Hi Aardvajk,

I've been reading up on Bullet, but don't understand what bullet does once there is a collision.

Does Bullet provide it's own collision response or do I have to do this?

Also, I would like to modify the Center of Mass of my cylinders, can I do this with Bullet?

Another Question: does bullet use column or row major matrices?

cheers for any help

Reject the basic asumption of civialisation especially the importance of material possessions

Does Bullet provide it's own collision response or do I have to do this?



Bullet does the collision response as well. You just add things to the world, step the simulation then grab back the new positions.

Also, I would like to modify the Center of Mass of my cylinders, can I do this with Bullet?



Can't help on that one, not sure. The documentation would be the best place to start I guess.

Another Question: does bullet use column or row major matrices?



IIRC Bullet's native matrices are in whatever OpenGL uses. I was using Direct3D but literally just Googled for "Bullet matrix D3D9" and there was loads of sample code for how to convert.

This topic is closed to new replies.

Advertisement