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
    00074         Mesh* load( const String& filename,
    00075             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00076             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00077             bool vertexBufferShadowed = true, bool indexBufferShadowed = true,
    00078             int priority = 1);
    00079
    00084         Resource* create( const String& name);
    00085
    00094         Mesh* createManual( const String& name);
    00095
    00133         Mesh* createPlane(
    00134             const String& name, const Plane& plane,
    00135             Real width, Real height,
    00136             int xsegments = 1, int ysegments = 1,
    00137             bool normals = true, int numTexCoordSets = 1,
    00138             Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
    00139             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00140             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00141             bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
    00142
    00143
    00192         Mesh* createCurvedIllusionPlane(
    00193             const String& name, const Plane& plane,
    00194             Real width, Real height, Real curvature,
    00195             int xsegments = 1, int ysegments = 1,
    00196             bool normals = true, int numTexCoordSets = 1,
    00197             Real uTile = 1.0f, Real vTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
    00198             const Quaternion& orientation = Quaternion::IDENTITY,
    00199             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00200             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00201             bool vertexShadowBuffer = true, bool indexShadowBuffer = true,
    00202             int ySegmentsToKeep = -1);
    00203
    00243         Mesh* createCurvedPlane(
    00244             const String& name, const Plane& plane,
    00245             Real width, Real height, Real bow = 0.5f,
    00246             int xsegments = 1, int ysegments = 1,
    00247             bool normals = false, int numTexCoordSets = 1,
    00248             Real xTile = 1.0f, Real yTile = 1.0f, const Vector3& upVector = Vector3::UNIT_Y,
    00249             HardwareBuffer::Usage vertexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00250             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00251             bool vertexShadowBuffer = true, bool indexShadowBuffer = true);
    00252
    00285         PatchMesh* createBezierPatch(
    00286             const String& name, void* controlPointBuffer,
    00287             VertexDeclaration *declaration, size_t width, size_t height,
    00288             size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
    00289             size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
    00290             PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
    00291             HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00292             HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
    00293             bool vbUseShadow = true, bool ibUseShadow = true);
    00294
    00298         void setPrepareAllMeshesForShadowVolumes(bool enable);
    00300         bool getPrepareAllMeshesForShadowVolumes(void);
    00301
    00317         static MeshManager& getSingleton(void);
    00333         static MeshManager* getSingletonPtr(void);
    00334
    00335     /*
    00336     *Gets the factor by which the bounding box of an entity is padded
    00337     *Default is 0.01
    00338     */
    00339         Real MeshManager::getBoundsPaddingFactor(void);
    00340
    00341     /*
    00342     *Gets the factor by which the bounding box of an entity is padded
    00343     */
    00344         void MeshManager::setBoundsPaddingFactor(Real paddingFactor);
    00345
    00346     protected:
    00349         void tesselate2DMesh(SubMesh* pSub, int meshWidth, int meshHeight,
    00350             bool doubleSided = false,
    00351             HardwareBuffer::Usage indexBufferUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY,
    00352             bool indexSysMem = false);
    00353
    00354         void createPrefabPlane(void);
    00355
    00356         bool mPrepAllMeshesForShadowVolumes;
    00357
    00358     //the factor by which the bounding box of an entity is padded
    00359     Real mBoundsPaddingFactor;
    00360     };
    00361
    00362
    00363 } //namespace
    00364
    00365 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:35 2004