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

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

protected GetRegion ( Axiom.MathLib.AxisAlignedBox bounds, bool autoCreate ) : Axiom.Core.Region
bounds Axiom.MathLib.AxisAlignedBox
autoCreate bool
Результат Axiom.Core.Region
		protected Region GetRegion( AxisAlignedBox bounds, bool autoCreate )
		{
			if ( bounds == null )
				return null;

			// Get the region which has the largest overlapping volume
			Vector3 min = bounds.Minimum;
			Vector3 max = bounds.Maximum;

			// Get the min and max region indexes
			ushort minx, miny, minz;
			ushort maxx, maxy, maxz;
			GetRegionIndexes( min, out minx, out miny, out minz );
			GetRegionIndexes( max, out maxx, out maxy, out maxz );
			float maxVolume = 0.0f;
			ushort finalx = 0;
			ushort finaly = 0;
			ushort finalz = 0;
			for ( ushort x = minx; x <= maxx; ++x )
			{
				for ( ushort y = miny; y <= maxy; ++y )
				{
					for ( ushort z = minz; z <= maxz; ++z )
					{
						float vol = GetVolumeIntersection( bounds, x, y, z );
						if ( vol > maxVolume )
						{
							maxVolume = vol;
							finalx = x;
							finaly = y;
							finalz = z;
						}
					}
				}
			}
			Debug.Assert( maxVolume > 0.0f, "Static geometry: Problem determining closest volume match!" );
			return GetRegion( finalx, finaly, finalz, autoCreate );
		}

Same methods

StaticGeometry::GetRegion ( Vector3 point, bool autoCreate ) : Axiom.Core.Region
StaticGeometry::GetRegion ( uint index ) : Axiom.Core.Region
StaticGeometry::GetRegion ( ushort x, ushort y, ushort z, bool autoCreate ) : Axiom.Core.Region