Jan 22, 2011 at 10:15 PM
Edited Jan 22, 2011 at 10:16 PM
There is a bug in at least one of the operator overloads in Balder, specificly Bounding box. Please see the URL below for info on overloading == and !=
I'm getting an error if I try to see if a bounding box is null
BoundingBox bb = null;
The code above will fail on the if line, because I can't check a bounding box with null. The URL below outlines how to address this.
Notice how there is logic to deal with same instance, and null objects.
public static bool operator ==(ThreeDPoint a, ThreeDPoint b)
// If both are null, or both are same instance, return true.
if (System.Object.ReferenceEquals(a, b))
// If one is null, but not both, return false.
if (((object)a == null) || ((object)b == null))
// Return true if the fields match:
return a.x == b.x && a.y == b.y && a.z == b.z;
public static bool operator !=(ThreeDPoint a, ThreeDPoint b)
return !(a == b);