ylliac
03-12-2008 09:40:34
Hello,
I have a little problem in my current project which is a boat race simulation.
I have a character : the boat.
I have a static body : any other element of the world.
Initially, the boat is oriented along the Z-axis.
When I approach an object with the boat oriented along the Z-axis, the boat stop when he hit the object. All is normal, no problem as you can see on the following image :
http://www.hiboox.fr/go/images/divers/capt2,b8f335e9193612e54da6f186d5d18da7.png.html
But when I approach the boat along the X-axis, it react like if the representation of the boat was well oriented and if the actor was still oriented along the Z-axis. I'm not very clear but maybe this image will help :
http://www.hiboox.fr/go/images/divers/capt1,490d9bfcc7ad9a51379f3a1fb7dc69d7.png.html
On this image, the boat can't go lower, that is the problem.
To rotate the boat I tried two solutions that do the same :
Hope someone knows a solution and excuse me for my english
I have a little problem in my current project which is a boat race simulation.
I have a character : the boat.
I have a static body : any other element of the world.
Initially, the boat is oriented along the Z-axis.
When I approach an object with the boat oriented along the Z-axis, the boat stop when he hit the object. All is normal, no problem as you can see on the following image :
http://www.hiboox.fr/go/images/divers/capt2,b8f335e9193612e54da6f186d5d18da7.png.html
But when I approach the boat along the X-axis, it react like if the representation of the boat was well oriented and if the actor was still oriented along the Z-axis. I'm not very clear but maybe this image will help :
http://www.hiboox.fr/go/images/divers/capt1,490d9bfcc7ad9a51379f3a1fb7dc69d7.png.html
On this image, the boat can't go lower, that is the problem.
To rotate the boat I tried two solutions that do the same :
pNxCharacter->getNode()->yaw(Ogre::Degree(-characterSpeed/10));
pNxCharacter->setDirection(pNxCharacter->getNode()->getOrientation());
Ogre::Quaternion q;
q.FromAngleAxis(Ogre::Degree(-characterSpeed/10),pNxCharacter->getGlobalOrientation() * Ogre::Vector3::UNIT_Y);
q = pNxCharacter->getGlobalOrientation() * q;
pNxCharacter->setDirection(q);
Hope someone knows a solution and excuse me for my english