From e6fbdfb9f659fbb346983c053b71b5e6babffdcb Mon Sep 17 00:00:00 2001 From: cnr-isti-vclab Date: Fri, 10 Jul 2009 13:18:24 +0000 Subject: [PATCH] Added static constuctor that imports from different Quaternion types (overrides same static contstructor of father's Point4 class) --- vcg/math/quaternion.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vcg/math/quaternion.h b/vcg/math/quaternion.h index ae1d9ca8..c9215bf9 100644 --- a/vcg/math/quaternion.h +++ b/vcg/math/quaternion.h @@ -156,7 +156,14 @@ public: const S & V ( const int i ) const { assert(i>=0 && i<4); return Point4::V(i); } S & V ( const int i ) { assert(i>=0 && i<4); return Point4::V(i); } - private: + /// constuctor that imports from different Quaternion types + template + static inline Quaternion Construct( const Quaternion & b ) + { + return Quaternion(S(b[0]),S(b[1]),S(b[2]),S(b[3])); + } + +private: }; /*template void QuaternionToMatrix(Quaternion &s, M &m);