public override void UpdateRenderQueue( RenderQueue queue )
{
// Manual LOD sub entities
if ( this.meshLodIndex > 0 && this.mesh.IsLodManual )
{
Debug.Assert( this.meshLodIndex - 1 < this.lodEntityList.Count,
"No LOD EntityList - did you build the manual LODs after creating the entity?" );
Entity lodEnt = this.lodEntityList[ this.meshLodIndex - 1 ];
// index - 1 as we skip index 0 (original LOD)
if ( this.HasSkeleton && lodEnt.HasSkeleton )
{
// Copy the animation state set to lod entity, we assume the lod
// entity only has a subset animation states
this.CopyAnimationStateSubset( lodEnt.animationState, this.animationState );
}
lodEnt.UpdateRenderQueue( queue );
return;
}
// add all visible sub entities to the render queue
foreach ( SubEntity se in this.subEntityList )
{
if ( se.IsVisible )
{
queue.AddRenderable( se, RenderQueue.DEFAULT_PRIORITY, renderQueueID );
}
}
// Since we know we're going to be rendered, take this opportunity to
// update the animation
if ( this.HasSkeleton || this.mesh.HasVertexAnimation )
{
this.UpdateAnimation();
// Update render queue with child objects (tag points)
foreach ( MovableObject child in this.childObjectList.Values )
{
if ( child.IsVisible )
{
child.UpdateRenderQueue( queue );
}
}
}
}