Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Extras / CDTestFramework / Opcode / Ice / IceAxes.h
1 /*
2  *      ICE / OPCODE - Optimized Collision Detection
3  * http://www.codercorner.com/Opcode.htm
4  * 
5  * Copyright (c) 2001-2008 Pierre Terdiman,  pierre@codercorner.com
6
7 This software is provided 'as-is', without any express or implied warranty.
8 In no event will the authors be held liable for any damages arising from the use of this software.
9 Permission is granted to anyone to use this software for any purpose, 
10 including commercial applications, and to alter it and redistribute it freely, 
11 subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
14 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
15 3. This notice may not be removed or altered from any source distribution.
16 */
17 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
18 /**
19  *      Contains axes definition.
20  *      \file           IceAxes.h
21  *      \author         Pierre Terdiman
22  *      \date           January, 29, 2000
23  */
24 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25
26 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 // Include Guard
28 #ifndef __ICEAXES_H__
29 #define __ICEAXES_H__
30
31         enum PointComponent
32         {
33                 _X                                      = 0,
34                 _Y                                      = 1,
35                 _Z                                      = 2,
36                 _W                                      = 3,
37
38                 _FORCE_DWORD            = 0x7fffffff
39         };
40
41         enum AxisOrder
42         {
43                 AXES_XYZ                        = (_X)|(_Y<<2)|(_Z<<4),
44                 AXES_XZY                        = (_X)|(_Z<<2)|(_Y<<4),
45                 AXES_YXZ                        = (_Y)|(_X<<2)|(_Z<<4),
46                 AXES_YZX                        = (_Y)|(_Z<<2)|(_X<<4),
47                 AXES_ZXY                        = (_Z)|(_X<<2)|(_Y<<4),
48                 AXES_ZYX                        = (_Z)|(_Y<<2)|(_X<<4),
49
50                 AXES_FORCE_DWORD        = 0x7fffffff
51         };
52
53         class ICEMATHS_API Axes
54         {
55                 public:
56
57                 inline_                 Axes(AxisOrder order)
58                                                 {
59                                                         mAxis0 = (order   ) & 3;
60                                                         mAxis1 = (order>>2) & 3;
61                                                         mAxis2 = (order>>4) & 3;
62                                                 }
63                 inline_                 ~Axes()         {}
64
65                                 udword  mAxis0;
66                                 udword  mAxis1;
67                                 udword  mAxis2;
68         };
69
70 #endif // __ICEAXES_H__