Modeling Bullets in Bullet

scarypajamas
Posts: 3
Joined: Thu Mar 17, 2011 5:16 am

Modeling Bullets in Bullet

Post by scarypajamas »

The current game I'm working on involves a shooting mechanic (think FPS). I'd like to get it so the bullets from your gun are physics objects rather than raycasts like in most games. The reason for this is so hitting your target will involve more skill.

I'm wondering, what is the best way to achieve this?

Firstly, would it be more efficient to make my bullets a btSphereShape, btBoxShape, or something else?

Secondly, does bullet manage its own memory? For instance, when I create a btSphereShape using the code below, is the "new" operator actually requesting more memory from the OS or is bullet using a memory pool it has created.

Code: Select all

btCollisionShape* shape = new btSphereShape((btScalar(2.1)));
The reason I ask is because I'm afraid that all these requests for memory will kill performance if there's not a memory pool being used. I want to know so if bullet isn't using a pool, I can create one myself.