public PatchMesh CreateBezierPatch( string name, string group, Array controlPointBuffer, VertexDeclaration declaration,
int width, int height, int uMaxSubdivisionLevel, int vMaxSubdivisionLevel, VisibleSide visibleSide,
BufferUsage vbUsage, BufferUsage ibUsage, bool vbUseShadow, bool ibUseShadow )
{
if ( width < 3 || height < 3 )
{
throw new Exception( "Bezier patch requires at least 3x3 control points." );
}
PatchMesh mesh = (PatchMesh)this[ name ];
if ( mesh != null )
{
throw new AxiomException( "A mesh with the name {0} already exists!", name );
}
mesh = new PatchMesh( this, name, nextHandle, group );
mesh.Define( controlPointBuffer, declaration, width, height, uMaxSubdivisionLevel, vMaxSubdivisionLevel, visibleSide, vbUsage, ibUsage, vbUseShadow, ibUseShadow );
mesh.Load();
_add( mesh );
return mesh;
}