PixelLightAPI  .
GMMSurfaceLevel.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: GMMSurfaceLevel.h                              *
00003  *
00004  *  Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLSCENE_SCENENODE_GMMSURFACELEVEL_H__
00024 #define __PLSCENE_SCENENODE_GMMSURFACELEVEL_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLScene/PLScene.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Forward declarations                                  ]
00036 //[-------------------------------------------------------]
00037 namespace PLRenderer {
00038     class Renderer;
00039     class IndexBuffer;
00040 }
00041 
00042 
00043 //[-------------------------------------------------------]
00044 //[ Namespace                                             ]
00045 //[-------------------------------------------------------]
00046 namespace PLScene {
00047 
00048 
00049 //[-------------------------------------------------------]
00050 //[ Classes                                               ]
00051 //[-------------------------------------------------------]
00052 /**
00053 *  @brief
00054 *    GMM surface geometrically mip mapping level
00055 */
00056 class GMMSurfaceLevel {
00057 
00058 
00059     //[-------------------------------------------------------]
00060     //[ Friends                                               ]
00061     //[-------------------------------------------------------]
00062     friend class GMMSurface;
00063 
00064 
00065     //[-------------------------------------------------------]
00066     //[ Public structures                                     ]
00067     //[-------------------------------------------------------]
00068     public:
00069         /**
00070         *  @brief
00071         *    GMM surface level body piece
00072         **/
00073         struct BodyPiece {
00074             PLCore::uint32          *pnIndexBuffer;         /**< Can be a null pointer */
00075             PLCore::uint32           nIndexBufferSize;
00076             PLRenderer::IndexBuffer *pIndexBuffer;          /**< Can be a null pointer */
00077 
00078             PLCore::uint32          *pnCornerIndexBuffer;   /**< Can be a null pointer */
00079             PLCore::uint32           nCornerIndexSize;
00080             PLRenderer::IndexBuffer *pCornerIndexBuffer;    /**< Can be a null pointer */
00081         };
00082 
00083         /**
00084         *  @brief
00085         *    GMM surface level linking piece
00086         **/
00087         struct LinkingPiece {
00088             PLCore::uint32          *pnIndexBuffer[4];      /**< Can be a null pointer */
00089             PLCore::uint32           nIndexBufferSize[4];
00090             PLRenderer::IndexBuffer *pIndexBuffer[4];       /**< Can be a null pointer */
00091         };
00092 
00093 
00094     //[-------------------------------------------------------]
00095     //[ Public functions                                      ]
00096     //[-------------------------------------------------------]
00097     public:
00098         /**
00099         *  @brief
00100         *    Constructor
00101         *
00102         *  @param[in] cRenderer
00103         *    Renderer to use
00104         */
00105         PLS_API GMMSurfaceLevel(PLRenderer::Renderer &cRenderer);
00106 
00107         /**
00108         *  @brief
00109         *    Destructor
00110         */
00111         PLS_API ~GMMSurfaceLevel();
00112 
00113         /**
00114         *  @brief
00115         *    Builds the bodies
00116         *
00117         *  @param[in] nLevel
00118         *    Number of geo mip map levels
00119         *  @param[in] nPatchSize
00120         *    Patch size
00121         */
00122         PLS_API void BuildBodies(PLCore::uint32 nLevel, PLCore::uint32 nPatchSize);
00123 
00124         /**
00125         *  @brief
00126         *    Builds the linkers
00127         *
00128         *  @param[in] nLevel
00129         *    Number of geo mip map levels
00130         *  @param[in] nPatchSize
00131         *    Patch size
00132         */
00133         PLS_API void BuildLinkers(PLCore::uint32 nLevel, PLCore::uint32 nPatchSize);
00134 
00135 
00136     //[-------------------------------------------------------]
00137     //[ Private definitions                                   ]
00138     //[-------------------------------------------------------]
00139     private:
00140         /**
00141         *  @brief
00142         *    Side
00143         */
00144         enum ESide {
00145             Right,  /**< Right side */
00146             Top,    /**< Top side */
00147             Left,   /**< Left side */
00148             Bottom  /**< Bottom side */
00149         };
00150 
00151 
00152     //[-------------------------------------------------------]
00153     //[ Private data                                          ]
00154     //[-------------------------------------------------------]
00155     private:
00156         PLRenderer::Renderer *m_pRenderer;  /**< Used renderer (always valid!) */
00157         PLCore::uint32        m_nLevels;    /**< Number of levels */
00158         BodyPiece            *m_pBodies;    /**< Bodies, can be a null pointer */
00159         LinkingPiece         *m_pLinkers;   /**< Linkers, can be a null pointer */
00160 
00161 
00162 };
00163 
00164 
00165 //[-------------------------------------------------------]
00166 //[ Namespace                                             ]
00167 //[-------------------------------------------------------]
00168 } // PLScene
00169 
00170 
00171 #endif // __PLSCENE_SCENENODE_GMMSURFACELEVEL_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:50:56
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported