llpatchvertexarray.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLPATCHVERTEXARRAY_H
00033 #define LL_LLPATCHVERTEXARRAY_H
00034 
00035 // A LLPatchVertexArray is really just a structure of vertex arrays for
00036 // rendering a "patch" of a certain size.
00037 //
00038 // A "patch" is currently a sub-square of a larger square array of data
00039 // we call a "surface".
00040 class LLPatchVertexArray 
00041 {
00042 public:
00043         LLPatchVertexArray();
00044         LLPatchVertexArray(U32 surface_width, U32 patch_width, F32 meters_per_grid);   
00045         virtual ~LLPatchVertexArray();
00046 
00047         void create(U32 surface_width, U32 patch_width, F32 meters_per_grid); 
00048         void destroy();
00049         void init();
00050 
00051 public:
00052         U32 mSurfaceWidth;      // grid points on one side of a LLSurface
00053         U32 mPatchWidth;        // grid points on one side of a LLPatch
00054         U32 mPatchOrder;        // 2^mPatchOrder >= mPatchWidth
00055 
00056         U32 *mRenderLevelp;     // Look-up table  : render_stride -> render_level
00057         U32 *mRenderStridep; // Look-up table : render_level -> render_stride
00058 
00059         // We want to be able to render a patch from multiple resolutions.
00060         // The lowest resolution has two triangles, and the highest has 
00061         // 2*mPatchWidth*mPatchWidth triangles. 
00062         //
00063         // mPatchWidth is not hard-coded, so we don't know how much memory 
00064         // to allocate to the vertex arrays until it is set.  Once it is
00065         // set, we will calculate how much total memory to allocate for the
00066         // vertex arrays, and then keep track of their lengths and locations 
00067         // in the memory bank.
00068         // 
00069         // A Patch has three regions that need vertex arrays: middle, north, 
00070         // and east.  For each region there are three items that must be 
00071         // kept track of: data, offset, and length.
00072 };
00073 
00074 #endif

Generated on Thu Jul 1 06:09:00 2010 for Second Life Viewer by  doxygen 1.4.7