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

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.