Пример #1
0
		public Bound3(Bound1 x, Bound1 y, Bound1 z)
		{
			this.x = x;
			this.y = y;
			this.z = z;
		}
Пример #2
0
 public static Bound1 Move(Bound1 bound, float delta)
 {
     bound.min += delta;
     bound.max += delta;
     return bound;
 }
Пример #3
0
		/// <summary>
		/// 扩展以包含指定范围
		/// </summary>
		public void Encapsulate(Bound1 other)
		{
			if (other.min < min) min = other.min;
			if (other.max > max) max = other.max;
		}
Пример #4
0
		/// <summary>
		/// 获取两个范围的交集
		/// </summary>
		public Bound1 GetIntersection(Bound1 other)
		{
			if (min > other.min) other.min = min;
			if (max < other.max) other.max = max;
			return other;
		}
Пример #5
0
		/// <summary>
		/// 判断是否与另一范围有交集
		/// </summary>
		public bool Intersects(Bound1 other)
		{
			return min <= other.max && max >= other.min;
		}
Пример #6
0
		/// <summary>
		/// 使用两个轴的范围构造二维范围
		/// </summary>
		public Bound2(Bound1 x, Bound1 y)
		{
			this.x = x;
			this.y = y;
		}