# OgreSubEntity.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 (c) 2000-2005 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 __SubEntity_H__
    00026 #define __SubEntity_H__
    00027
    00028 #include "OgrePrerequisites.h"
    00029
    00030 #include "OgreString.h"
    00031 #include "OgreRenderable.h"
    00032 #include "OgreHardwareBufferManager.h"
    00033
    00034 namespace Ogre {
    00035
    00052     class _OgreExport SubEntity: public Renderable
    00053     {
    00054         // Note no virtual functions for efficiency
    00055         friend class Entity;
    00056         friend class SceneManager;
    00057     protected:
    00060         SubEntity(Entity* parent, SubMesh* subMeshBasis);
    00061
    00064         virtual ~SubEntity();
    00065
    00067         Entity* mParentEntity;
    00068
    00070         String mMaterialName;
    00071
    00073         MaterialPtr mpMaterial;
    00074
    00075         // Pointer to the SubMesh defining geometry.
    00076         SubMesh* mSubMesh;
    00077
    00079         bool mVisible;
    00080
    00081         SceneDetailLevel mRenderDetail;
    00083         unsigned short mMaterialLodIndex;
    00084
    00086         VertexData* mBlendedVertexData;
    00088         TempBlendedBufferInfo mTempBlendedBuffer;
    00090         void prepareTempBlendBuffers(void);
    00091
    00092     public:
    00095         const String& getMaterialName() const;
    00096
    00103         void setMaterialName( const String& name );
    00104
    00106         virtual void setVisible(bool visible);
    00107
    00109         virtual bool isVisible(void) const;
    00110
    00113         SubMesh* getSubMesh(void);
    00114
    00117         const MaterialPtr& getMaterial(void) const;
    00118
    00121         Technique* getTechnique(void) const;
    00122
    00125         void getRenderOperation(RenderOperation& op);
    00126
    00129         void getWorldTransforms(Matrix4* xform) const;
    00131         const Quaternion& getWorldOrientation(void) const;
    00133         const Vector3& getWorldPosition(void) const;
    00136         bool getNormaliseNormals(void) const;
    00139         unsigned short getNumWorldTransforms(void) const;
    00141         Real getSquaredViewDepth(const Camera* cam) const;
    00143         void setRenderDetail(SceneDetailLevel renderDetail) { mRenderDetail = renderDetail; }
    00145         SceneDetailLevel getRenderDetail() const {return mRenderDetail;}
    00147         const LightList& getLights(void) const;
    00149         const VertexData* getBlendedVertexData(void) { return mBlendedVertexData; }
    00151         bool getCastsShadows(void) const;
    00155         const VertexData* _getBlendedVertexData(void) const;
    00156     };
    00157
    00158 }
    00159
    00160
    00161 #endif

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:53 2006