Hi guys,
I'm facing a problem with rotation. Currently I am using Irrlicht 1.8 + Bullet for Solar System Simulator.
Here is the video with problem:
http://www.youtube.com/watch?v=yDm8MLGfKVM.
http://pastebin.com/iJ3TcZdV
Essential part is here (I'm changing it in video).
planetBTBody->applyTorqueImpulse(btVector3(0, mass * 300, 0));
The rotation stops after a while. If the value is "low", like 300, the Sun and large planets doesn't even start to rotate.
If I set it to let's say 3000, than the Sun rotates few seconds and stops after that, while large planets continues to rotate.
I tried also:
planetBTBody->setAngularVelocity(btVector3(0, 30.f / radius, 0));
It's all the same - rotating for a few seconds and that's all.
To mention, sizes and masses are propotional to real.
Could anyone please help me?
And also, what can I do to make camera movement more smooth (when strafing and rotating camera simultaneously)?
Thank you!
Rotation issues.
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: Rotation issues.
Looks like you are applying everything at creation. Bullet using sequential impulse solver does introduce errors that can stop spinning objects, so you can either try to use BT_ENABLE_GYROPSCOPIC_FORCE (probably should issue an issue to get rid of the P) or perhaps a direct solver (though not sure if that would work entirely). You could also set the velocity at every simulation update, or foregoing physics at all and just rotating your texture (not if you need the rotation physics for something)