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 
130 
131  public:
134  const String& getMaterialName() const;
135 
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 
201 
203  Entity* getParent(void) const { return mParentEntity; }
204 
207  const MaterialPtr& getMaterial(void) const;
208 
211  Technique* getTechnique(void) const;
212 
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 
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;
288 
296  bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
300  void _restoreBuffersForUnusedAnimation(bool hardwareAnimation);
301 
304  const GpuProgramParameters::AutoConstantEntry& constantEntry,
305  GpuProgramParameters* params) const;
306 
309  { mCachedCamera = 0; }
310  };
314 }
315 
316 #include "OgreHeaderSuffix.h"
317 
318 #endif
OgreHeaderSuffix.h
Ogre::HashedVector< Light * >
Ogre::SubEntity::_invalidateCameraCache
void _invalidateCameraCache()
Invalidate the camera distance cache.
Definition: OgreSubEntity.h:308
Ogre::SubEntity::mIndexStart
size_t mIndexStart
override the start index for the RenderOperation
Definition: OgreSubEntity.h:87
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:59
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::SubEntity::mCachedCameraDist
Real mCachedCameraDist
Cached distance to last camera for getSquaredViewDepth.
Definition: OgreSubEntity.h:124
Ogre::SubEntity::mHardwarePoseCount
ushort mHardwarePoseCount
Number of hardware blended poses supported by material.
Definition: OgreSubEntity.h:122
Ogre::SubEntity::resetIndexDataStartEndIndex
void resetIndexDataStartEndIndex()
Reset the custom start/end index to the default values.
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:87
Ogre::SubEntity
Utility class which defines the sub-parts of an Entity.
Definition: OgreSubEntity.h:64
Ogre::SubEntity::mTempSkelAnimInfo
TempBlendedBufferInfo mTempSkelAnimInfo
Quick lookup of buffers.
Definition: OgreSubEntity.h:110
Ogre::SubEntity::getMaterialName
const String & getMaterialName() const
Gets the name of the Material in use by this instance.
Ogre::SubEntity::mMaterialLodIndex
unsigned short mMaterialLodIndex
The LOD number of the material to use, calculated by Entity::_notifyCurrentCamera.
Definition: OgreSubEntity.h:105
Ogre::SubEntity::getParent
Entity * getParent(void) const
Accessor to get parent Entity.
Definition: OgreSubEntity.h:203
Ogre::SubEntity::~SubEntity
virtual ~SubEntity()
Private destructor.
Ogre::SubEntity::isVisible
virtual bool isVisible(void) const
Returns whether or not this SubEntity is supposed to be visible.
Ogre::SubEntity::setRenderQueueGroupAndPriority
virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority)
Sets the render queue group and group priority this SubEntity will be rendered through.
Ogre::SubEntity::getCastsShadows
bool getCastsShadows(void) const
Method which reports whether this renderable would normally cast a shadow.
Ogre::GpuProgramParameters::AutoConstantEntry
Structure recording the use of an automatic parameter.
Definition: OgreGpuProgramParams.h:1216
Ogre::SubEntity::mVisible
bool mVisible
Is this SubEntity visible?
Definition: OgreSubEntity.h:93
Ogre::SubEntity::mSkelAnimVertexData
VertexData * mSkelAnimVertexData
Blend buffer details for dedicated geometry.
Definition: OgreSubEntity.h:108
Ogre::SubEntity::getIndexDataStartIndex
size_t getIndexDataStartIndex() const
Returns the current value of the start index used for drawing.
Ogre::SubEntity::getRenderOperation
void getRenderOperation(RenderOperation &op)
Overridden - see Renderable.
Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Definition: OgreResourceGroupManager.h:270
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::SubEntity::setMaterial
void setMaterial(const MaterialPtr &material)
Sets a Material to be used.
OgreResourceGroupManager.h
Ogre::SubEntity::mMaterialPtr
MaterialPtr mMaterialPtr
Cached pointer to material.
Definition: OgreSubEntity.h:81
Ogre::SubEntity::_getVertexAnimTempBufferInfo
TempBlendedBufferInfo * _getVertexAnimTempBufferInfo(void)
Advanced method to get the temp buffer information for software morph animation.
Ogre::Technique
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:54
Ogre::SubEntity::mCachedCamera
const Camera * mCachedCamera
The camera for which the cached distance is valid.
Definition: OgreSubEntity.h:126
Ogre::SubEntity::_getSkelAnimTempBufferInfo
TempBlendedBufferInfo * _getSkelAnimTempBufferInfo(void)
Advanced method to get the temp buffer information for software skeletal animation.
Ogre::SubEntity::_restoreBuffersForUnusedAnimation
void _restoreBuffersForUnusedAnimation(bool hardwareAnimation)
Internal method to copy original vertex data to the morph structures should there be no active animat...
Ogre::SubEntity::mSoftwareVertexAnimVertexData
VertexData * mSoftwareVertexAnimVertexData
Vertex data details for software Vertex anim of shared geometry.
Definition: OgreSubEntity.h:114
Ogre::Entity
Defines an instance of a discrete, movable object based on a Mesh.
Definition: OgreEntity.h:83
Ogre::SubEntity::mRenderQueueID
uint8 mRenderQueueID
The render queue to use when rendering this renderable.
Definition: OgreSubEntity.h:96
Ogre::VertexData
Summary class collecting together vertex source information.
Definition: OgreVertexIndexData.h:50
Ogre::SubEntity::getRenderQueuePriority
virtual ushort getRenderQueuePriority(void) const
Gets the queue group for this entity, see setRenderQueueGroup for full details.
Ogre::SubEntity::mIndexEnd
size_t mIndexEnd
override the end index for the RenderOperation
Definition: OgreSubEntity.h:90
OgreHeaderPrefix.h
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
Ogre::SubEntity::mRenderQueueIDSet
bool mRenderQueueIDSet
Flags whether the RenderQueue's default should be used.
Definition: OgreSubEntity.h:98
Ogre::SubEntity::_getHardwareVertexAnimVertexData
VertexData * _getHardwareVertexAnimVertexData(void)
Advanced method to get the hardware morph vertex information.
Ogre::SceneManager
Manages the organisation and rendering of a 'scene' i.e.
Definition: OgreSceneManager.h:144
Ogre::SubEntity::setMaterialName
void setMaterialName(const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
Sets the name of the Material to be used.
OgrePrerequisites.h
Ogre::SubEntity::_getSkelAnimVertexData
VertexData * _getSkelAnimVertexData(void)
Advanced method to get the temporarily blended vertex information for entities which are software ski...
Ogre::SubEntity::mRenderQueuePrioritySet
bool mRenderQueuePrioritySet
Flags whether the RenderQueue's default should be used.
Definition: OgreSubEntity.h:102
Ogre::SubMesh
Defines a part of a complete mesh.
Definition: OgreSubMesh.h:63
Ogre::SubEntity::getSquaredViewDepth
Real getSquaredViewDepth(const Camera *cam) const
Overridden, see Renderable.
Ogre::SubEntity::setIndexDataStartIndex
void setIndexDataStartIndex(size_t start_index)
Tells this SubEntity to draw a subset of the SubMesh by adjusting the index buffer extents.
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::SubEntity::isRenderQueueGroupSet
virtual bool isRenderQueueGroupSet(void) const
Gets the queue group for this entity, see setRenderQueueGroup for full details.
Ogre::GpuProgramParameters
Collects together the program parameters used for a GpuProgram.
Definition: OgreGpuProgramParams.h:703
Ogre::SubEntity::getSubMesh
SubMesh * getSubMesh(void)
Accessor method to read mesh data.
Ogre::SubEntity::mParentEntity
Entity * mParentEntity
Pointer to parent.
Definition: OgreSubEntity.h:78
Ogre::SharedPtr< Material >
Ogre::uint8
unsigned char uint8
Definition: OgrePlatform.h:361
OgreRenderable.h
Ogre::SubEntity::getTechnique
Technique * getTechnique(void) const
Overridden - see Renderable.
Ogre::SubEntity::mRenderQueuePriority
ushort mRenderQueuePriority
The render queue priority to use when rendering this renderable.
Definition: OgreSubEntity.h:100
Ogre::TempBlendedBufferInfo
Structure for recording the use of temporary blend buffers.
Definition: OgreHardwareBufferManager.h:72
Ogre::SubEntity::getWorldTransforms
void getWorldTransforms(Matrix4 *xform) const
Overridden - see Renderable.
Ogre::SubEntity::isRenderQueuePrioritySet
virtual bool isRenderQueuePrioritySet(void) const
Gets the queue group for this entity, see setRenderQueueGroup for full details.
Ogre::SubEntity::getNumWorldTransforms
unsigned short getNumWorldTransforms(void) const
Overridden - see Renderable.
Ogre::SubEntity::mHardwareVertexAnimVertexData
VertexData * mHardwareVertexAnimVertexData
Vertex data details for hardware Vertex anim of shared geometry.
Definition: OgreSubEntity.h:118
Ogre::SubEntity::setVisible
virtual void setVisible(bool visible)
Tells this SubEntity whether to be visible or not.
Ogre::Renderable
Abstract class defining the interface all renderable objects must implement.
Definition: OgreRenderable.h:64
Ogre::SubEntity::getLights
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
Ogre::SubEntity::SubEntity
SubEntity(Entity *parent, SubMesh *subMeshBasis)
Private constructor - don't allow creation by anybody else.
Ogre::SubEntity::_markBuffersUnusedForAnimation
void _markBuffersUnusedForAnimation(void)
Mark all vertex data as so far unanimated.
Ogre::SubEntity::setRenderQueueGroup
virtual void setRenderQueueGroup(uint8 queueID)
Sets the render queue group this SubEntity will be rendered through.
Ogre::SubEntity::prepareTempBlendBuffers
void prepareTempBlendBuffers(void)
Internal method for preparing this Entity for use in animation.
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::SubEntity::_getSoftwareVertexAnimVertexData
VertexData * _getSoftwareVertexAnimVertexData(void)
Advanced method to get the temporarily blended software morph vertex information.
Ogre::SubEntity::getIndexDataEndIndex
size_t getIndexDataEndIndex() const
Returns the current value of the start index used for drawing.
OgreHardwareBufferManager.h
Ogre::SubEntity::getRenderQueueGroup
virtual uint8 getRenderQueueGroup(void) const
Gets the queue group for this entity, see setRenderQueueGroup for full details.
Ogre::SubEntity::getMaterial
const MaterialPtr & getMaterial(void) const
Overridden - see Renderable.
Ogre::SubEntity::_updateCustomGpuParameter
void _updateCustomGpuParameter(const GpuProgramParameters::AutoConstantEntry &constantEntry, GpuProgramParameters *params) const
Overridden from Renderable to provide some custom behaviour.
OgreString.h
Ogre::SubEntity::setIndexDataEndIndex
void setIndexDataEndIndex(size_t end_index)
Tells this SubEntity to draw a subset of the SubMesh by adjusting the index buffer extents.
Ogre::SubEntity::mTempVertexAnimInfo
TempBlendedBufferInfo mTempVertexAnimInfo
Temp buffer details for software Vertex anim geometry.
Definition: OgreSubEntity.h:112
Ogre::SubEntity::mSubMesh
SubMesh * mSubMesh
Pointer to the SubMesh defining geometry.
Definition: OgreSubEntity.h:84
Ogre::SubEntity::_getBuffersMarkedForAnimation
bool _getBuffersMarkedForAnimation(void) const
Are buffers already marked as vertex animated?
Definition: OgreSubEntity.h:296
Ogre::SubEntity::getVertexDataForBinding
VertexData * getVertexDataForBinding(void)
Retrieve the VertexData which should be used for GPU binding.
Ogre::RenderOperation
'New' rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
Ogre::SubEntity::_markBuffersUsedForAnimation
void _markBuffersUsedForAnimation(void)
Mark all vertex data as animated.
Ogre::SubEntity::mVertexAnimationAppliedThisFrame
bool mVertexAnimationAppliedThisFrame
Have we applied any vertex animation to geometry?
Definition: OgreSubEntity.h:120

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.