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

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 
00082         unsigned short mMaterialLodIndex;
00083 
00085         VertexData* mSkelAnimVertexData;
00087         TempBlendedBufferInfo mTempSkelAnimInfo;
00089         TempBlendedBufferInfo mTempVertexAnimInfo;
00091         VertexData* mSoftwareVertexAnimVertexData;
00095         VertexData* mHardwareVertexAnimVertexData;
00097         bool mVertexAnimationAppliedThisFrame;
00099         ushort mHardwarePoseCount;
00100 
00102         void prepareTempBlendBuffers(void);
00103 
00104     public:
00107         const String& getMaterialName() const;
00108 
00115         void setMaterialName( const String& name );
00116 
00118         virtual void setVisible(bool visible);
00119 
00121         virtual bool isVisible(void) const;
00122 
00125         SubMesh* getSubMesh(void);
00126 
00128         Entity* getParent(void) const { return mParentEntity; }
00129 
00132         const MaterialPtr& getMaterial(void) const;
00133 
00136         Technique* getTechnique(void) const;
00137 
00140         void getRenderOperation(RenderOperation& op);
00141 
00144         void getWorldTransforms(Matrix4* xform) const;
00146         const Quaternion& getWorldOrientation(void) const;
00148         const Vector3& getWorldPosition(void) const;
00151         bool getNormaliseNormals(void) const;      
00154         unsigned short getNumWorldTransforms(void) const;
00156         Real getSquaredViewDepth(const Camera* cam) const;
00158         const LightList& getLights(void) const;
00160         bool getCastsShadows(void) const;
00170         VertexData* _getSkelAnimVertexData(void);
00179         VertexData* _getSoftwareVertexAnimVertexData(void);
00184         VertexData* _getHardwareVertexAnimVertexData(void);
00188         TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void);
00192         TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void);
00194         VertexData* getVertexDataForBinding(void);
00195 
00198         void _markBuffersUnusedForAnimation(void);
00201         void _markBuffersUsedForAnimation(void);
00203         bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
00207         void _restoreBuffersForUnusedAnimation(bool hardwareAnimation);
00208 
00210         void _updateCustomGpuParameter(
00211             const GpuProgramParameters::AutoConstantEntry& constantEntry,
00212             GpuProgramParameters* params) const;
00213     };
00214 
00215 }
00216 
00217 
00218 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jan 21 10:01:39 2007