Panda3D
 All Classes Functions Variables Enumerations
coordinateSystem.h
1 // Filename: coordinateSystem.h
2 // Created by: drose (24Sep99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef COORDINATESYSTEM_H
16 #define COORDINATESYSTEM_H
17 
18 #include "pandabase.h"
19 
20 #include "typedef.h"
21 
22 BEGIN_PUBLISH
23 
24 enum CoordinateSystem {
25  // The CS_default entry does not refer to a particular coordinate
26  // system, but rather to the value stored in
27  // default_coordinate_system, which in turn is loaded from the
28  // config variable "coordinate-system".
29  CS_default,
30 
31  CS_zup_right,
32  CS_yup_right,
33  CS_zup_left,
34  CS_yup_left,
35 
36  // CS_invalid is not a coordinate system at all. It can be used in
37  // user-input processing code to indicate a contradictory coordinate
38  // system request.
39  CS_invalid,
40 };
41 
42 EXPCL_PANDA_LINMATH CoordinateSystem get_default_coordinate_system();
43 EXPCL_PANDA_LINMATH CoordinateSystem parse_coordinate_system_string(const string &str);
44 EXPCL_PANDA_LINMATH string format_coordinate_system(CoordinateSystem cs);
45 EXPCL_PANDA_LINMATH bool is_right_handed(CoordinateSystem cs = CS_default);
46 
47 END_PUBLISH
48 
49 #define IS_LEFT_HANDED_COORDSYSTEM(cs) ((cs==CS_zup_left) || (cs==CS_yup_left))
50 
51 EXPCL_PANDA_LINMATH ostream &operator << (ostream &out, CoordinateSystem cs);
52 EXPCL_PANDA_LINMATH istream &operator >> (istream &in, CoordinateSystem &cs);
53 
54 
55 #endif
56