Text archives Help
- From: "Thiago Ize" <
>
- To:
- Subject: [Manta] r2292 - trunk/Core/Geometry
- Date: Wed, 25 Jun 2008 20:03:43 -0600 (MDT)
Author: thiago
Date: Wed Jun 25 20:03:43 2008
New Revision: 2292
Modified:
trunk/Core/Geometry/AffineTransform.cc
Log:
When Real was set to float, 1-1e-9 remained as 1, so if e was 1 we
would get 1>1, which was false. We wanted that to be true. So changing
from > to >= makes it work again. Furthermore, using 1e-7 captures
values that are almost 1, which I assume was the original intention.
Modified: trunk/Core/Geometry/AffineTransform.cc
==============================================================================
--- trunk/Core/Geometry/AffineTransform.cc (original)
+++ trunk/Core/Geometry/AffineTransform.cc Wed Jun 25 20:03:43 2008
@@ -124,10 +124,10 @@
Vector v = Cross(from, to);
Real e = Dot(from, to);
- if(e > 1-(Real)(1.e-9)){
+ if(e >= 1-(Real)(1.e-7)){
// No rotation
return;
- } else if (e < -1+(Real)(1.e-9)){
+ } else if (e <= -1+(Real)(1.e-7)){
// 180 degree rotation
Vector x = v.absoluteValue();
int largest = x.indexOfMaxComponent();
- [Manta] r2292 - trunk/Core/Geometry, Thiago Ize, 06/25/2008
Archive powered by MHonArc 2.6.16.