]> Dogcows Code - chaz/yoink/blob - src/moof/cml/quaternion.h
fixes for newer versions of g++
[chaz/yoink] / src / moof / cml / quaternion.h
1 /* -*- C++ -*- ------------------------------------------------------------
2
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
4
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
7
8 *-----------------------------------------------------------------------*/
9 /** @file
10 * @brief
11 */
12
13 #ifndef cml_quaternion_h
14 #define cml_quaternion_h
15
16 #include <cml/core/common.h>
17
18 namespace cml {
19
20 // NOTE: 'scale' constant no longer used.
21
22 /** Helper to specify v1^v2 multiplication order. */
23 struct positive_cross {
24 /*enum { scale = 1 };*/
25 };
26
27 /** Helper to specify v2^v1 multiplication order. */
28 struct negative_cross {
29 /*enum { scale = -1 };*/
30 };
31
32 /** Helper to specify scalar-first quaternion ordering. */
33 struct scalar_first {
34 enum { W, X, Y, Z };
35 };
36
37 /** Helper to specify vector-first quaternion ordering. */
38 struct vector_first {
39 enum { X, Y, Z, W };
40 };
41
42 /** A configurable quaternion.
43 *
44 * This class encapsulates the notion of a quaternion. The ArrayType
45 * template argument can be used to select the type of array to be used as
46 * internal storage for the quaternion's coefficients.
47 *
48 * @note Quaternions with two different orders cannot be used in the same
49 * expression.
50 */
51 template<typename Element, class ArrayType = fixed<>,
52 class Order = scalar_first, class Cross = positive_cross> class quaternion;
53
54 } // namespace cml
55
56 #include <cml/quaternion/quaternion_ops.h>
57 #include <cml/quaternion/conjugate.h>
58 #include <cml/quaternion/quaternion_mul.h>
59 #include <cml/quaternion/quaternion_functions.h>
60 #include <cml/quaternion/quaternion_comparison.h>
61 #include <cml/quaternion/inverse.h>
62 #include <cml/quaternion/quaternion.h>
63 #include <cml/quaternion/quaternion_print.h>
64 #endif
65
66 // -------------------------------------------------------------------------
67 // vim:ft=cpp
This page took 0.032127 seconds and 4 git commands to generate.