Default "air resistance"??

bjtp

19-04-2009 20:44:11

I did some testing with OgreNewt, struggled with the resistance parameter with multiple materials, until I found out: Even with no forces, other interactions, not even StandardForceCallback (aka gravity), an object does not move infinitely, it stops after a short amount of time and travelled space.

I reproduced this by manipulating the Demo03_CollisionCallbacks, by removing StandardForceCallback.

Do I miss something fundamental here, or is there a secret force that stops my objects from "floating"?

Btw.: It doesn't stop "hard" like it would if it ran into the "edge" of the world. It just slows down continually and freezes.

melven

19-04-2009 21:34:44

If there's no buoyancy there should be no kind of air resistance...
But there's a world bounding box (have you set a bigger world size for you experiments?)... when a body reaches the end of the world bounding box, it'll slow down and freeze, perhaps this is what you've observed.

bjtp

19-04-2009 23:38:45

Now that _is_ strange. I enlarged the worlds bounding box extremely, no change (even before, the objects stoped long before they reached the border). As I put an initial impulse/velocity on an object, it "floats" (gravity turned off), but gradually slows down and stops, just as _if_ there was some resistance. I checked with "debug call-back" methods: no interaction between materials.

Well, ok, I'll add some debugging to the Demo ...

bjtp

20-04-2009 00:20:12

Okay, to illustrate the problem: I use the Demo03_CollisionCallbacks from the "stable release RAR"-file, only slightly patched to compile on linux (Ogre 1.6.2, Newton 1.5.3):

I changed these lines in the OgreNewtonFrameListener.cpp, frameStarted:


> body->setVelocity (Ogre::Vector3 (0.5, 0.0, 0.0));
< body->setStandardForceCallback();
body->setPositionOrientation( Ogre::Vector3(-5,8,0), Ogre::Quaternion::IDENTITY );

< timer = 1.5;
> timer = 30.0;


By that, each random new block doesn't drop down, but floats sideways. Without any force applied, it should continue until it reaches the "end of the world". (I increased the timer to 30, so each block can float without contact).

The result looks like this on my system: http://www.youtube.com/watch?v=fKcbC-6ikkU

melven

20-04-2009 08:52:49

Ahh I tried it by myself and you are naturally right... I didn't think of it, but newton applies usually a slight linear damping (for smoothing things, slow bodies not moving endlessly, it can also improve performance with many bodies I think, because newton can send them to "sleep" more easily).
You can set the damping factor to zero:

body->setLinearDamping(0)

This will solve the problem, but for a larger project you should do a kind of damping for slow bodies by yourself then (this is what julio suggests in the newton forum)...

bjtp

20-04-2009 09:25:49

I knew it would be something like that I just missed.

Danke sehr!