From 5fee62fbb16ecfe2a9e6284f1873790adb86b93f Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Tue, 1 Nov 2011 18:41:54 +0000 Subject: [PATCH] changed several calls of CrossVector function --- .../parametrization/tangent_field_operators.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/vcg/complex/algorithms/parametrization/tangent_field_operators.h b/vcg/complex/algorithms/parametrization/tangent_field_operators.h index b9825dac..906391aa 100644 --- a/vcg/complex/algorithms/parametrization/tangent_field_operators.h +++ b/vcg/complex/algorithms/parametrization/tangent_field_operators.h @@ -109,6 +109,18 @@ namespace vcg { alpha=0; return alpha; } + + ///return the direction of the cross field in 3D + ///given a first direction + static void CrossVector(const CoordType &dir0, + const CoordType &norm, + CoordType axis[4]) + { + axis[0]=dir0; + axis[1]=norm^axis[0]; + axis[2]=-axis[0]; + axis[3]=-axis[1]; + } ///return the direction of the cross field in 3D static void CrossVector(MeshType &mesh, @@ -119,10 +131,8 @@ namespace vcg { assert(CrossDir0); MeshType::PerFaceAttributeHandle Fh0= vcg::tri::Allocator::GetPerFaceAttribute(mesh,std::string("CrossDir0")); - axis[0]=Fh0[&f]; - axis[1]=f.cN()^axis[0]; - axis[2]=-axis[0]; - axis[3]=-axis[1]; + CoordType dir0=Fh0[&f]; + CrossVector(dir0,f.cN(),axis); } ///return a specific direction given an integer 0..3