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

OgreMeshManager.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __MeshManager_H__
00026 #define __MeshManager_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 #include "OgreResourceManager.h"
00031 #include "OgreSingleton.h"
00032 #include "OgreVector3.h"
00033 #include "OgreHardwareBuffer.h"
00034 #include "OgrePatchMesh.h"
00035 
00036 namespace Ogre {
00037 
00045     class _OgreExport MeshManager: public ResourceManager, public Singleton<MeshManager>
00046     {
00047     public:
00048         MeshManager();
00049 
00051         void _initialise(void);
00052 
00072         Mesh* load( const String& filename, 
00073             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
00074             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
00075             bool vertexBufferSysMem = false, bool indexBufferSysMem = false,
00076             int priority = 1);
00077 
00082         Resource* create( const String& name);
00083 
00092         Mesh* createManual( const String& name);
00093 
00131         Mesh* createPlane(
00132             const String& name, const Plane& plane,
00133             Real width, Real height,
00134             int xsegments = 1, int ysegments = 1,
00135             bool normals = true, int numTexCoordSets = 1,
00136             Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
00137             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
00138             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
00139             bool vertexShadowBuffer = false, bool indexShadowBuffer = false);
00140 
00141         
00187         Mesh* createCurvedIllusionPlane(
00188             const String& name, const Plane& plane,
00189             Real width, Real height, Real curvature,
00190             int xsegments = 1, int ysegments = 1,
00191             bool normals = true, int numTexCoordSets = 1,
00192             Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
00193             const Quaternion& orientation = Quaternion::IDENTITY,
00194             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
00195             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
00196             bool vertexShadowBuffer = false, bool indexShadowBuffer = false);
00197 
00237         Mesh* createCurvedPlane( 
00238             const String& name, const Plane& plane, 
00239             Real width, Real height, Real bow = 0.5f, 
00240             int xsegments = 1, int ysegments = 1,
00241             bool normals = false, int numTexCoordSets = 1, 
00242             Real xTile = 1.0f, Real yTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
00243             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
00244             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
00245             bool vertexShadowBuffer = false, bool indexShadowBuffer = false);
00246 
00279         PatchMesh* createBezierPatch(
00280             const String& name, void* controlPointBuffer, 
00281             VertexDeclaration *declaration, size_t width, size_t height,
00282             size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL, 
00283             size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
00284             PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
00285             HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
00286             HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
00287             bool vbUseShadow = false, bool ibUseShadow = false);
00288         
00300         static MeshManager& getSingleton(void);
00301 
00302     protected:
00305         void tesselate2DMesh(SubMesh* pSub, int meshWidth, int meshHeight, 
00306             bool doubleSided = false, 
00307             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
00308             bool indexSysMem = false);
00309 
00310         void createPrefabPlane(void);
00311     };
00312 
00313 
00314 } //namespace
00315 
00316 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:18 2004