OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-2014 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 "OgreRenderable.h"
36 #include "OgreHeaderPrefix.h"
37 
38 namespace Ogre {
39 
63  {
64  // Note no virtual functions for efficiency
65  friend class Entity;
66  friend class SceneManager;
67  protected:
70  SubEntity(Entity* parent, SubMesh* subMeshBasis);
71 
72  public:
75  virtual ~SubEntity();
76 
77  protected:
80 
83 
86 
87  unsigned char mMaterialLodIndex;
88 
90  size_t mIndexStart;
91 
93  size_t mIndexEnd;
94 
111 
113  void prepareTempBlendBuffers(void);
114 
115  public:
118  const String& getMaterialName() const;
119 
126  void setMaterialName( const String& name, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
127 
134  void setMaterial( const MaterialPtr& material );
135 
138  SubMesh* getSubMesh(void) const;
139 
141  Entity* getParent(void) const { return mParentEntity; }
142 
145  const MaterialPtr& getMaterial(void) const;
146 
149  Technique* getTechnique(void) const;
150 
153  void getRenderOperation(RenderOperation& op);
154 
159  void setIndexDataStartIndex(size_t start_index);
160 
164  size_t getIndexDataStartIndex() const;
165 
170  void setIndexDataEndIndex(size_t end_index);
171 
174  size_t getIndexDataEndIndex() const;
175 
178  void resetIndexDataStartEndIndex();
179 
182  void getWorldTransforms(Matrix4* xform) const;
185  unsigned short getNumWorldTransforms(void) const;
187  Real getSquaredViewDepth(const Camera* cam) const;
189  const LightList& getLights(void) const;
191  bool getCastsShadows(void) const;
201  VertexData* _getSkelAnimVertexData(void);
210  VertexData* _getSoftwareVertexAnimVertexData(void);
215  VertexData* _getHardwareVertexAnimVertexData(void);
219  TempBlendedBufferInfo* _getSkelAnimTempBufferInfo(void);
223  TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void);
224  const TempBlendedBufferInfo* _getVertexAnimTempBufferInfo(void) const;
226  VertexData* getVertexDataForBinding(void);
227 
230  void _markBuffersUnusedForAnimation(void);
233  void _markBuffersUsedForAnimation(void);
235  bool _getBuffersMarkedForAnimation(void) const { return mVertexAnimationAppliedThisFrame; }
239  void _restoreBuffersForUnusedAnimation(bool hardwareAnimation);
240 
242  void _updateCustomGpuParameter(
243  const GpuProgramParameters::AutoConstantEntry& constantEntry,
244  GpuProgramParameters* params) const;
245  };
249 }
250 
251 #include "OgreHeaderSuffix.h"
252 
253 #endif
ushort mHardwarePoseCount
Number of hardware blended poses supported by material.
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:79
float Real
Software floating point type.
MaterialPtr mMaterialPtr
Cached pointer to material.
Definition: OgreSubEntity.h:82
#define _OgreExport
Definition: OgrePlatform.h:255
TempBlendedBufferInfo mTempVertexAnimInfo
Temp buffer details for software Vertex anim geometry.
VertexData * mHardwareVertexAnimVertexData
Vertex data details for hardware Vertex anim of shared geometry.
Structure for recording the use of temporary blend buffers.
Manages the organisation and rendering of a 'scene' i.e.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
SubMesh * mSubMesh
Pointer to the SubMesh defining geometry.
Definition: OgreSubEntity.h:85
Entity * getParent(void) const
Accessor to get parent Entity.
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:50
unsigned char mMaterialLodIndex
Definition: OgreSubEntity.h:87
size_t mIndexEnd
override the end index for the RenderOperation
Definition: OgreSubEntity.h:93
Abstract class defining the interface all renderable objects must implement.
Structure recording the use of an automatic parameter.
Utility class which defines the sub-parts of an Entity.
Definition: OgreSubEntity.h:62
bool mVertexAnimationAppliedThisFrame
Have we applied any vertex animation to geometry?
Defines an instance of a discrete, movable object based on a Mesh.
Definition: OgreEntity.h:81
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.
Defines a part of a complete mesh.
Definition: OgreSubMesh.h:60
unsigned short ushort
Summary class collecting together vertex source information.
'New' rendering operation using vertex buffers.
TempBlendedBufferInfo mTempSkelAnimInfo
Quick lookup of buffers.
Definition: OgreSubEntity.h:98
Entity * mParentEntity
Pointer to parent.
Definition: OgreSubEntity.h:79
VertexData * mSkelAnimVertexData
Blend buffer details for dedicated geometry.
Definition: OgreSubEntity.h:96
VertexData * mSoftwareVertexAnimVertexData
Vertex data details for software Vertex anim of shared geometry.
bool _getBuffersMarkedForAnimation(void) const
Are buffers already marked as vertex animated?
_StringBase String
Definition: OgreCommon.h:53
size_t mIndexStart
override the start index for the RenderOperation
Definition: OgreSubEntity.h:90