version 1.8.1
void CCameraSceneNode::setRotation(const core::vector3df& rotation)
{
if(TargetAndRotationAreBound)
Target = getAbsolutePosition() + rotation.rotationToDirection();
//Here , i think it should be like this:
Target = getAbsolutePosition() + rotation.rotationToDirection(Target-getAbsolutePosition());
ISceneNode::setRotation(rotation);
}
[no bug]Bug in CCameraSceneNode::setRotation
-
- Posts: 28
- Joined: Wed Jan 30, 2013 3:29 am
Re: Bug in CCameraSceneNode::setRotation
While both are valid approaches, that would be a behavioral change that would break existing apps.
Re: Bug in CCameraSceneNode::setRotation
Yeah - rotation is absolute - not relative to current rotation.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 28
- Joined: Wed Jan 30, 2013 3:29 am
Re: [no bug]Bug in CCameraSceneNode::setRotation
the default parameter is as following:
vector3d<T> rotationToDirection(const vector3d<T> & forwards = vector3d<T>(0, 0, 1))
i don't think, the code i mentioned should use the default.
in my program, the code is absolutely a bug.
vector3d<T> rotationToDirection(const vector3d<T> & forwards = vector3d<T>(0, 0, 1))
i don't think, the code i mentioned should use the default.
in my program, the code is absolutely a bug.
Re: [no bug]Bug in CCameraSceneNode::setRotation
Well, maybe we can help you with your program. Just to make it clear - what setRotation is doing is setting absolute angles. If you set the rotation to the same value it will always look in the same direction. While with your change that would no longer be the case. You probably want to rotate +/- a certain relative value to the current value. To do that you should add your rotation to the current rotation.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 28
- Joined: Wed Jan 30, 2013 3:29 am
Re: [no bug]Bug in CCameraSceneNode::setRotation
thanks!
i will check it out again.
i will check it out again.