public int CompareTo( object obj )
{
Debug.Assert( obj is Material, "Materials cannot be compared to objects of type '" + obj.GetType().Name );
Material material = obj as Material;
// compare this Material with the incoming object to compare to.
if ( this.IsTransparent && !material.IsTransparent )
{
return -1;
}
else if ( !this.IsTransparent && material.IsTransparent )
{
return 1;
}
else
{
return 0;
}
}