Registered Member
|
I looked here:http://eigen.tuxfamily.org/dox/TutorialGeometry.html and tried to do this:
I returned a long log of errors with this one:
How to initialize the quaternion? |
Moderator
|
ok, this is an annoying c++ issue, while the syntax Type obj = other; makes a call to the Type ctor (and not operator=), c++ does not accept to call an explicit ctor in this case, you either have to write:
Quaternion<float> q(AngleAxis<float>(angleX * M_PI / 180, Vector3f::UnitX())); or Quaternion<float> q = Quaternion<float>(AngleAxis<float>(angleX * M_PI / 180, Vector3f::UnitX())); I'll fix the doc and put a warning about that very common issue. |
Registered Member
|
Ok. In the same document:
Thus I do:
And is there more optimized method of transformation a vector, for instance:
|
Moderator
|
frustumDirection *= q;
would means: frustumDirection = frustumDirection * q; that is not the same. And no there is no such shortcut. Note that in this case that would only optimize the writing, not the performance. |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft