Axiom.Core.StaticGeometry.GetVolumeIntersection C# (CSharp) Метод

GetVolumeIntersection() защищенный Метод

protected GetVolumeIntersection ( Axiom.MathLib.AxisAlignedBox box, ushort x, ushort y, ushort z ) : float
box Axiom.MathLib.AxisAlignedBox
x ushort
y ushort
z ushort
Результат float
		protected float GetVolumeIntersection( AxisAlignedBox box, ushort x, ushort y, ushort z )
		{
			// Get bounds of indexed region
			AxisAlignedBox regionBounds = GetRegionBounds( x, y, z );
			AxisAlignedBox intersectBox = regionBounds.Intersection( box );
			// return a 'volume' which ignores zero dimensions
			// since we only use this for relative comparisons of the same bounds
			// this will still be internally consistent
			Vector3 boxdiff = box.Maximum - box.Minimum;
			Vector3 intersectDiff = intersectBox.Maximum - intersectBox.Minimum;

			return ( boxdiff.x == 0 ? 1 : intersectDiff.x ) *
				( boxdiff.y == 0 ? 1 : intersectDiff.y ) *
				( boxdiff.z == 0 ? 1 : intersectDiff.z );
		}