00001 // Filename: luse.h 00002 // Created by: drose (13Jan99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef LUSE_H 00020 #define LUSE_H 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // 00024 // This file defines a number of vector-based classes that are 00025 // designed for specific uses. These all inherit from 00026 // LVecBase[234][fd], which is the base of all linear algebra vectors. 00027 // 00028 // LPoint[234][fd] 00029 // 00030 // This should be used to represent a specific point in space. It 00031 // inherits most properties from LVecBase. 00032 // 00033 // LVector[234][fd] 00034 // 00035 // This should be used to represent a vector, or a distance between 00036 // two points in space. 00037 // 00038 // The distinction between LPoint and LVector is worth emphasizing. 00039 // They differ in some subtle typing behavior (vector - vector = 00040 // vector, point + vector = point, point - point = vector) and also in 00041 // the way they are transformed when multiplied by a matrix (a point 00042 // gets the translation component of the matrix, while the vector does 00043 // not). Also, vector has length() and normalize() functions defined 00044 // for it, while point does not. 00045 // 00046 // LPoint and LVector should be used whenever the concept of "point" 00047 // or "vector" applies. If neither applies--for instance, if you are 00048 // storing a plane equation or some such nonsense--use the base class, 00049 // LVecBase. 00050 // 00051 // This file also typedefs the following: 00052 // 00053 // Vertex[fd] 00054 // Normal[fd] 00055 // TexCoord[fd] 00056 // Color[fd] 00057 // RGBColor[fd] 00058 // 00059 // These classes are typedefs of LPoint or LVector, as appropriate, 00060 // and are intended to store a specific kind of rendering attribute. 00061 // (Color is a four-component color; RGBColor is three-component.) 00062 // 00063 //////////////////////////////////////////////////////////////////// 00064 00065 #include <pandabase.h> 00066 00067 #include "lvec2_ops.h" 00068 #include "lvec3_ops.h" 00069 #include "lvec4_ops.h" 00070 #include "lmat_ops.h" 00071 #include "lmatrix.h" 00072 #include "lquaternion.h" 00073 #include "lrotation.h" 00074 #include "lorientation.h" 00075 #include "lcast_to.h" 00076 00077 //ensure FLOATTYPE is set to float for macros are used outside of LINMATH 00078 #include "fltnames.h" 00079 00080 // This macro defines the cast-to-another-numeric-type operator for 00081 // all of the things defined in this package. It works by virtue of 00082 // there being an appropriate lcast_to() template function defined for 00083 // each class. 00084 00085 #define LCAST(numeric_type, object) lcast_to((numeric_type *)0, object) 00086 00087 00088 // Now we define some handy typedefs for these classes. 00089 typedef LPoint3f Vertexf; 00090 typedef LVector3f Normalf; 00091 typedef LPoint2f TexCoordf; 00092 typedef LVecBase4f Colorf; 00093 typedef LVecBase3f RGBColorf; 00094 00095 typedef LPoint3d Vertexd; 00096 typedef LVector3d Normald; 00097 typedef LPoint2d TexCoordd; 00098 typedef LVecBase4d Colord; 00099 typedef LVecBase3d RGBColord; 00100 00101 00102 #endif 00103