← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2078: Adaptation to Eigen Library

 


    +       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

References