Go to the documentation of this file.
28 #ifndef __InstancedEntity_H__
29 #define __InstancedEntity_H__
257 assert((!mNeedTransformUpdate || !mUseLocalTransform) &&
"Transform data should be updated at this point");
258 return mUseLocalTransform ? mFullLocalTransform :
264 assert((!mNeedTransformUpdate || !mUseLocalTransform) &&
"Transform data should be updated at this point");
265 return mUseLocalTransform ? mDerivedLocalPosition :
266 mParentNode ? mParentNode->_getDerivedPosition() :
Vector3::ZERO;
Vector3 mScale
Object scale.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
SkeletonInstance * getSkeleton(void) const
void _notifyMoved(void)
Overridden so we can tell the InstanceBatch it needs to update it's bounds.
bool mNeedTransformUpdate
Tells if mFullTransform needs an updated.
void setInUse(bool used)
Sets whether the entity is in use.
Real getSquaredViewDepth(const Camera *cam) const
This is used by our batch owner to get the closest entity's depth, returns infinity when not attached...
AnimationStateSet * getAllAnimationStates(void) const
void setPosition(const Vector3 &position, bool doUpdate=true)
Set the position or the offset from the parent node if a parent node exists.
static const Vector3 ZERO
const Vector3 & _getDerivedPosition() const
Returns the derived position of the instanced entity including local transform.
Vector3 mDerivedLocalPosition
void updateTransforms()
Update the world transform and derived values.
uint16 mTransformLookupNumber
Used in conjunction with bone matrix lookup.
A viewpoint from which the scene will be rendered.
InstanceBatch * mBatchOwner
void markTransformDirty()
Mark the transformation matrixes as dirty.
void setTransformLookupNumber(uint16 num)
Sets the transformation look up number.
This is the same technique the old "InstancedGeometry" implementation used (with improvements).
unsigned long mFrameAnimationLastUpdated
This is technique requires true instancing hardware support.
void createSkeletonInstance()
Creates/destroys our own skeleton, also tells slaves to unlink if we're destroying.
Real getBoundingRadius(void) const
Retrieves the radius of the origin-centered bounding sphere for this object.
Abstract class defining a movable object in a scene.
bool hasSkeleton(void) const
Real mMaxScaleLocal
The maximum absolute scale for all dimension.
size_t getTransforms3x4(float *xform) const
Returns number of 32-bit values written.
void _notifyAttached(Node *parent, bool isTagPoint=false)
Internal method called to notify the object that it has been attached to a node.
bool isInUse() const
Tells if the entity is in use.
SkeletonInstance * mSkeletonInstance
const Vector3 & getPosition() const
Retrieve the position.
virtual bool isInScene(void) const
Represents the state of an animation and the weight of its influence.
const String & getMovableType(void) const
Returns the type name of this object.
AnimationStateSet * mAnimationState
Implementation of a Quaternion, i.e.
Matrix4 * mBoneWorldMatrices
size_t getTransforms(Matrix4 *xform) const
Returns number of matrices written to transform, assumes transform has enough space.
const Vector3 & getScale() const
Retrieve the local scale.
void stopSharingTransform()
Class encapsulating a standard 4x4 homogeneous matrix.
InstancedEntityVec mSharingPartners
Utility class to generate a sequentially numbered series of names.
void setScale(const Vector3 &scale, bool doUpdate=true)
Set the scale or the offset from the parent node if a parent node exists
static const Matrix4 IDENTITY
void unlinkTransform(bool notifyMaster=true)
Just unlinks, and tells our master we're no longer sharing.
Vector3 mPosition
Object position.
A 3D box aligned with the x/y/z axes.
bool findVisible(Camera *camera) const
Returns true if this InstancedObject is visible to the current camera.
virtual bool _updateAnimation(void)
Called by InstanceBatch in his _updateRenderQueue to tell us we need to calculate our bone matrices.
Quaternion mOrientation
Object orientation.
bool shareTransformWith(InstancedEntity *slave)
Shares the entire transformation with another InstancedEntity.
void notifyUnlink(const InstancedEntity *slave)
Called when a slave has unlinked from us.
const Quaternion & getOrientation() const
Retrieve the orientation.
vector< InstancedEntity * >::type InstancedEntityVec
Stores the master when we're the slave, store our slaves when we're the master.
static NameGenerator msNameGenerator
Incremented count for next name extension.
Instancing implementation using vertex texture through Vertex Texture Fetch (VTF) This implementation...
Class encapsulating a set of AnimationState objects.
void stopSharingTransformAsSlave(bool notifyMaster)
When this entity is a slave, stopSharingTransform delegates to this function.
void setOrientation(const Quaternion &orientation, bool doUpdate=true)
Set the orientation or the offset from the parent node if a parent node exists.
bool mUseLocalTransform
Tells whether to use the local transform parameters.
A SkeletonInstance is a single instance of a Skeleton used by a world object.
InstancedEntity(InstanceBatch *batchOwner, uint32 instanceID, InstancedEntity *sharedTransformEntity=NULL)
4-dimensional homogeneous vector.
InstancedEntity * mSharedTransformEntity
InstanceBatch * _getOwner() const
virtual ~InstancedEntity()
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
const Vector4 & getCustomParam(unsigned char idx)
const AxisAlignedBox & getBoundingBox(void) const
Retrieves the local axis-aligned bounding box for this object.
Instancing implementation using vertex texture through Vertex Texture Fetch (VTF) and hardware instan...
float Real
Software floating point type.
InstanceBatch forms part of the new Instancing system This is an abstract class that must be derived ...
AnimationState * getAnimationState(const String &name) const
virtual const Matrix4 & _getParentNodeFullTransform(void) const
Returns the world transform of the instanced entity including local transform.
Matrix4 mFullLocalTransform
Full world transform.
Class representing a general-purpose node an articulated scene graph.
Real getMaxScaleCoef() const
Returns the maximum derived scale coefficient among the xyz values.
void setCustomParam(unsigned char idx, const Vector4 &newParam)
Sets the custom parameter for this instance.
bool mNeedAnimTransformUpdate
Tells if the animation world transform needs an update.
void _updateRenderQueue(RenderQueue *queue)
Do nothing, InstanceBatch takes care of this.
Standard 3-dimensional vector.
Class to manage the scene object rendering queue.
void destroySkeletonInstance()
Copyright © 2012 Torus Knot Software Ltd

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