[NOOB] Bullet Slows Down in Air [HELP]

arkos

19-11-2006 18:19:06

Hey guys,

When I shoot a bullet in my game it is supposed to travel forever at the same velocity. The problem is that it travels for a while and then slows down to a stop. Here is my code:


body->setCustomForceAndTorqueCallback(&bulletCallback);

void bulletCallback(OgreNewt::Body *body)
{

}


Basically I define a custom force callback with nothing in it. This makes it so gravity does not affect the bullet (which is what I want in my game) but unfortunately the bullet still slows down for some reason. I only want the bullet to be affected by collisions with other objects. Any suggestions?

OvermindDL1

20-11-2006 00:30:31

You need to set all damping on it to zero.

arkos

20-11-2006 05:32:10

Thanks so much for your response. That should help out a lot.

I'm not at my dev PC right now. How do I set the dampening? Do I have to do that in the force callback or do I write something like body->setDampening() when I create the body? Thanks again. :D

OvermindDL1

20-11-2006 18:04:30

It is an actual call on the body, there are two types, linear damping, and rotation (not sure if that is the used term) damping, the rotation one slows down rotating bodies over time, so you may not care about setting it, the linear damping slows translation over time, ergo, set it to zero.