Panda3D
Loading...
Searching...
No Matches
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
45BEGIN_PUBLISH
46
47// Now we define some handy typedefs for these classes.
48typedef LPoint3f LVertexf;
49typedef LVector3f LNormalf;
50typedef LPoint2f LTexCoordf;
51typedef LPoint3f LTexCoord3f;
52typedef LVecBase4f LColorf;
53typedef LVecBase3f LRGBColorf;
54
55typedef LPoint3d LVertexd;
56typedef LVector3d LNormald;
57typedef LPoint2d LTexCoordd;
58typedef LPoint3d LTexCoord3d;
59typedef LVecBase4d LColord;
60typedef 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
65typedef LMatrix4f Mat4F;
66typedef LMatrix3f Mat3F;
67typedef LVecBase4f VBase4F;
68typedef LVector4f Vec4F;
69typedef LPoint4f Point4F;
70typedef LVecBase3f VBase3F;
71typedef LVector3f Vec3F;
72typedef LPoint3f Point3F;
73typedef LVecBase2f VBase2F;
74typedef LVector2f Vec2F;
75typedef LPoint2f Point2F;
76typedef LQuaternionf QuatF;
77typedef LMatrix4d Mat4D;
78typedef LMatrix3d Mat3D;
79typedef LVecBase4d VBase4D;
80typedef LVector4d Vec4D;
81typedef LPoint4d Point4D;
82typedef LVecBase3d VBase3D;
83typedef LVector3d Vec3D;
84typedef LPoint3d Point3D;
85typedef LVecBase2d VBase2D;
86typedef LVector2d Vec2D;
87typedef LPoint2d Point2D;
88typedef 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
98typedef LVecBase2f LVecBase2;
99typedef LPoint2f LPoint2;
100typedef LVector2f LVector2;
101typedef LVecBase3f LVecBase3;
102typedef LPoint3f LPoint3;
103typedef LVector3f LVector3;
104typedef LVecBase4f LVecBase4;
105typedef LPoint4f LPoint4;
106typedef LVector4f LVector4;
107typedef LQuaternionf LQuaternion;
108typedef LRotationf LRotation;
109typedef LOrientationf LOrientation;
110typedef LMatrix3f LMatrix3;
111typedef LMatrix4f LMatrix4;
112
113typedef LVertexf LVertex;
114typedef LNormalf LNormal;
115typedef LTexCoordf LTexCoord;
116typedef LTexCoord3f LTexCoord3;
117typedef LColorf LColor;
118typedef LRGBColorf LRGBColor;
119
120typedef UnalignedLVecBase4f UnalignedLVecBase4;
121typedef UnalignedLMatrix4f UnalignedLMatrix4;
122
123// Bogus typedefs for interrogate and legacy Python code.
124#ifdef CPPPARSER
125typedef LMatrix4f Mat4;
126typedef LMatrix3f Mat3;
127typedef LVecBase4f VBase4;
128typedef LVector4f Vec4;
129typedef LPoint4f Point4;
130typedef LVecBase3f VBase3;
131typedef LVector3f Vec3;
132typedef LPoint3f Point3;
133typedef LVecBase2f VBase2;
134typedef LVector2f Vec2;
135typedef LPoint2f Point2;
136typedef LQuaternionf Quat;
137#endif // CPPPARSER
138
139#else // STDFLOAT_DOUBLE
140// The specialty setting--double-precision floats.
141
142typedef LVecBase2d LVecBase2;
143typedef LPoint2d LPoint2;
144typedef LVector2d LVector2;
145typedef LVecBase3d LVecBase3;
146typedef LPoint3d LPoint3;
147typedef LVector3d LVector3;
148typedef LVecBase4d LVecBase4;
149typedef LPoint4d LPoint4;
150typedef LVector4d LVector4;
151typedef LQuaterniond LQuaternion;
152typedef LRotationd LRotation;
153typedef LOrientationd LOrientation;
154typedef LMatrix3d LMatrix3;
155typedef LMatrix4d LMatrix4;
156
157typedef LVertexd LVertex;
158typedef LNormald LNormal;
159typedef LTexCoordd LTexCoord;
160typedef LTexCoord3d LTexCoord3;
161typedef LColord LColor;
162typedef LRGBColord LRGBColor;
163
164typedef UnalignedLVecBase4d UnalignedLVecBase4;
165typedef UnalignedLMatrix4d UnalignedLMatrix4;
166
167// Bogus typedefs for interrogate and legacy Python code.
168#ifdef CPPPARSER
169typedef LMatrix4d Mat4;
170typedef LMatrix3d Mat3;
171typedef LVecBase4d VBase4;
172typedef LVector4d Vec4;
173typedef LPoint4d Point4;
174typedef LVecBase3d VBase3;
175typedef LVector3d Vec3;
176typedef LPoint3d Point3;
177typedef LVecBase2d VBase2;
178typedef LVector2d Vec2;
179typedef LPoint2d Point2;
180typedef LQuaterniond Quat;
181#endif // CPPPARSER
182
183#endif // STDFLOAT_DOUBLE
184
185END_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.