OgreSubEntity.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __SubEntity_H__
29 #define __SubEntity_H__
30 
31 #include "OgrePrerequisites.h"
32 
33 #include "OgreString.h"
34 #include "OgreRenderable.h"
37 #include "OgreHeaderPrefix.h"
38 
39 namespace Ogre {
40 
64  {
65  // Note no virtual functions for efficiency
66  friend class Entity;
67  friend class SceneManager;
68  protected:
71  SubEntity(Entity* parent, SubMesh* subMeshBasis);
72 
75  virtual ~SubEntity();
76 
79 
82 
85 
87  size_t mIndexStart;
88 
90  size_t mIndexEnd;
91 
93  bool mVisible;
94 
103 
105  unsigned short mMaterialLodIndex;
106 
126  mutable const Camera *mCachedCamera;
127 
129  void prepareTempBlendBuffers(void);
130 
131  public:
134  const String& getMaterialName() const;
135 
142  void setMaterialName( const String& name, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
143 
150  void setMaterial( const MaterialPtr& material );
151 
153  virtual void setVisible(bool visible);
154 
156  virtual bool isVisible(void) const;
157 
169  virtual void setRenderQueueGroup(uint8 queueID);
170 
184  virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority);
185 
187  virtual uint8 getRenderQueueGroup(void) const;
188 
190  virtual ushort getRenderQueuePriority(void) const;
191 
193  virtual bool isRenderQueueGroupSet(void) const;
194 
196  virtual bool isRenderQueuePrioritySet(void) const;
197 
200  SubMesh* getSubMesh(void);
201 
203  Entity* getParent(void) const { return mParentEntity; }
204 
207  const MaterialPtr& getMaterial(void) const;
208 
211  Technique* getTechnique(void) const;
212 
215  void getRenderOperation(RenderOperation& op);
216 
221  void setIndexDataStartIndex(size_t start_index);
222 
226  size_t getIndexDataStartIndex() const;
227 
232  void setIndexDataEndIndex(size_t end_index);
233 
236  size_t getIndexDataEndIndex() const;
237 
240  void resetIndexDataStartEndIndex();
241 
244  void getWorldTransforms(Matrix4* xform) const;
247  unsigned short getNumWorldTransforms(void) const;
249  Real getSquaredViewDepth(const Camera* cam) const;
251  const LightList& getLights(void) const;
253  bool getCastsShadows(void) const;
263  VertexData* _getSkelAnimVertexData(void);
272  VertexData* _getSoftwareVertexAnimVertexData(void);
277  VertexData* _getHardwareVertexAnimVertexData(void);
281  TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void);
285  TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void);
287  VertexData* getVertexDataForBinding(void);
288 
291  void _markBuffersUnusedForAnimation(void);
294  void _markBuffersUsedForAnimation(void);
296  bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
300  void _restoreBuffersForUnusedAnimation(bool hardwareAnimation);
301 
303  void _updateCustomGpuParameter(
304  const GpuProgramParameters::AutoConstantEntry& constantEntry,
305  GpuProgramParameters* params) const;
306 
309  { mCachedCamera = 0; }
310  };
314 }
315 
316 #include "OgreHeaderSuffix.h"
317 
318 #endif

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Oct 23 2013 06:57:25