Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SbRotation.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SBROTATION_H
00021 #define COIN_SBROTATION_H
00022 
00023 #include <stdio.h>
00024 #include <Inventor/SbVec4f.h>
00025 
00026 class SbMatrix;
00027 class SbVec3f;
00028 
00029 class COIN_DLL_API SbRotation {
00030 public:
00031   SbRotation(void);
00032   SbRotation(const SbVec3f & axis, const float radians);
00033   SbRotation(const float q[4]);
00034   SbRotation(const float q0, const float q1, const float q2, const float q3);
00035   SbRotation(const SbMatrix & m);
00036   SbRotation(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
00037   const float * getValue(void) const;
00038   void getValue(float & q0, float & q1, float & q2, float & q3) const;
00039   SbRotation & setValue(const float q0, const float q1,
00040                         const float q2, const float q3);
00041   void getValue(SbVec3f & axis, float & radians) const;
00042   void getValue(SbMatrix & matrix) const;
00043   SbRotation & invert(void);
00044   SbRotation inverse(void) const;
00045   SbRotation & setValue(const float q[4]);
00046   SbRotation & setValue(const SbMatrix & m);
00047   SbRotation & setValue(const SbVec3f & axis, const float radians);
00048   SbRotation & setValue(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
00049   SbRotation & operator*=(const SbRotation & q);
00050   SbRotation & operator*=(const float s);
00051   friend COIN_DLL_API int operator==(const SbRotation & q1, const SbRotation & q2);
00052   friend COIN_DLL_API int operator!=(const SbRotation & q1, const SbRotation & q2);
00053   SbBool equals(const SbRotation & r, const float tolerance) const;
00054   friend COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
00055   void multVec(const SbVec3f & src, SbVec3f & dst) const;
00056 
00057   void scaleAngle(const float scaleFactor);
00058   static SbRotation slerp(const SbRotation & rot0, const SbRotation & rot1,
00059                           float t);
00060   static SbRotation identity(void);
00061 
00062   void print(FILE * fp) const;
00063 
00064 private:
00065   SbVec4f quat;
00066 };
00067 
00068 COIN_DLL_API int operator ==(const SbRotation & q1, const SbRotation & q2);
00069 COIN_DLL_API int operator !=(const SbRotation & q1, const SbRotation & q2);
00070 COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
00071 
00072 #endif // !COIN_SBROTATION_H

Generated at Tue Mar 5 03:31:11 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001