AHelper2
21-10-2010 23:22:28
Well... I have a newton body created with a default box collision shape. I set the inertia, etc. correctly. I didn't add the default collision callback.
The fun part is... the scenenode flies around on it's own. I have a small dump done with:
When running this, the node flies upwards and there is no forces applied. This will continue for a long time until it stops at about 21 units upwards. When I do use setDefaultForceCallback(), it stops after a while, but the motion is the same. This is the output from the dump (no callback):
The last entry is when it stops, but it did not come to a gradual stop (it stopped abruptly). Has anyone seen this? Could it be my inertia? My time for the world->update(...) being wrong? An AABB problem?
Any help is welcome
The fun part is... the scenenode flies around on it's own. I have a small dump done with:
// msg_printDebug prints a colored string to cout
// the scenenode is, of course, in this->bData.node
// This is executed every time after world->update(...) (which works)
msg_printDebug(string("Pos: ").append(Ogre::StringConverter::toString(this->bData.node->getPosition())));
When running this, the node flies upwards and there is no forces applied. This will continue for a long time until it stops at about 21 units upwards. When I do use setDefaultForceCallback(), it stops after a while, but the motion is the same. This is the output from the dump (no callback):
?? Pos: 0 0 0
?? Pos: 0 0 0
?? Pos: -1.61049e-08 0.084018 4.0093e-08
?? Pos: 8.08348e-07 0.168336 -2.04678e-06
?? Pos: 2.77011e-06 0.252639 -7.01065e-06
?? Pos: 5.2929e-06 0.338915 -1.33928e-05
?? Pos: 6.76003e-06 0.423492 -1.71011e-05
?? Pos: 7.23045e-06 0.508533 -1.82847e-05
?? Pos: 6.70538e-06 0.593065 -1.69468e-05
?? Pos: 5.19401e-06 0.677586 -1.31107e-05
?? Pos: 2.70013e-06 0.762113 -6.78591e-06
?? Pos: -7.73289e-07 0.846664 2.02003e-06
?? Pos: -5.22364e-06 0.931249 1.33005e-05
?? Pos: -1.06453e-05 1.01583 2.70412e-05
?? Pos: -1.70474e-05 1.10056 4.32656e-05
?? Pos: -2.4406e-05 1.18519 6.19124e-05
?? Pos: -3.27016e-05 1.26958 8.29327e-05
?? Pos: -4.19884e-05 1.35432 0.000106464
?? Pos: -5.22125e-05 1.43891 0.000132369
?? Pos: -5.97988e-05 1.5239 0.00015159
?? Pos: -6.01061e-05 1.60847 0.000152369
?? Pos: -6.13946e-05 1.6932 0.000155634
?? Pos: -5.84807e-05 1.77761 0.000148251
?? Pos: -5.84022e-05 1.86325 0.000148052
?? Pos: -5.48709e-05 1.94817 0.000139104
?? Pos: -5.77098e-05 2.03295 0.000146297
?? Pos: -5.34741e-05 2.11744 0.000135565
?? Pos: -5.27588e-05 2.20219 0.000133752
?? Pos: -5.2101e-05 2.287 0.000132086
?? Pos: -5.04982e-05 2.37161 0.000128024
?? Pos: -4.92238e-05 2.45606 0.000124795
?? Pos: -5.04633e-05 2.54085 0.000127936
?? Pos: -4.95557e-05 2.62563 0.000125636
?? Pos: -4.99008e-05 2.71012 0.000126511
?? Pos: -4.99373e-05 2.79435 0.000126603
?? Pos: -4.97667e-05 2.88152 0.000126171
?? Pos: -4.96023e-05 2.96549 0.000125754
?? Pos: -4.94366e-05 3.05016 0.000125334
?? Pos: -4.92741e-05 3.13322 0.000124923
?? Pos: -4.91121e-05 3.21597 0.000124512
?? Pos: -4.89506e-05 3.2985 0.000124103
?? Pos: -4.87894e-05 3.38085 0.000123695
?? Pos: -4.86298e-05 3.46237 0.00012329
?? Pos: -4.84709e-05 3.54357 0.000122888
?? Pos: -4.83122e-05 3.62466 0.000122486
?? Pos: -4.81545e-05 3.70526 0.000122086
...
?? Pos: -1.31577e-05 21.5865 3.34178e-05
The last entry is when it stops, but it did not come to a gradual stop (it stopped abruptly). Has anyone seen this? Could it be my inertia? My time for the world->update(...) being wrong? An AABB problem?
Any help is welcome