/[libvob]/libvob/include/vob/trans/LinearPrimitives.hxx
ViewVC logotype

Diff of /libvob/include/vob/trans/LinearPrimitives.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by tjl, Wed May 14 22:03:30 2003 UTC revision 1.7 by jvk, Wed Jul 9 14:05:25 2003 UTC
# Line 368  namespace Primitives { Line 368  namespace Primitives {
368      };      };
369      VOB_PRIMITIVETRANS_DEFINED(RotateXYZ_Explicit, "rotateXYZ");      VOB_PRIMITIVETRANS_DEFINED(RotateXYZ_Explicit, "rotateXYZ");
370    
371        /** Quaternion parametrization of rotation in 3-space.
372         * Parameters: x, y, z, w
373         */
374        class RotateXYZ_Quaternion :
375                public RotateXYZ,
376                public ParametrizedPrimitiveTransform
377        {
378        public:
379            enum { NParams = 4 };
380            template<class Ptr> void setParams(Ptr p) {
381                vec.x = p[0];
382                vec.y = p[1];
383                vec.z = p[2];
384                float norm = vec.length();
385                if (norm > 0)
386                    vec *= 1 / norm;
387                else
388                    vec.z = 1;
389                a = 2 * acos(p[3]) * (180 / M_PI);
390    
391                angleWasSet();
392            }
393        };
394        VOB_PRIMITIVETRANS_DEFINED(RotateXYZ_Quaternion, "rotateQuaternion");
395    
396      /** Affine coordinate system (in xy), offset in z.      /** Affine coordinate system (in xy), offset in z.
397       * Can't be used in HierarchicalTransform directly       * Can't be used in HierarchicalTransform directly
398       * because parameters are required.       * because parameters are required.

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26