public bool Equals(BoundingRect other) { return (Min.X == other.Min.X) && (Min.Y == other.Min.Y) && (Max.X == other.Max.X) && (Max.Y == other.Max.Y); }
public static BoundingRect Union(BoundingRect rect1, BoundingRect rect2) { BoundingRect result; float num6 = rect1.Max.X; float num5 = rect2.Max.X; float num4 = rect1.Max.Y; float num3 = rect2.Max.Y; float num2 = (rect1.Min.X < rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y < rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num8 = (num6 > num5) ? num6 : num5; float num7 = (num4 > num3) ? num4 : num3; result.Min.X = num2; result.Min.Y = num; result.Max.X = num8; result.Max.Y = num7; return(result); }
public void BufferAddBoundOutline(Common.BoundingRect boundingRect) { var vertexCount = this.mShadowHullVertices.Count; this.mShadowHullVertices.Add(new ShadowHullVertex() { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Left, boundingRect.Top) }); this.mShadowHullVertices.Add(new ShadowHullVertex() { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Right, boundingRect.Top) }); this.mShadowHullVertices.Add(new ShadowHullVertex() { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Right, boundingRect.Bottom) }); this.mShadowHullVertices.Add(new ShadowHullVertex() { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Left, boundingRect.Bottom) }); this.mShadowHullIndicies.Add(vertexCount + 0); this.mShadowHullIndicies.Add(vertexCount + 1); this.mShadowHullIndicies.Add(vertexCount + 2); this.mShadowHullIndicies.Add(vertexCount + 0); this.mShadowHullIndicies.Add(vertexCount + 2); this.mShadowHullIndicies.Add(vertexCount + 3); }
public static BoundingRect Union( BoundingRect rect1, BoundingRect rect2) { BoundingRect result; var num6 = rect1.Max.X; var num5 = rect2.Max.X; var num4 = rect1.Max.Y; var num3 = rect2.Max.Y; var num2 = rect1.Min.X < rect2.Min.X ? rect1.Min.X : rect2.Min.X; var num = rect1.Min.Y < rect2.Min.Y ? rect1.Min.Y : rect2.Min.Y; var num8 = num6 > num5 ? num6 : num5; var num7 = num4 > num3 ? num4 : num3; result.Min.X = num2; result.Min.Y = num; result.Max.X = num8; result.Max.Y = num7; return(result); }
public static void Intersect(ref BoundingRect rect1, ref BoundingRect rect2, out BoundingRect result) { float num8 = rect1.Max.X; float num7 = rect2.Max.X; float num6 = rect1.Max.Y; float num5 = rect2.Max.Y; float num2 = (rect1.Min.X > rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y > rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num4 = (num8 < num7) ? num8 : num7; float num3 = (num6 < num5) ? num6 : num5; if ((num4 > num2) && (num3 > num)) { result.Min = new Vector2(num2, num); result.Max = new Vector2(num4, num3); return; } result.Min = Vector2.Zero; result.Max = Vector2.Zero; }
public static void Intersect(ref BoundingRect rect1, ref BoundingRect rect2, out BoundingRect result) { float num8 = rect1.Max.X; float num7 = rect2.Max.X; float num6 = rect1.Max.Y; float num5 = rect2.Max.Y; float num2 = (rect1.Min.X > rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y > rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num4 = (num8 < num7) ? num8 : num7; float num3 = (num6 < num5) ? num6 : num5; if ((num4 > num2) && (num3 > num)) { result.Min.X = num2; result.Min.Y = num; result.Max.X = num4; result.Max.Y = num3; } result.Min.X = 0; result.Min.Y = 0; result.Max.X = 0; result.Max.Y = 0; }
public static BoundingRect Union(BoundingRect rect1, BoundingRect rect2) { BoundingRect result = new BoundingRect(); float num6 = rect1.Max.X; float num5 = rect2.Max.X; float num4 = rect1.Max.Y; float num3 = rect2.Max.Y; float num2 = (rect1.Min.X < rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y < rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num8 = (num6 > num5) ? num6 : num5; float num7 = (num4 > num3) ? num4 : num3; result.Min.X = num2; result.Min.Y = num; result.Max.X = num8; result.Max.Y = num7; return result; }
void UpdateWorldSpace(Matrix value) { var inverse = Matrix.Invert(value); var v1 = Vector2.Transform(new Vector2(1, 1), inverse); var v2 = Vector2.Transform(new Vector2(1, -1), inverse); var v3 = Vector2.Transform(new Vector2(-1, -1), inverse); var v4 = Vector2.Transform(new Vector2(-1, 1), inverse); bounds.Min = v1; bounds.Min = Vector2.Min(bounds.Min, v2); bounds.Min = Vector2.Min(bounds.Min, v3); bounds.Min = Vector2.Min(bounds.Min, v4); bounds.Max = v1; bounds.Max = Vector2.Max(bounds.Max, v2); bounds.Max = Vector2.Max(bounds.Max, v3); bounds.Max = Vector2.Max(bounds.Max, v4); bounds = BoundingRect.MinMax; }
static BoundingRect() { BoundingRect.mEmpty = new BoundingRect(); BoundingRect.mMinMax = new BoundingRect(Vector2.One * float.MinValue, Vector2.One * float.MaxValue); }
public void Intersects(ref BoundingRect rect, out bool result) { result = (this.Min.X < rect.Max.X) && (this.Min.Y < rect.Max.Y) && (this.Max.X > rect.Min.X) && (this.Max.Y > rect.Min.Y); }
public bool Intersects(BoundingRect rect) { return (this.Min.X < rect.Max.X) && (this.Min.Y < rect.Max.Y) && (this.Max.X > rect.Min.X) && (this.Max.Y > rect.Min.Y); }
public bool Contains(BoundingRect rect) { return (this.Min.X <= rect.Min.X) && (this.Min.Y <= rect.Min.Y) && (this.Max.X >= rect.Max.X) && (this.Max.Y >= rect.Max.Y); }
public void Contains(ref BoundingRect rect, out bool result) { result = (this.Min.X <= rect.Min.X) && (this.Min.Y <= rect.Min.Y) && (this.Max.X >= rect.Max.X) && (this.Max.Y >= rect.Max.Y) ; }
public void BufferAddBoundOutline(BoundingRect boundingRect) { int vertexCount = shadowHullVertices.Count; shadowHullVertices.Add(new ShadowHullVertex { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Left, boundingRect.Top) }); shadowHullVertices.Add(new ShadowHullVertex { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Right, boundingRect.Top) }); shadowHullVertices.Add(new ShadowHullVertex { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Right, boundingRect.Bottom) }); shadowHullVertices.Add(new ShadowHullVertex { Color = Color.Black, Normal = Vector2.Zero, Position = new Vector2(boundingRect.Left, boundingRect.Bottom) }); shadowHullIndicies.Add(vertexCount + 0); shadowHullIndicies.Add(vertexCount + 1); shadowHullIndicies.Add(vertexCount + 2); shadowHullIndicies.Add(vertexCount + 0); shadowHullIndicies.Add(vertexCount + 2); shadowHullIndicies.Add(vertexCount + 3); }
public static void Union(ref BoundingRect rect1, ref BoundingRect rect2, out BoundingRect result) { float num6 = rect1.Max.X; float num5 = rect2.Max.X; float num4 = rect1.Max.Y; float num3 = rect2.Max.Y; float num2 = (rect1.Min.X < rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y < rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num8 = (num6 > num5) ? num6 : num5; float num7 = (num4 > num3) ? num4 : num3; result = new BoundingRect(); result.Min.X = num2; result.Min.Y = num; result.Max.X = num8; result.Max.Y = num7; }
public static void Intersect(ref BoundingRect rect1, ref BoundingRect rect2, out BoundingRect result) { float num8 = rect1.Max.X; float num7 = rect2.Max.X; float num6 = rect1.Max.Y; float num5 = rect2.Max.Y; float num2 = (rect1.Min.X > rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y > rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num4 = (num8 < num7) ? num8 : num7; float num3 = (num6 < num5) ? num6 : num5; result = new BoundingRect(); if ((num4 > num2) && (num3 > num)) { result.Min.X = num2; result.Min.Y = num; result.Max.X = num4; result.Max.Y = num3; } result.Min.X = 0; result.Min.Y = 0; result.Max.X = 0; result.Max.Y = 0; }
public static BoundingRect Intersect(BoundingRect rect1, BoundingRect rect2) { BoundingRect result; float num8 = rect1.Max.X; float num7 = rect2.Max.X; float num6 = rect1.Max.Y; float num5 = rect2.Max.Y; float num2 = (rect1.Min.X > rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y > rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num4 = (num8 < num7) ? num8 : num7; float num3 = (num6 < num5) ? num6 : num5; result = new BoundingRect(); if ((num4 > num2) && (num3 > num)) { result.Min.X = num2; result.Min.Y = num; result.Max.X = num4; result.Max.Y = num3; return result; } result.Min.X = 0; result.Min.Y = 0; result.Max.X = 0; result.Max.Y = 0; return result; }
public static void Union(ref BoundingRect rect1, ref BoundingRect rect2, out BoundingRect result) { float num6 = rect1.Max.X; float num5 = rect2.Max.X; float num4 = rect1.Max.Y; float num3 = rect2.Max.Y; float num2 = (rect1.Min.X < rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y < rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num8 = (num6 > num5) ? num6 : num5; float num7 = (num4 > num3) ? num4 : num3; result.Min = new Vector2(num2, num); result.Max = new Vector2(num8, num7); }
public static BoundingRect Union(BoundingRect rect1, BoundingRect rect2) { BoundingRect result; float num6 = rect1.Max.X; float num5 = rect2.Max.X; float num4 = rect1.Max.Y; float num3 = rect2.Max.Y; float num2 = (rect1.Min.X < rect2.Min.X) ? rect1.Min.X : rect2.Min.X; float num = (rect1.Min.Y < rect2.Min.Y) ? rect1.Min.Y : rect2.Min.Y; float num8 = (num6 > num5) ? num6 : num5; float num7 = (num4 > num3) ? num4 : num3; result.Min = new Vector2(num2, num); result.Max = new Vector2(num8, num7); return result; }