| Thread Previous • Date Previous • Date Next • Thread Next |
+ Quaternionr normal2pt;
+ if (planePt!=Vector3r::ZERO) {
+ Vector3r axis=planeNormal.Cross(planePt);
axis.Normalize();
+ Real angle=planePt.Length()/radius;
+ normal2pt.FromAxisAngle(axis,angle);
+ }
Uh, what about the case planePt==Vector3r::ZERO? You should add
something like:
else { return Quaternionr::IDENTITY; }
(Just from the top of my head, I cannot compile & check the code now.)
Cheers, Vaclav
| Thread Previous • Date Previous • Date Next • Thread Next |