Panda3D
aa_luse.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 aa_luse.h
10  * @author drose
11  * @date 1999-01-13
12  */
13 
14 #ifndef AA_LUSE_H
15 #define AA_LUSE_H
16 
17 // This file is include by luse.h to do all the work required by that header
18 // file. It is in a separate header file to avoid cyclic header dependencies,
19 // and because interrogate wants to sort header files in alphabetical order
20 // and this one should pretty much be included first.
21 
22 #include "pandabase.h"
23 
24 #include "lsimpleMatrix.h"
25 #include "stl_compares.h"
26 #include "lvec2_ops.h"
27 #include "lvec3_ops.h"
28 #include "lvec4_ops.h"
29 #include "lmat_ops.h"
30 #include "lmatrix.h"
31 #include "lquaternion.h"
32 #include "lrotation.h"
33 #include "lorientation.h"
34 #include "lcast_to.h"
35 
36 // ensure FLOATTYPE is set to float for macros are used outside of LINMATH
37 #include "fltnames.h"
38 
39 // This macro defines the cast-to-another-numeric-type operator for all of the
40 // things defined in this package. It works by virtue of there being an
41 // appropriate lcast_to() template function defined for each class.
42 
43 #define LCAST(numeric_type, object) lcast_to((numeric_type *)0, object)
44 
45 BEGIN_PUBLISH
46 
47 // Now we define some handy typedefs for these classes.
48 typedef LPoint3f LVertexf;
49 typedef LVector3f LNormalf;
50 typedef LPoint2f LTexCoordf;
51 typedef LPoint3f LTexCoord3f;
52 typedef LVecBase4f LColorf;
53 typedef LVecBase3f LRGBColorf;
54 
55 typedef LPoint3d LVertexd;
56 typedef LVector3d LNormald;
57 typedef LPoint2d LTexCoordd;
58 typedef LPoint3d LTexCoord3d;
59 typedef LVecBase4d LColord;
60 typedef LVecBase3d LRGBColord;
61 
62 // The following names are only for legacy Python code. These aren't real
63 // typedefs; they're just commands to interrogate.
64 #ifdef CPPPARSER
65 typedef LMatrix4f Mat4F;
66 typedef LMatrix3f Mat3F;
67 typedef LVecBase4f VBase4F;
68 typedef LVector4f Vec4F;
69 typedef LPoint4f Point4F;
70 typedef LVecBase3f VBase3F;
71 typedef LVector3f Vec3F;
72 typedef LPoint3f Point3F;
73 typedef LVecBase2f VBase2F;
74 typedef LVector2f Vec2F;
75 typedef LPoint2f Point2F;
76 typedef LQuaternionf QuatF;
77 typedef LMatrix4d Mat4D;
78 typedef LMatrix3d Mat3D;
79 typedef LVecBase4d VBase4D;
80 typedef LVector4d Vec4D;
81 typedef LPoint4d Point4D;
82 typedef LVecBase3d VBase3D;
83 typedef LVector3d Vec3D;
84 typedef LPoint3d Point3D;
85 typedef LVecBase2d VBase2D;
86 typedef LVector2d Vec2D;
87 typedef LPoint2d Point2D;
88 typedef LQuaterniond QuatD;
89 #endif // CPPPARSER
90 
91 // And finally, we define the unqualified "standard" float type, which is
92 // based on the setting of STDFLOAT_DOUBLE. This is the type that is used for
93 // graphics-specific operations such as vertex and pos value. The default is
94 // single-precision floats, which is almost always what you really want.
95 #ifndef STDFLOAT_DOUBLE
96 // The default setting--single-precision floats.
97 
98 typedef LVecBase2f LVecBase2;
99 typedef LPoint2f LPoint2;
100 typedef LVector2f LVector2;
101 typedef LVecBase3f LVecBase3;
102 typedef LPoint3f LPoint3;
103 typedef LVector3f LVector3;
104 typedef LVecBase4f LVecBase4;
105 typedef LPoint4f LPoint4;
106 typedef LVector4f LVector4;
107 typedef LQuaternionf LQuaternion;
108 typedef LRotationf LRotation;
109 typedef LOrientationf LOrientation;
110 typedef LMatrix3f LMatrix3;
111 typedef LMatrix4f LMatrix4;
112 
113 typedef LVertexf LVertex;
114 typedef LNormalf LNormal;
115 typedef LTexCoordf LTexCoord;
116 typedef LTexCoord3f LTexCoord3;
117 typedef LColorf LColor;
118 typedef LRGBColorf LRGBColor;
119 
120 typedef UnalignedLVecBase4f UnalignedLVecBase4;
121 typedef UnalignedLMatrix4f UnalignedLMatrix4;
122 
123 // Bogus typedefs for interrogate and legacy Python code.
124 #ifdef CPPPARSER
125 typedef LMatrix4f Mat4;
126 typedef LMatrix3f Mat3;
127 typedef LVecBase4f VBase4;
128 typedef LVector4f Vec4;
129 typedef LPoint4f Point4;
130 typedef LVecBase3f VBase3;
131 typedef LVector3f Vec3;
132 typedef LPoint3f Point3;
133 typedef LVecBase2f VBase2;
134 typedef LVector2f Vec2;
135 typedef LPoint2f Point2;
136 typedef LQuaternionf Quat;
137 #endif // CPPPARSER
138 
139 #else // STDFLOAT_DOUBLE
140 // The specialty setting--double-precision floats.
141 
142 typedef LVecBase2d LVecBase2;
143 typedef LPoint2d LPoint2;
144 typedef LVector2d LVector2;
145 typedef LVecBase3d LVecBase3;
146 typedef LPoint3d LPoint3;
147 typedef LVector3d LVector3;
148 typedef LVecBase4d LVecBase4;
149 typedef LPoint4d LPoint4;
150 typedef LVector4d LVector4;
151 typedef LQuaterniond LQuaternion;
152 typedef LRotationd LRotation;
153 typedef LOrientationd LOrientation;
154 typedef LMatrix3d LMatrix3;
155 typedef LMatrix4d LMatrix4;
156 
157 typedef LVertexd LVertex;
158 typedef LNormald LNormal;
159 typedef LTexCoordd LTexCoord;
160 typedef LTexCoord3d LTexCoord3;
161 typedef LColord LColor;
162 typedef LRGBColord LRGBColor;
163 
164 typedef UnalignedLVecBase4d UnalignedLVecBase4;
165 typedef UnalignedLMatrix4d UnalignedLMatrix4;
166 
167 // Bogus typedefs for interrogate and legacy Python code.
168 #ifdef CPPPARSER
169 typedef LMatrix4d Mat4;
170 typedef LMatrix3d Mat3;
171 typedef LVecBase4d VBase4;
172 typedef LVector4d Vec4;
173 typedef LPoint4d Point4;
174 typedef LVecBase3d VBase3;
175 typedef LVector3d Vec3;
176 typedef LPoint3d Point3;
177 typedef LVecBase2d VBase2;
178 typedef LVector2d Vec2;
179 typedef LPoint2d Point2;
180 typedef LQuaterniond Quat;
181 #endif // CPPPARSER
182 
183 #endif // STDFLOAT_DOUBLE
184 
185 END_PUBLISH
186 
187 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.