Custom Game Engine Bullet Integration

pietrko
Posts: 1
Joined: Wed Jul 16, 2014 1:15 pm

Custom Game Engine Bullet Integration

Post by pietrko »

Hi,
I attempt to integrate bullet into custom game engine.
One of the obstacles that lay on my path is the unusual implementation of collision & physics in game, let me explain:
Currently the game engine doesn't have a physics loop with fixed step that performs calculation for all of game objects.
Instead we have some sort of action-reaction mechanics that dispatches the "update operation" to objects that were moved or hit. The collisions are predicted and all bodies are assumed to move with constant velocity between "updated operations".
On the top of that there is a AI and player input handling code that provides the initial "stimulus" for the physics engine.

Currently the team is debating if it is worth to retain this system or maybe it would be better to change it to more usual "fixed step global iteration physics engine" (this is of course my term for that sorry for mistakes).
But if there is a simple way to integrate bullet into the kind of system I've described we would be more than interested to hear how.

However it would save us a lot of work if integration with current mechanics would be possible.

So my I was thinking about simply using the btCollisionWorld adding all moveable objects into it and
replacing our movement predictions code with convexSweepTest() calls. Update of positions of object would be handled by game engine.

Since I'm total noob when it comes to bullet this simple idea leads to some problems:
  1. 1.How and when I should fire the broadphase calculation - it would be a waste to call it after any convexSweepTest() (which would be called for all moving objects).
  2. Is there a way to directly call function that performs broadphase detection (and only broadphase detection)?
    In docs regarding convexSweepTest() there is an advice to do it (obviously) - but how to do it( and just that).
  3. Let's assume that I'm using btDbvtBroadphase am I able to decide (when calling for update of the volume hierarchy) which objects should be taken into consideration when calculating possibly interlaping pairs?
  4. Let us assume that we have updated positons of all objects at time "t".
    What is the most efficient way to check for chosen convex object if it will have collision in time interval [t, t + Dt] assuming constant speed? Is it convexSweepTest?

Thank you in advance.

Regards,
Peter