00001 // Filename: aa_luse.h 00002 // Created by: drose (13Jan99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef AA_LUSE_H 00016 #define AA_LUSE_H 00017 00018 // This file is include by luse.h to do all the work required by that 00019 // header file. It is in a separate header file to avoid cyclic 00020 // header dependencies, and because interrogate wants to sort header 00021 // files in alphabetical order and this one should pretty much be 00022 // included first. 00023 00024 #include "pandabase.h" 00025 00026 #include "lsimpleMatrix.h" 00027 #include "stl_compares.h" 00028 #include "lvec2_ops.h" 00029 #include "lvec3_ops.h" 00030 #include "lvec4_ops.h" 00031 #include "lmat_ops.h" 00032 #include "lmatrix.h" 00033 #include "lquaternion.h" 00034 #include "lrotation.h" 00035 #include "lorientation.h" 00036 #include "lcast_to.h" 00037 00038 //ensure FLOATTYPE is set to float for macros are used outside of LINMATH 00039 #include "fltnames.h" 00040 00041 // This macro defines the cast-to-another-numeric-type operator for 00042 // all of the things defined in this package. It works by virtue of 00043 // there being an appropriate lcast_to() template function defined for 00044 // each class. 00045 00046 #define LCAST(numeric_type, object) lcast_to((numeric_type *)0, object) 00047 00048 00049 // Now we define some handy typedefs for these classes. 00050 typedef LPoint3f LVertexf; 00051 typedef LVector3f LNormalf; 00052 typedef LPoint2f LTexCoordf; 00053 typedef LPoint3f LTexCoord3f; 00054 typedef LVecBase4f LColorf; 00055 typedef LVecBase3f LRGBColorf; 00056 00057 typedef LPoint3d LVertexd; 00058 typedef LVector3d LNormald; 00059 typedef LPoint2d LTexCoordd; 00060 typedef LPoint3d LTexCoord3d; 00061 typedef LVecBase4d LColord; 00062 typedef LVecBase3d LRGBColord; 00063 00064 // The following names are only for legacy Python code. These aren't 00065 // real typedefs; they're just commands to interrogate. 00066 #ifdef CPPPARSER 00067 typedef LMatrix4f Mat4F; 00068 typedef LMatrix3f Mat3F; 00069 typedef LVecBase4f VBase4F; 00070 typedef LVector4f Vec4F; 00071 typedef LPoint4f Point4F; 00072 typedef LVecBase3f VBase3F; 00073 typedef LVector3f Vec3F; 00074 typedef LPoint3f Point3F; 00075 typedef LVecBase2f VBase2F; 00076 typedef LVector2f Vec2F; 00077 typedef LPoint2f Point2F; 00078 typedef LQuaternionf QuatF; 00079 typedef LMatrix4d Mat4D; 00080 typedef LMatrix3d Mat3D; 00081 typedef LVecBase4d VBase4D; 00082 typedef LVector4d Vec4D; 00083 typedef LPoint4d Point4D; 00084 typedef LVecBase3d VBase3D; 00085 typedef LVector3d Vec3D; 00086 typedef LPoint3d Point3D; 00087 typedef LVecBase2d VBase2D; 00088 typedef LVector2d Vec2D; 00089 typedef LPoint2d Point2D; 00090 typedef LQuaterniond QuatD; 00091 #endif // CPPPARSER 00092 00093 // And finally, we define the unqualified "standard" float type, which 00094 // is based on the setting of STDFLOAT_DOUBLE. This is the type that 00095 // is used for graphics-specific operations such as vertex and pos 00096 // value. The default is single-precision floats, which is almost 00097 // always what you really want. 00098 #ifndef STDFLOAT_DOUBLE 00099 // The default setting--single-precision floats. 00100 00101 typedef LVecBase2f LVecBase2; 00102 typedef LPoint2f LPoint2; 00103 typedef LVector2f LVector2; 00104 typedef LVecBase3f LVecBase3; 00105 typedef LPoint3f LPoint3; 00106 typedef LVector3f LVector3; 00107 typedef LVecBase4f LVecBase4; 00108 typedef LPoint4f LPoint4; 00109 typedef LVector4f LVector4; 00110 typedef LQuaternionf LQuaternion; 00111 typedef LRotationf LRotation; 00112 typedef LOrientationf LOrientation; 00113 typedef LMatrix3f LMatrix3; 00114 typedef LMatrix4f LMatrix4; 00115 00116 typedef LVertexf LVertex; 00117 typedef LNormalf LNormal; 00118 typedef LTexCoordf LTexCoord; 00119 typedef LTexCoord3f LTexCoord3; 00120 typedef LColorf LColor; 00121 typedef LRGBColorf LRGBColor; 00122 00123 typedef UnalignedLVecBase4f UnalignedLVecBase4; 00124 typedef UnalignedLMatrix4f UnalignedLMatrix4; 00125 00126 // Bogus typedefs for interrogate and legacy Python code. 00127 #ifdef CPPPARSER 00128 typedef LMatrix4f Mat4; 00129 typedef LMatrix3f Mat3; 00130 typedef LVecBase4f VBase4; 00131 typedef LVector4f Vec4; 00132 typedef LPoint4f Point4; 00133 typedef LVecBase3f VBase3; 00134 typedef LVector3f Vec3; 00135 typedef LPoint3f Point3; 00136 typedef LVecBase2f VBase2; 00137 typedef LVector2f Vec2; 00138 typedef LPoint2f Point2; 00139 typedef LQuaternionf Quat; 00140 #endif // CPPPARSER 00141 00142 #else // STDFLOAT_DOUBLE 00143 // The specialty setting--double-precision floats. 00144 00145 typedef LVecBase2d LVecBase2; 00146 typedef LPoint2d LPoint2; 00147 typedef LVector2d LVector2; 00148 typedef LVecBase3d LVecBase3; 00149 typedef LPoint3d LPoint3; 00150 typedef LVector3d LVector3; 00151 typedef LVecBase4d LVecBase4; 00152 typedef LPoint4d LPoint4; 00153 typedef LVector4d LVector4; 00154 typedef LQuaterniond LQuaternion; 00155 typedef LRotationd LRotation; 00156 typedef LOrientationd LOrientation; 00157 typedef LMatrix3d LMatrix3; 00158 typedef LMatrix4d LMatrix4; 00159 00160 typedef LVertexd LVertex; 00161 typedef LNormald LNormal; 00162 typedef LTexCoordd LTexCoord; 00163 typedef LTexCoord3d LTexCoord3; 00164 typedef LColord LColor; 00165 typedef LRGBColord LRGBColor; 00166 00167 typedef UnalignedLVecBase4d UnalignedLVecBase4; 00168 typedef UnalignedLMatrix4d UnalignedLMatrix4; 00169 00170 // Bogus typedefs for interrogate and legacy Python code. 00171 #ifdef CPPPARSER 00172 typedef LMatrix4d Mat4; 00173 typedef LMatrix3d Mat3; 00174 typedef LVecBase4d VBase4; 00175 typedef LVector4d Vec4; 00176 typedef LPoint4d Point4; 00177 typedef LVecBase3d VBase3; 00178 typedef LVector3d Vec3; 00179 typedef LPoint3d Point3; 00180 typedef LVecBase2d VBase2; 00181 typedef LVector2d Vec2; 00182 typedef LPoint2d Point2; 00183 typedef LQuaterniond Quat; 00184 #endif // CPPPARSER 00185 00186 #endif // STDFLOAT_DOUBLE 00187 00188 #endif