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