/// <summary>
/// Internal method to put the overlay contents onto the render queue.
/// </summary>
/// <param name="camera">Current camera being used in the render loop.</param>
/// <param name="queue">Current render queue.</param>
public void FindVisibleObjects(Camera camera, RenderQueue queue)
{
if (!isVisible)
{
return;
}
// add 3d elements
rootNode.Position = camera.DerivedPosition;
rootNode.Orientation = camera.DerivedOrientation;
rootNode.Update(true, false);
// set up the default queue group for the objects about to be added
RenderQueueGroupID oldGroupID = queue.DefaultRenderGroup;
queue.DefaultRenderGroup = RenderQueueGroupID.Overlay;
rootNode.FindVisibleObjects(camera, queue, null, true, false);
// reset the group
queue.DefaultRenderGroup = oldGroupID;
// add 2d elements
for (int i = 0; i < elementList.Count; i++)
{
OverlayElementContainer container = (OverlayElementContainer)elementList[i];
container.Update();
container.UpdateRenderQueue(queue);
}
}