示例#1
0
        public bool Intersects(FixBounds bounds)
        {
            if ((bounds._max.X < _min.X) ||
                (bounds._min.X > _max.X) ||
                (bounds._max.Y < _min.Y) ||
                (bounds._min.Y > _max.Y) ||
                (bounds._max.Z < _min.Z) ||
                (bounds._min.Z > _max.Z))
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        public void Encapsulate(FixBounds other)
        {
            Fix x;
            Fix y;
            Fix z;

            // Expand min
            x    = FixMath.Min(_min.X, other._min.X);
            y    = FixMath.Min(_min.Y, other._min.Y);
            z    = FixMath.Min(_min.Z, other._min.Z);
            _min = new FixVec3(x, y, z);

            // Expand max
            x    = FixMath.Max(_max.X, other._max.X);
            y    = FixMath.Max(_max.Y, other._max.Y);
            z    = FixMath.Max(_max.Z, other._max.Z);
            _max = new FixVec3(x, y, z);

            // Update other values
            UpdateFromMinMax();
        }
示例#3
0
 public bool Contains(FixBounds other)
 {
     return(this.min.X <= other.max.X && this.max.X >= other.min.X &&
            this.min.Y <= other.max.Y && this.max.Y >= other.min.Y &&
            this.min.Z <= other.max.Z && this.max.Z >= other.min.Z);
 }