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 00129 const MaterialPtr& getMaterial(void) const; 00130 00133 Technique* getTechnique(void) const; 00134 00137 void getRenderOperation(RenderOperation& op); 00138 00141 void getWorldTransforms(Matrix4* xform) const; 00143 const Quaternion& getWorldOrientation(void) const; 00145 const Vector3& getWorldPosition(void) const; 00148 bool getNormaliseNormals(void) const; 00151 unsigned short getNumWorldTransforms(void) const; 00153 Real getSquaredViewDepth(const Camera* cam) const; 00155 const LightList& getLights(void) const; 00157 bool getCastsShadows(void) const; 00167 VertexData* _getSkelAnimVertexData(void); 00176 VertexData* _getSoftwareVertexAnimVertexData(void); 00181 VertexData* _getHardwareVertexAnimVertexData(void); 00185 TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void); 00189 TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void); 00191 VertexData* getVertexDataForBinding(void); 00192 00195 void _markBuffersUnusedForAnimation(void); 00198 void _markBuffersUsedForAnimation(void); 00200 bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; } 00204 void _restoreBuffersForUnusedAnimation(bool hardwareAnimation); 00205 00207 void _updateCustomGpuParameter( 00208 const GpuProgramParameters::AutoConstantEntry& constantEntry, 00209 GpuProgramParameters* params) const; 00210 }; 00211 00212 } 00213 00214 00215 #endif
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:50 2006