Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

submesh.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                    submesh.h  -  Part of mesh, single material
00003                              -------------------
00004     begin                : Wed Sep 18 2002
00005     copyright            : (C) 2002 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, submesh.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NESUBMESH_H
00028 #define __NESUBMESH_H
00029 
00030 
00037 #include "base.h"
00038 #include "material.h"
00039 #include "vertexbuffer.h"
00040 #include "polygonbuffer.h"
00041 #include "updateentity.h"
00042 
00043 
00044 namespace NeoEngine
00045 {
00046 
00047 
00048 // External classes
00049 class Frustum;
00050 class RenderPrimitive;
00051 
00052 
00059 class NEOENGINE_API SubMesh : public virtual UpdateEntity
00060 {
00061     public:
00062 
00066         enum SUBMESHTYPE
00067         {
00069           SUBMESH                      = 0x0001,
00070 
00072           ANIMATEDSUBMESH              = 0x0002,
00073 
00075           SKELETALSUBMESH              = 0x0003,
00076 
00078           PATCHSURFACE                 = 0x0004
00079         };
00080 
00081 
00082     protected:
00083 
00085         VertexBufferPtr                m_pkVertices;
00086 
00088         PolygonBufferPtr               m_pkPolygons;
00089 
00091         bool                           m_bNeedUpdate;
00092 
00094         VertexBufferPtr                m_pkShadowVertices;
00095 
00097         PolygonBufferPtr               m_pkShadowPolygons;
00098 
00102         virtual void                   UpdateData();
00103 
00104 
00105 
00106     public:
00107 
00109         MaterialPtr                    m_pkMaterial;
00110 
00112         bool                           m_bChanged;
00113 
00114 
00117                                        SubMesh();
00118 
00122                                        SubMesh( const SubMesh &rkSubMesh );
00123 
00126         virtual                       ~SubMesh();
00127 
00132         virtual void                   Update( float fDeltaTime );
00133 
00137         virtual VertexBufferPtr       &GetVertexBuffer() { if( m_bNeedUpdate ) UpdateData(); return m_pkVertices; }
00138 
00142         virtual PolygonBufferPtr      &GetPolygonBuffer() { if( m_bNeedUpdate ) UpdateData(); return m_pkPolygons; }
00143 
00147         virtual void                   SetVertexBuffer( VertexBufferPtr pkVertices );
00148 
00152         virtual void                   SetPolygonBuffer( PolygonBufferPtr pkPolygons );
00153 
00157         virtual void                   SetShadowVertexBuffer( VertexBufferPtr pkVertices );
00158 
00162         virtual void                   SetShadowPolygonBuffer( PolygonBufferPtr pkPolygons );
00163 
00167         virtual SubMesh               *Duplicate() const;
00168 
00172         virtual unsigned int           GetType() const { return SUBMESH; }
00173 
00179         virtual void                   Render( RenderPrimitive *pkPrimitive, Frustum *pkFrustum = 0 );
00180 };
00181 
00182 
00183 };
00184 
00185 
00186 #endif
00187 

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5