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