11

I have a space simulation, so obviously I don't want gravity or air resistance. Gravity was straight forward to turn off, but I can't find the equivalent for air resistance. I presume it's going to be on a body-by-body basis rather than a world wide setting like gravity.

Indeed I see on btSoftBody that there are values for medium density like air_density but I am using btRigidBody.

weston
  • 54,145
  • 21
  • 145
  • 203
  • What are you speaking about ? What software are you using ? – Offirmo Oct 16 '12 at 21:42
  • @Offirmo Bullet physics library, see tag – weston Oct 16 '12 at 22:33
  • 1
    Does Bullet even model air resistance for rigid bodies? I don't think it does, though I might be wrong. – Bart Oct 20 '12 at 09:15
  • @Bart Oh, well somehow my objects in space appear to slow down and stop, rather than carry on at the same speed unimpeeded. But maybe that's an illusion, I will check the velocities. – weston Oct 20 '12 at 09:48

1 Answers1

15

There is no air resistance in bullet physics but there is damping

For every body you create you should set damping calling

body->setDamping(linear, angular);

set linear to be 0

Max
  • 6,286
  • 5
  • 44
  • 86
  • Not tried it yet, but checks out in the documentation, thanks! – weston Oct 23 '12 at 22:39
  • What are the effect of changing default values of `m_linearSleepingThreshold` and `m_angularSleepingThreshold`? – Rasoul Aug 11 '13 at 14:28
  • To stop the sleeping effect, I had to additionally add the following: `body->setSleepingThresholds(btScalar(0), btScalar(0));` – Josh Desmond Apr 04 '19 at 16:07