Wrong rotation in getAbsoluteTransformation()

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
nathanf534
Posts: 199
Joined: Tue Dec 09, 2008 2:55 am

Wrong rotation in getAbsoluteTransformation()

Post by nathanf534 »

Code: Select all

ISceneNode* laser=smgr->addMeshSceneNode(laserMesh,0,0,location+direction*offset,rotation,vector3df(1,1,10),false);

matrix4 mat = matrix4(laser->getAbsoluteTransformation());
vector3df r1=mat.getRotationDegrees();
cout<<r1.X<<","<<r1.Y<<","<<r1.Z<<endl;
mat.setRotationDegrees(laser->getRotation());
vector3df r2=mat.getRotationDegrees();
cout<<r2.X<<","<<r2.Y<<","<<r2.Z<<endl;
output:

Code: Select all

2.39263,0.489813,0.156511
22.6769,0.489813,0.156511
Unless I don't understand something, both outputs should be the same.
I'm using Irrlicht 1.6 due to some rendering issues in 1.7 that I can't find the source of. If this was fixed in 1.7, then sorry.
Last edited by nathanf534 on Tue Jul 20, 2010 9:39 pm, edited 3 times in total.
while(signatureEmpty){cout<<wittyComment();}
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

You should call updateAbsolutePosition() on the node before getAbsoluteTransformation(). Also, why the new keyword for the matrix?
nathanf534
Posts: 199
Joined: Tue Dec 09, 2008 2:55 am

Post by nathanf534 »

I already tried updateAbsolutePosition(), it doesn't change anything, and that only updates the position, I don't believe it does anything to the rotation.
And I just tried the new keyword to see if it would do anything different, Ive tried it without it too.

edit: I edited the first post so it doesn't use new anymore.
while(signatureEmpty){cout<<wittyComment();}
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

Even without the updateAbsolutePosition(), the code you provided works for me. I'm using 1.7.1. Hmm ..

Wasn't there a bug with rotation of a matrix that had been scaled or something? that was fixed in version 1.7 I think. If you scale your node uniformly (1,1,1) what does it say then?

edit: In the change log I found this under 1.7:
- getRotation now handles matrices with scaling as well
Maybe that was the bug?
nathanf534
Posts: 199
Joined: Tue Dec 09, 2008 2:55 am

Post by nathanf534 »

ok, that was probably it, I was using something with a scale (1,10,1)
while(signatureEmpty){cout<<wittyComment();}
Post Reply