Beispiel #1
0
 /// <summary>
 /// Compares two items based on their distances from the camera.
 /// </summary>
 public static int DistanceCompare(DrawListItem a, DrawListItem b)
 {
     if (a.DistFromCamera > b.DistFromCamera)
     {
         return(-1);
     }
     else if (a.DistFromCamera < b.DistFromCamera)
     {
         return(1);
     }
     return(0);
 }
Beispiel #2
0
 /// <summary>
 /// Compares two items based on their depth biases.
 /// </summary>
 public static int DepthCompare(DrawListItem a, DrawListItem b)
 {
     //Typically things are going to have the same depth bias (0), so the equality case comes first here
     if (a.ListItem.DepthBias == b.ListItem.DepthBias)
     {
         return(0);
     }
     else if (a.ListItem.DepthBias > b.ListItem.DepthBias)
     {
         return(1);
     }
     return(-1);
 }