From: Braden M. <br...@us...> - 2006-11-22 04:51:39
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21915/src/libopenvrml/openvrml Modified Files: basetypes.cpp Log Message: Assert normalization of vectors by directly checking that the length is 1.0, rather than asserting that the vector is equal to the normalized version of itself. The latter mechanism introduces too much error. Index: basetypes.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** basetypes.cpp 31 Aug 2006 06:45:30 -0000 1.39 --- basetypes.cpp 22 Nov 2006 04:51:36 -0000 1.40 *************** *** 2674,2679 **** OPENVRML_NOTHROW { ! assert(make_vec3f(rot[0], rot[1], rot[2]) ! == make_vec3f(rot[0], rot[1], rot[2]).normalize()); const rotation r = { { rot[0], rot[1], rot[2], rot[3] } }; return r; --- 2674,2679 ---- OPENVRML_NOTHROW { ! assert(openvrml_::fequal(1.0f, ! make_vec3f(rot[0], rot[1], rot[2]).length())); const rotation r = { { rot[0], rot[1], rot[2], rot[3] } }; return r; *************** *** 2702,2706 **** OPENVRML_NOTHROW { ! assert(make_vec3f(x, y, z) == make_vec3f(x, y, z).normalize()); const rotation r = { { x, y, z, angle } }; return r; --- 2702,2706 ---- OPENVRML_NOTHROW { ! assert(openvrml_::fequal(1.0f, make_vec3f(x, y, z).length())); const rotation r = { { x, y, z, angle } }; return r; *************** *** 2725,2729 **** OPENVRML_NOTHROW { ! assert(axis == axis.normalize()); const rotation r = { { axis.x(), axis.y(), axis.z(), angle } }; return r; --- 2725,2729 ---- OPENVRML_NOTHROW { ! assert(openvrml_::fequal(1.0f, axis.length())); const rotation r = { { axis.x(), axis.y(), axis.z(), angle } }; return r; *************** *** 2935,2939 **** void openvrml::rotation::axis(const vec3f & axis) OPENVRML_NOTHROW { ! assert(axis == axis.normalize()); this->rot[0] = axis.x(); this->rot[1] = axis.y(); --- 2935,2939 ---- void openvrml::rotation::axis(const vec3f & axis) OPENVRML_NOTHROW { ! assert(openvrml_::fequal(1.0f, axis.length())); this->rot[0] = axis.x(); this->rot[1] = axis.y(); |