Axiom.Core.PatchSurface.GetAutoVLevel C# (CSharp) Method

GetAutoVLevel() protected method

protected GetAutoVLevel ( bool forMax ) : int
forMax bool
return int
		protected int GetAutoVLevel( bool forMax )
		{
			Vector3 a = Vector3.Zero;
			Vector3 b = Vector3.Zero;
			Vector3 c = Vector3.Zero;

			bool found = false;

			for ( int u = 0; u < controlWidth; u++ )
			{
				for ( int v = 0; v < controlHeight - 1; v += 2 )
				{
					a = controlPoints[ v * controlWidth + u ];
					b = controlPoints[ ( v + 1 ) * controlWidth + u ];
					c = controlPoints[ ( v + 2 ) * controlWidth + u ];

					if ( a != c )
					{
						found = true;
						break;
					}
				}

				if ( found )
				{
					break;
				}
			}
			if ( !found )
			{
				throw new AxiomException( "Can't find suitable control points for determining U subdivision level" );
			}

			return FindLevel( ref a, ref b, ref c );
		}

Same methods

PatchSurface::GetAutoVLevel ( ) : int