Rev | Line | |
---|
[37] | 1 | /* |
---|
| 2 | |
---|
| 3 | Brian Curless |
---|
| 4 | |
---|
| 5 | Computer Graphics Laboratory |
---|
| 6 | Stanford University |
---|
| 7 | |
---|
| 8 | --------------------------------------------------------------------- |
---|
| 9 | |
---|
| 10 | Copyright (1997) The Board of Trustees of the Leland Stanford Junior |
---|
| 11 | University. Except for commercial resale, lease, license or other |
---|
| 12 | commercial transactions, permission is hereby given to use, copy, |
---|
| 13 | modify this software for academic purposes only. No part of this |
---|
| 14 | software or any derivatives thereof may be used in the production of |
---|
| 15 | computer models for resale or for use in a commercial |
---|
| 16 | product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND |
---|
| 17 | CONCERNING THIS SOFTWARE. No support is implied or provided. |
---|
| 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #ifndef _QUATERNION_ |
---|
| 23 | #define _QUATERNION_ |
---|
| 24 | |
---|
| 25 | #include "Matrix4f.h" |
---|
| 26 | |
---|
| 27 | class Quaternion { |
---|
| 28 | |
---|
| 29 | public: |
---|
| 30 | float q[4]; |
---|
| 31 | |
---|
| 32 | Quaternion(); |
---|
| 33 | ~Quaternion(); |
---|
| 34 | |
---|
| 35 | void setValue(Quaternion &q); |
---|
| 36 | void setValue(float q0, float q1, float q2, float q3); |
---|
| 37 | void setValue(float *quat); |
---|
| 38 | |
---|
| 39 | void toMatrix(Matrix4f &); |
---|
| 40 | void fromMatrix(Matrix4f &); |
---|
| 41 | |
---|
| 42 | void normalize(); |
---|
| 43 | void toAxisAngle(float &angle, Vec3f &axis); |
---|
| 44 | |
---|
| 45 | }; |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | #endif |
---|
| 50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.