Coin Logo http://www.sim.no/
http://www.coin3d.org/

SbRotation.h
1#ifndef COIN_SBROTATION_H
2#define COIN_SBROTATION_H
3
4/**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25\**************************************************************************/
26
27#include <stdio.h>
28#include <Inventor/SbVec4f.h>
29
30class SbMatrix;
31class SbVec3f;
32
33class COIN_DLL_API SbRotation {
34public:
35 SbRotation(void);
36 SbRotation(const SbVec3f & axis, const float radians);
37 SbRotation(const float q[4]);
38 SbRotation(const float q0, const float q1, const float q2, const float q3);
39 SbRotation(const SbMatrix & m);
40 SbRotation(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
41 const float * getValue(void) const;
42 void getValue(float & q0, float & q1, float & q2, float & q3) const;
43 SbRotation & setValue(const float q0, const float q1,
44 const float q2, const float q3);
45 void getValue(SbVec3f & axis, float & radians) const;
46 void getValue(SbMatrix & matrix) const;
47 SbRotation & invert(void);
48 SbRotation inverse(void) const;
49 SbRotation & setValue(const float q[4]);
50 SbRotation & setValue(const SbMatrix & m);
51 SbRotation & setValue(const SbVec3f & axis, const float radians);
52 SbRotation & setValue(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
53 SbRotation & operator*=(const SbRotation & q);
54 SbRotation & operator*=(const float s);
55 friend COIN_DLL_API int operator==(const SbRotation & q1, const SbRotation & q2);
56 friend COIN_DLL_API int operator!=(const SbRotation & q1, const SbRotation & q2);
57 SbBool equals(const SbRotation & r, const float tolerance) const;
58 friend COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
59 void multVec(const SbVec3f & src, SbVec3f & dst) const;
60
61 void scaleAngle(const float scaleFactor);
62 static SbRotation slerp(const SbRotation & rot0, const SbRotation & rot1,
63 float t);
64 static SbRotation identity(void);
65
66 void print(FILE * fp) const;
67
68private:
69 SbVec4f quat;
70};
71
72COIN_DLL_API int operator ==(const SbRotation & q1, const SbRotation & q2);
73COIN_DLL_API int operator !=(const SbRotation & q1, const SbRotation & q2);
74COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
75
76#endif // !COIN_SBROTATION_H
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition SbMatrix.h:37
The SbRotation class represents a rotation in 3D space.
Definition SbRotation.h:33
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition SbVec4f.h:40

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.