OgreSubEntity.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __SubEntity_H__
#define __SubEntity_H__
#include "OgrePrerequisites.h"
#include "OgreString.h"
#include "OgreRenderable.h"
#include "OgreHardwareBufferManager.h"
#include "OgreResourceGroupManager.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport SubEntity: public Renderable, public SubEntityAlloc
{
// Note no virtual functions for efficiency
friend class Entity;
friend class SceneManager;
protected:
SubEntity(Entity* parent, SubMesh* subMeshBasis);
virtual ~SubEntity();
Entity* mParentEntity;
MaterialPtr mMaterialPtr;
SubMesh* mSubMesh;
size_t mIndexStart;
size_t mIndexEnd;
bool mVisible;
uint8 mRenderQueueID;
bool mRenderQueueIDSet;
ushort mRenderQueuePriority;
bool mRenderQueuePrioritySet;
unsigned short mMaterialLodIndex;
VertexData* mSkelAnimVertexData;
TempBlendedBufferInfo mTempSkelAnimInfo;
TempBlendedBufferInfo mTempVertexAnimInfo;
VertexData* mSoftwareVertexAnimVertexData;
VertexData* mHardwareVertexAnimVertexData;
bool mVertexAnimationAppliedThisFrame;
ushort mHardwarePoseCount;
mutable Real mCachedCameraDist;
mutable const Camera *mCachedCamera;
void prepareTempBlendBuffers(void);
public:
const String& getMaterialName() const;
void setMaterialName( const String& name, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
void setMaterial( const MaterialPtr& material );
virtual void setVisible(bool visible);
virtual bool isVisible(void) const;
virtual void setRenderQueueGroup(uint8 queueID);
virtual void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority);
virtual uint8 getRenderQueueGroup(void) const;
virtual ushort getRenderQueuePriority(void) const;
virtual bool isRenderQueueGroupSet(void) const;
virtual bool isRenderQueuePrioritySet(void) const;
SubMesh* getSubMesh(void);
Entity* getParent(void) const { return mParentEntity; }
const MaterialPtr& getMaterial(void) const;
Technique* getTechnique(void) const;
void getRenderOperation(RenderOperation& op);
void setIndexDataStartIndex(size_t start_index);
size_t getIndexDataStartIndex() const;
void setIndexDataEndIndex(size_t end_index);
size_t getIndexDataEndIndex() const;
void resetIndexDataStartEndIndex();
void getWorldTransforms(Matrix4* xform) const;
unsigned short getNumWorldTransforms(void) const;
Real getSquaredViewDepth(const Camera* cam) const;
const LightList& getLights(void) const;
bool getCastsShadows(void) const;
VertexData* _getSkelAnimVertexData(void);
VertexData* _getSoftwareVertexAnimVertexData(void);
VertexData* _getHardwareVertexAnimVertexData(void);
TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void);
TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void);
VertexData* getVertexDataForBinding(void);
void _markBuffersUnusedForAnimation(void);
void _markBuffersUsedForAnimation(void);
bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
void _restoreBuffersForUnusedAnimation(bool hardwareAnimation);
void _updateCustomGpuParameter(
const GpuProgramParameters::AutoConstantEntry& constantEntry,
GpuProgramParameters* params) const;
void _invalidateCameraCache ()
{ mCachedCamera = 0; }
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::SubEntity::getParent
Entity * getParent(void) const
Accessor to get parent Entity.
Definition: OgreSubEntity.h:203
Ogre::SubEntity
Utility class which defines the sub-parts of an Entity.
Definition: OgreSubEntity.h:63
Ogre::SubEntity::mSubMesh
SubMesh * mSubMesh
Pointer to the SubMesh defining geometry.
Definition: OgreSubEntity.h:84
Ogre::Renderable
Abstract class defining the interface all renderable objects must implement.
Definition: OgreRenderable.h:63
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
OgreRenderable.h
Ogre::SubEntity::mVertexAnimationAppliedThisFrame
bool mVertexAnimationAppliedThisFrame
Have we applied any vertex animation to geometry?
Definition: OgreSubEntity.h:120
Ogre::VertexData
Summary class collecting together vertex source information.
Definition: OgreVertexIndexData.h:49
Ogre::SubEntity::_getBuffersMarkedForAnimation
bool _getBuffersMarkedForAnimation(void) const
Are buffers already marked as vertex animated?
Definition: OgreSubEntity.h:296
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::SubEntity::mRenderQueueIDSet
bool mRenderQueueIDSet
Flags whether the RenderQueue&#39;s default should be used.
Definition: OgreSubEntity.h:98
Ogre::SubEntity::mCachedCamera
const Camera * mCachedCamera
The camera for which the cached distance is valid.
Definition: OgreSubEntity.h:126
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
OgreString.h
Ogre::TempBlendedBufferInfo
Structure for recording the use of temporary blend buffers.
Definition: OgreHardwareBufferManager.h:71
Ogre::SubEntity::mRenderQueuePrioritySet
bool mRenderQueuePrioritySet
Flags whether the RenderQueue&#39;s default should be used.
Definition: OgreSubEntity.h:102
Ogre::GpuProgramParameters::AutoConstantEntry
Structure recording the use of an automatic parameter.
Definition: OgreGpuProgramParams.h:1215
Ogre::SubEntity::mIndexEnd
size_t mIndexEnd
override the end index for the RenderOperation
Definition: OgreSubEntity.h:90
Ogre::SubEntity::mIndexStart
size_t mIndexStart
override the start index for the RenderOperation
Definition: OgreSubEntity.h:87
OgreHardwareBufferManager.h
Ogre::SubMesh
Defines a part of a complete mesh.
Definition: OgreSubMesh.h:62
Ogre::SubEntity::mHardwarePoseCount
ushort mHardwarePoseCount
Number of hardware blended poses supported by material.
Definition: OgreSubEntity.h:122
Ogre::SubEntity::mVisible
bool mVisible
Is this SubEntity visible?
Definition: OgreSubEntity.h:93
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::SubEntity::mMaterialLodIndex
unsigned short mMaterialLodIndex
The LOD number of the material to use, calculated by Entity::_notifyCurrentCamera.
Definition: OgreSubEntity.h:105
OgrePrerequisites.h
Ogre::HashedVector
A hashed vector.
Definition: OgreCommon.h:332
Ogre::SubEntity::mMaterialPtr
MaterialPtr mMaterialPtr
Cached pointer to material.
Definition: OgreSubEntity.h:81
Ogre::uint8
unsigned char uint8
Definition: OgrePlatform.h:361
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::SubEntity::mSoftwareVertexAnimVertexData
VertexData * mSoftwareVertexAnimVertexData
Vertex data details for software Vertex anim of shared geometry.
Definition: OgreSubEntity.h:114
Ogre::SubEntity::mRenderQueueID
uint8 mRenderQueueID
The render queue to use when rendering this renderable.
Definition: OgreSubEntity.h:96
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
OgreHeaderSuffix.h
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::SubEntity::mTempVertexAnimInfo
TempBlendedBufferInfo mTempVertexAnimInfo
Temp buffer details for software Vertex anim geometry.
Definition: OgreSubEntity.h:112
Ogre::SubEntity::_invalidateCameraCache
void _invalidateCameraCache()
Invalidate the camera distance cache.
Definition: OgreSubEntity.h:308
Ogre::SharedPtr< Material >
OgreHeaderPrefix.h
Ogre::SubEntity::mCachedCameraDist
Real mCachedCameraDist
Cached distance to last camera for getSquaredViewDepth.
Definition: OgreSubEntity.h:124
Ogre::RenderOperation
&#39;New&#39; rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
Ogre::Technique
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:53
Ogre::Entity
Defines an instance of a discrete, movable object based on a Mesh.
Definition: OgreEntity.h:82
OgreResourceGroupManager.h
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::SubEntity::mRenderQueuePriority
ushort mRenderQueuePriority
The render queue priority to use when rendering this renderable.
Definition: OgreSubEntity.h:100
Ogre::SubEntity::mTempSkelAnimInfo
TempBlendedBufferInfo mTempSkelAnimInfo
Quick lookup of buffers.
Definition: OgreSubEntity.h:110
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::SubEntity::mParentEntity
Entity * mParentEntity
Pointer to parent.
Definition: OgreSubEntity.h:78
Ogre::SubEntity::mHardwareVertexAnimVertexData
VertexData * mHardwareVertexAnimVertexData
Vertex data details for hardware Vertex anim of shared geometry.
Definition: OgreSubEntity.h:118
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::GpuProgramParameters
Collects together the program parameters used for a GpuProgram.
Definition: OgreGpuProgramParams.h:702
Ogre::SubEntity::mSkelAnimVertexData
VertexData * mSkelAnimVertexData
Blend buffer details for dedicated geometry.
Definition: OgreSubEntity.h:108

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