
17 May
2008
17 May
'08
9:37 p.m.
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Ugo Jardonnet <jardonnet@lrde.epita.fr> Fix algebra::quat::set_unit. set_unit(q): if q != 0 set_unit; postcondition(is_unit) else return * mln/algebra/quat.hh: . quat.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Index: mln/algebra/quat.hh --- mln/algebra/quat.hh (revision 1965) +++ mln/algebra/quat.hh (working copy) @@ -409,9 +409,11 @@ inline quat& quat::set_unit() { - v_.normalize(); + if (about_equal(norm::l2(this->to_vec()), 0.f)) + return *this; - assert(this->is_unit()); + v_.normalize(); + mln_postcondition(this->is_unit()); return *this; }