Axiom.SceneManagers.PortalConnected.PCZFrustum.GetVisibility C# (CSharp) Méthode

GetVisibility() public méthode

A 'more detailed' check for visibility of an AAB.
This is useful for stuff like Octree leaf culling.
public GetVisibility ( AxisAlignedBox bound ) : Visibility
bound Axiom.Math.AxisAlignedBox the to check visibility aginst.
Résultat Visibility
		public Visibility GetVisibility( AxisAlignedBox bound )
		{

			// Null boxes always invisible
			if ( bound.IsNull )
				return Visibility.None;

			// Get centre of the box
			Vector3 centre = bound.Center;
			// Get the half-size of the box
			Vector3 halfSize = bound.HalfSize;

			bool all_inside = true;

			// Check originplane if told to
			if ( mUseOriginPlane )
			{
				PlaneSide side = mOriginPlane.GetSide( centre, halfSize );
				if ( side == PlaneSide.Negative )
				{
					return Visibility.None;
				}
				// We can't return now as the box could be later on the negative side of another plane.
				if ( side == PlaneSide.Both )
				{
					all_inside = false;
				}
			}

			// For each active culling plane, see if the entire aabb is on the negative side
			// If so, object is not visible
			foreach ( PCPlane plane in mActiveCullingPlanes )
			{
				PlaneSide xside = plane.GetSide( centre, halfSize );
				if ( xside == PlaneSide.Negative )
				{
					return Visibility.None;
				}
				// We can't return now as the box could be later on the negative side of a plane.
				if ( xside == PlaneSide.Both )
				{
					all_inside = false;
				}
			}

			if ( all_inside )
				return Visibility.Full;
			else
				return Visibility.Partial;

		}