171 bool animateNormals);
334 bool createSeparateLightCap,
SubEntity* subent,
bool isLightCap =
false);
603 bool extrudeVertices,
Real extrusionDistance,
unsigned long flags = 0 );
821 bool debugRenderables =
false);
830 mSkipAnimStateUpdates = skip;
837 return mSkipAnimStateUpdates;
845 mAlwaysUpdateMainSkeleton = update;
853 return mAlwaysUpdateMainSkeleton;
Class encapsulating a set of AnimationState objects.
Represents the state of an animation and the weight of its influence.
A 3D box aligned with the x/y/z axes.
A viewpoint from which the scene will be rendered.
This class contains the information required to describe the edge connectivity of a given set of vert...
Factory object for creating Entity instances.
static String FACTORY_TYPE_NAME
void destroyInstance(MovableObject *obj)
Destroy an instance of the object.
MovableObject * createInstanceImpl(const String &name, const NameValuePairList *params)
Internal implementation of create method - must be overridden.
const String & getType(void) const
Get the type of the object to be created.
Nested class to allow entity shadows.
void rebindPositionBuffer(const VertexData *vertexData, bool force)
Rebind the source positions (for temp buffer users).
void _createSeparateLightCap()
Create the separate light cap if it doesn't already exists.
~EntityShadowRenderable()
EntityShadowRenderable(Entity *parent, HardwareIndexBufferSharedPtr *indexBuffer, const VertexData *vertexData, bool createSeparateLightCap, SubEntity *subent, bool isLightCap=false)
HardwareVertexBufferSharedPtr getPositionBuffer(void)
HardwareVertexBufferSharedPtr mWBuffer
Shared link to w-coord buffer (optional).
HardwareVertexBufferSharedPtr getWBuffer(void)
unsigned short mOriginalPosBufferBinding
Original position buffer source binding.
virtual void rebindIndexBuffer(const HardwareIndexBufferSharedPtr &indexBuffer)
bool isVisible(void) const
const VertexData * mCurrentVertexData
Link to current vertex data used to bind (maybe changes).
HardwareVertexBufferSharedPtr mPositionBuffer
Shared link to position buffer.
SubEntity * mSubEntity
Link to SubEntity, only present if SubEntity has it's own geometry.
void getWorldTransforms(Matrix4 *xform) const
Defines an instance of a discrete, movable object based on a Mesh.
Real getBoundingRadius(void) const
Retrieves the radius of the origin-centered bounding sphere for this object.
vector< SubEntity * >::type SubEntityList
List of SubEntities (point to SubMeshes).
bool hasSkeleton(void) const
Returns whether or not this entity is skeletally animated.
bool mVertexAnimationAppliedThisFrame
Have we applied any vertex animation to shared geometry?
void setSkipAnimationStateUpdate(bool skip)
Entity's skeleton's AnimationState will not be automatically updated when set to true.
bool tempVertexAnimBuffersBound(void) const
Are software vertex animation temp buffers bound?
const VertexData * findBlendedVertexData(const VertexData *orig)
Internal method - given vertex data which could be from the Mesh or any submesh, finds the temporary ...
VertexData * _getSkelAnimVertexData(void) const
Advanced method to get the temporarily blended skeletal vertex information for entities which are sof...
bool getDisplaySkeleton(void) const
Returns whether or not the entity is currently displaying its skeleton.
ushort mMaxMaterialLodIndex
Index of maximum detail LOD (NB lower index is higher detail).
VertexData * getVertexDataForBinding(void)
Retrieve the VertexData which should be used for GPU binding.
AxisAlignedBox getChildObjectsBoundingBox(void) const
Merge all the child object Bounds a return it.
bool mAlwaysUpdateMainSkeleton
Flag indicating whether to update the main entity skeleton even when an LOD is displayed.
bool sharesSkeletonInstance() const
Returns whether this entity shares it's SkeltonInstance with other entity instances.
void extractTempBufferInfo(VertexData *sourceData, TempBlendedBufferInfo *info)
Internal method for extracting metadata out of source vertex data for fast assignment of temporary bu...
const Matrix4 * _getBoneMatrices(void) const
Internal method for retrieving bone matrix information.
void initialisePoseVertexData(const VertexData *srcData, VertexData *destData, bool animateNormals)
When performing software pose animation, initialise software copy of vertex data.
SkeletonInstance * getSkeleton(void) const
Get this Entity's personal skeleton instance.
void setRenderQueueGroupAndPriority(uint8 queueID, ushort priority)
const EntitySet * getSkeletonInstanceSharingSet() const
Returns a pointer to the set of entities which share a SkeletonInstance.
VertexDataBindChoice
Identify which vertex data we should be sending to the renderer.
void backgroundLoadingComplete(Resource *res)
Resource::Listener hook to notify Entity that a delay-loaded Mesh is complete.
void _updateRenderQueue(RenderQueue *queue)
void addSoftwareAnimationRequest(bool normalsAlso)
Add a request for software animation.
VertexData * mHardwareVertexAnimVertexData
Vertex data details for hardware vertex anim of shared geometry.
bool isInitialised(void) const
Has this Entity been initialised yet?
bool _isAnimated(void) const
Tests if any animation applied to this entity.
void detachObjectImpl(MovableObject *pObject)
Internal implementation of detaching a 'child' object of this entity and clear the parent node of the...
void _markBuffersUsedForAnimation(void)
Mark just this vertex data as animated.
MapIterator< ChildObjectList > ChildObjectListIterator
bool _isSkeletonAnimated(void) const
Tests if skeleton was animated.
int getSoftwareAnimationRequests(void) const
Returns the number of requests that have been made for software animation.
void prepareTempBlendBuffers(void)
Internal method for preparing this Entity for use in animation.
bool mDisplaySkeleton
Flag determines whether or not to display skeleton.
void restoreBuffersForUnusedAnimation(bool hardwareAnimation)
Internal method to restore original vertex data where we didn't perform any vertex animation this fra...
Entity()
Private constructor (instances cannot be created directly).
VertexData * _getSoftwareVertexAnimVertexData(void) const
Advanced method to get the temporarily blended software vertex animation information.
bool mPreparedForShadowVolumes
Have the temp buffers already had their geometry prepared for use in rendering shadow volumes?
Real _getMeshLodFactorTransformed() const
Get the LOD strategy transformation of the mesh LOD factor.
ushort initHardwareAnimationElements(VertexData *vdata, ushort numberOfElements, bool animateNormals)
Initialise the hardware animation elements for given vertex data.
bool mCurrentHWAnimationState
Current state of the hardware animation as represented by the entities parameters.
TempBlendedBufferInfo * _getSkelAnimTempBufferInfo(void)
Advanced method to get the temp buffer information for software skeletal animation.
void _initialise(bool forceReinitialise=false)
Try to initialise the Entity from the underlying resources.
ushort mMeshLodIndex
The LOD number of the mesh to use, calculated by _notifyCurrentCamera.
unsigned long * mFrameBonesLastUpdated
Records the last frame in which the bones was updated.
const Sphere & getWorldBoundingSphere(bool derive=false) const
Retrieves the worldspace bounding sphere for this object.
void detachAllObjectsFromBone(void)
Detach all MovableObjects previously attached using attachObjectToBone.
void shareSkeletonInstanceWith(Entity *entity)
Shares the SkeletonInstance with the supplied entity.
MeshPtr mMesh
The Mesh that this Entity is based on.
VertexDataBindChoice chooseVertexDataForBinding(bool hasVertexAnim)
Choose which vertex data to bind to the renderer.
~Entity()
Default destructor.
ShadowRenderableList mShadowRenderables
void attachObjectImpl(MovableObject *pMovable, TagPoint *pAttachingPoint)
Internal implementation of attaching a 'child' object to this entity and assign the parent node to th...
SubEntity * getSubEntity(const String &name) const
Gets a pointer to a SubEntity by name.
void _deinitialise(void)
Tear down the internal structures of this Entity, rendering it uninitialised.
ushort mMinMeshLodIndex
Index of minimum detail LOD (NB higher index is lower detail).
unsigned long mFrameAnimationLastUpdated
Records the last frame in which animation was updated.
ushort mHardwarePoseCount
Number of hardware poses supported by materials.
AxisAlignedBox mFullBoundingBox
Bounding box that 'contains' all the mesh of each child entity.
bool mVertexProgramInUse
Flag indicating whether we have a vertex program in use on any of our subentities.
void bindMissingHardwarePoseBuffers(const VertexData *srcData, VertexData *destData)
Ensure that any unbound pose animation buffers are bound to a safe default.
set< Entity * >::type EntitySet
TempBlendedBufferInfo * _getVertexAnimTempBufferInfo(void)
Advanced method to get the temp buffer information for software morph animation.
uint32 getTypeFlags(void) const
Override to return specific type flag.
AnimationState * getAnimationState(const String &name) const
For entities based on animated meshes, gets the AnimationState object for a single animation.
const MeshPtr & getMesh(void) const
Gets the Mesh that this Entity is based on.
void setRenderQueueGroup(uint8 queueID)
const AxisAlignedBox & getBoundingBox(void) const
SubEntity * findSubEntityForVertexData(const VertexData *orig)
Internal method - given vertex data which could be from the Mesh or any SubMesh, finds the correspond...
ChildObjectListIterator getAttachedObjectIterator(void)
Gets an iterator to the list of objects attached to bones on this entity.
map< String, MovableObject * >::type ChildObjectList
Contains the child objects (attached to bones) indexed by name.
void _notifyCurrentCamera(Camera *cam)
void stopSharingSkeletonInstance()
Stops sharing the SkeletonInstance with other entities.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
AnimationStateSet * mAnimationState
State of animation for animable meshes.
Real mMaterialLodFactor
LOD bias factor, not transformed.
void buildSubEntityList(MeshPtr &mesh, SubEntityList *sublist)
Builds a list of SubEntities based on the SubMeshes contained in the Mesh.
TagPoint * attachObjectToBone(const String &boneName, MovableObject *pMovable, const Quaternion &offsetOrientation=Quaternion::IDENTITY, const Vector3 &offsetPosition=Vector3::ZERO)
Attaches another object to a certain bone of the skeleton which this entity uses.
void setMaterial(const MaterialPtr &material)
Sets the material to use for the whole of this entity.
bool isHardwareAnimationEnabled(void)
Returns whether or not hardware animation is enabled.
bool hasVertexAnimation(void) const
Returns whether or not this entity is either morph or pose animated.
void detachObjectFromBone(MovableObject *obj)
Detaches an object by pointer.
const String & getMovableType(void) const
Returns the type name of this object.
void updateAnimation(void)
Perform all the updates required for an animated entity.
bool mInitialised
Has this entity been initialised yet?
ushort getCurrentLodIndex()
Returns the current LOD used to render.
bool _getBuffersMarkedForAnimation(void) const
Are buffers already marked as vertex animated?
void _notifyAttached(Node *parent, bool isTagPoint=false)
Internal method called to notify the object that it has been attached to a node.
ShadowRenderableListIterator getShadowVolumeRenderableIterator(ShadowTechnique shadowTechnique, const Light *light, HardwareIndexBufferSharedPtr *indexBuffer, size_t *indexBufferUsedSize, bool extrudeVertices, Real extrusionDistance, unsigned long flags=0)
vector< Entity * >::type LODEntityList
List of LOD Entity instances (for manual LODs).
bool mSkipAnimStateUpdates
Flag indicating whether to skip automatic updating of the Skeleton's AnimationState.
unsigned short _getNumBoneMatrices(void) const
Internal method for retrieving bone matrix information.
void _updateAnimation(void)
Advanced method to perform all the updates required for an animated entity.
MovableObject * detachObjectFromBone(const String &movableName)
Detach a MovableObject previously attached using attachObjectToBone.
VertexData * _getHardwareVertexAnimVertexData(void) const
Advanced method to get the hardware morph vertex information.
int getSoftwareAnimationNormalsRequests(void) const
Returns the number of requests that have been made for software animation of normals.
bool calcVertexProcessing(void)
Calculates the kind of vertex processing in use.
Real mMeshLodFactorTransformed
LOD bias factor, transformed for optimisation when calculating adjusted LOD value.
EdgeData * getEdgeList(void)
size_t mMeshStateCount
Mesh state count, used to detect differences.
void removeSoftwareAnimationRequest(bool normalsAlso)
Removes a request for software animation.
map< unsigned short, bool >::type SchemeHardwareAnimMap
Matrix4 * mBoneMatrices
Cached bone matrices in skeleton local space, might shares with other entity instances.
void reevaluateVertexProcessing(void)
Ensures reevaluation of the vertex processing usage.
Entity * clone(const String &newName) const
Clones this entity and returns a pointer to the clone.
bool getSkipAnimationStateUpdate() const
Entity's skeleton's AnimationState will not be automatically updated when set to true.
VertexData * mSkelAnimVertexData
Vertex data details for software skeletal anim of shared geometry.
void detachAllObjectsImpl(void)
Internal implementation of detaching all 'child' objects of this entity.
SubEntityList mSubEntityList
VertexData * mSoftwareVertexAnimVertexData
Vertex data details for software vertex anim of shared geometry.
bool cacheBoneMatrices(void)
Private method to cache bone matrices from skeleton.
void setMeshLodBias(Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
Sets a level-of-detail bias for the mesh detail of this entity.
size_t getNumManualLodLevels(void) const
Returns the number of manual levels of detail that this entity supports.
Matrix4 mLastParentXform
Last parent transform.
Matrix4 * mBoneWorldMatrices
Cached bone matrices, including any world transform.
LODEntityList mLodEntityList
ushort mMaxMeshLodIndex
Index of maximum detail LOD (NB lower index is higher detail).
EntitySet * mSharedSkeletonEntities
A set of all the entities which shares a single SkeletonInstance.
void setDisplaySkeleton(bool display)
Tells the Entity whether or not it should display it's skeleton, if it has one.
Entity * getManualLodLevel(size_t index) const
Gets a pointer to the entity representing the numbered manual level of detail.
SubEntity * getSubEntity(unsigned int index) const
Gets a pointer to a SubEntity, ie a part of an Entity.
void setMaterialLodBias(Real factor, ushort maxDetailIndex=0, ushort minDetailIndex=99)
Sets a level-of-detail bias for the material detail of this entity.
void refreshAvailableAnimationState(void)
Updates the internal animation state set to include the latest available animations from the attached...
int mSoftwareAnimationRequests
Counter indicating number of requests for software animation.
Real mMaterialLodFactorTransformed
LOD bias factor, transformed for optimisation when calculating adjusted LOD value.
ushort mMinMaterialLodIndex
Index of minimum detail LOD (NB higher index is lower detail).
SchemeHardwareAnimMap mSchemeHardwareAnim
Flag indicating whether hardware animation is supported by this entities materials data is saved per ...
ChildObjectList mChildObjectList
void setAlwaysUpdateMainSkeleton(bool update)
The skeleton of the main entity will be updated even if the an LOD entity is being displayed.
bool tempSkelAnimBuffersBound(bool requestNormals) const
Are software skeleton animation temp buffers bound?
SkeletonInstance * mSkeletonInstance
This Entity's personal copy of the skeleton, if skeletally animated.
void markBuffersUnusedForAnimation(void)
Mark all vertex data as so far unanimated.
void setPolygonModeOverrideable(bool PolygonModeOverrideable)
Sets whether the polygon mode of this entire entity may be overridden by the camera detail settings.
TempBlendedBufferInfo mTempSkelAnimInfo
Temp buffer details for software skeletal anim of shared geometry.
Entity(const String &name, const MeshPtr &mesh)
Private constructor - specify name (the usual constructor used).
unsigned int getNumSubEntities(void) const
Retrieves the number of SubEntity objects making up this entity.
void finalisePoseNormals(const VertexData *srcData, VertexData *destData)
When animating normals for pose animation, finalise normals by filling in with the reference mesh nor...
void applyVertexAnimation(bool hardwareAnimation, bool stencilShadows)
Apply vertex animation.
TempBlendedBufferInfo mTempVertexAnimInfo
Temp buffer details for software vertex anim of shared geometry.
AnimationStateSet * getAllAnimationStates(void) const
For entities based on animated meshes, gets the AnimationState objects for all animations.
void setMaterialName(const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
Sets the material to use for the whole of this entity.
bool hasAnimationState(const String &name) const
Returns whether the AnimationState with the given name exists.
unsigned short mNumBoneMatrices
const AxisAlignedBox & getWorldBoundingBox(bool derive=false) const
Retrieves the axis-aligned bounding box for this object in world coordinates.
bool getAlwaysUpdateMainSkeleton() const
The skeleton of the main entity will be updated even if the an LOD entity is being displayed.
int mSoftwareAnimationNormalsRequests
Counter indicating number of requests for software blended normals.
VertexData * cloneVertexDataRemoveBlendInfo(const VertexData *source)
Internal method to clone vertex data definitions but to remove blend buffers.
Shared pointer implementation used to share index buffers.
Shared pointer implementation used to share vertex buffers.
Representation of a dynamic light source in the scene.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Class encapsulating a standard 4x4 homogeneous matrix.
Interface definition for a factory class which produces a certain kind of MovableObject,...
Abstract class defining a movable object in a scene.
Class representing a general-purpose node an articulated scene graph.
Implementation of a Quaternion, i.e.
static const Quaternion IDENTITY
Class to manage the scene object rendering queue.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Abstract class representing a loadable resource (e.g.
vector< ShadowRenderable * >::type ShadowRenderableList
Class which represents the renderable aspects of a set of shadow volume faces.
A SkeletonInstance is a single instance of a Skeleton used by a world object.
A sphere primitive, mostly used for bounds checking.
Utility class which defines the sub-parts of an Entity.
A tagged point on a skeleton, which can be used to attach entities to on specific other entities.
Structure for recording the use of temporary blend buffers.
Standard 3-dimensional vector.
static const Vector3 ZERO
Concrete IteratorWrapper for nonconst access to the underlying container.
Summary class collecting together vertex source information.
ShadowTechnique
An enumeration of broad shadow techniques.
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
float Real
Software floating point type.