protected virtual void UpdateBounds()
{
// reset bounds
worldAABB.IsNull = true;
worldBoundingSphere.Center = this.DerivedPosition;
float radius = worldBoundingSphere.Radius = 0;
// update bounds from attached objects
foreach ( MovableObject obj in objectList.Values )
{
// update
worldAABB.Merge( obj.GetWorldBoundingBox( true ) );
radius = Utility.Max( obj.BoundingRadius, radius );
}
// merge with Children
foreach ( SceneNode child in childNodes.Values )
{
// merge our bounding box with that of the child node
worldAABB.Merge( child.worldAABB );
radius = Utility.Max( child.worldBoundingSphere.Radius, radius );
}
worldBoundingSphere.Radius = radius;
}