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
Utility class which defines the sub-parts of an Entity.
Definition: OgreSubEntity.h:63
SubMesh * mSubMesh
Pointer to the SubMesh defining geometry.
Definition: OgreSubEntity.h:84
Abstract class defining the interface all renderable objects must implement.
#define _OgreExport
Definition: OgrePlatform.h:257
bool mVertexAnimationAppliedThisFrame
Have we applied any vertex animation to geometry?
Summary class collecting together vertex source information.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
bool mRenderQueueIDSet
Flags whether the RenderQueue's default should be used.
Definition: OgreSubEntity.h:98
const Camera * mCachedCamera
The camera for which the cached distance is valid.
float Real
Software floating point type.
Structure for recording the use of temporary blend buffers.
bool mRenderQueuePrioritySet
Flags whether the RenderQueue's default should be used.
Structure recording the use of an automatic parameter.
size_t mIndexEnd
override the end index for the RenderOperation
Definition: OgreSubEntity.h:90
size_t mIndexStart
override the start index for the RenderOperation
Definition: OgreSubEntity.h:87
Defines a part of a complete mesh.
Definition: OgreSubMesh.h:62
ushort mHardwarePoseCount
Number of hardware blended poses supported by material.
bool mVisible
Is this SubEntity visible?
Definition: OgreSubEntity.h:93
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
unsigned short mMaterialLodIndex
The LOD number of the material to use, calculated by Entity::_notifyCurrentCamera.
MaterialPtr mMaterialPtr
Cached pointer to material.
Definition: OgreSubEntity.h:81
unsigned char uint8
Definition: OgrePlatform.h:361
bool _getBuffersMarkedForAnimation(void) const
Are buffers already marked as vertex animated?
_StringBase String
VertexData * mSoftwareVertexAnimVertexData
Vertex data details for software Vertex anim of shared geometry.
uint8 mRenderQueueID
The render queue to use when rendering this renderable.
Definition: OgreSubEntity.h:96
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
TempBlendedBufferInfo mTempVertexAnimInfo
Temp buffer details for software Vertex anim geometry.
void _invalidateCameraCache()
Invalidate the camera distance cache.
Real mCachedCameraDist
Cached distance to last camera for getSquaredViewDepth.
'New' rendering operation using vertex buffers.
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:53
Defines an instance of a discrete, movable object based on a Mesh.
Definition: OgreEntity.h:82
Entity * getParent(void) const
Accessor to get parent Entity.
unsigned short ushort
ushort mRenderQueuePriority
The render queue priority to use when rendering this renderable.
TempBlendedBufferInfo mTempSkelAnimInfo
Quick lookup of buffers.
Manages the organisation and rendering of a 'scene' i.e.
Entity * mParentEntity
Pointer to parent.
Definition: OgreSubEntity.h:78
VertexData * mHardwareVertexAnimVertexData
Vertex data details for hardware Vertex anim of shared geometry.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Collects together the program parameters used for a GpuProgram.
VertexData * mSkelAnimVertexData
Blend buffer details for dedicated geometry.

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 Thu Aug 13 2015 23:21:37