protected bool IsBillboardVisible( Camera camera, Billboard billboard )
{
// if not culling each one, return true always
if ( !this.cullIndividual )
{
return true;
}
// get the world matrix of this billboard set
this.GetWorldTransforms( this.world );
// get the center of the bounding sphere
this.sphere.Center = this.world[ 0 ] * billboard.Position;
// calculate the radius of the bounding sphere for the billboard
if ( billboard.HasOwnDimensions )
{
this.sphere.Radius = Utility.Max( billboard.Width, billboard.Height );
}
else
{
this.sphere.Radius = Utility.Max( this.defaultParticleWidth, this.defaultParticleHeight );
}
// finally, see if the sphere is visible in the camera
return camera.IsObjectVisible( this.sphere );
}