summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/BoundBoxTemp.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/scape/BoundBoxTemp.java')
-rw-r--r--NET/worlds/scape/BoundBoxTemp.java130
1 files changed, 130 insertions, 0 deletions
diff --git a/NET/worlds/scape/BoundBoxTemp.java b/NET/worlds/scape/BoundBoxTemp.java
new file mode 100644
index 0000000..0b69c9b
--- /dev/null
+++ b/NET/worlds/scape/BoundBoxTemp.java
@@ -0,0 +1,130 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class BoundBoxTemp
+/* */ {
+/* 25 */ private static Recycler recycler = new Recycler();
+/* */
+/* */ public Point3Temp lo;
+/* */
+/* */ public Point3Temp hi;
+/* */
+/* */ public static BoundBoxTemp make(Point3Temp a, Point3Temp b)
+/* */ {
+/* 33 */ BoundBoxTemp t = (BoundBoxTemp)recycler.alloc();
+/* */
+/* 35 */ if (t == null)
+/* */ {
+/* 37 */ recycler.recycle(new BoundBoxTemp());
+/* 38 */ t = (BoundBoxTemp)recycler.alloc();
+/* */ }
+/* */
+/* 41 */ t.lo = Point3Temp.make(a);
+/* 42 */ t.hi = Point3Temp.make(b);
+/* */
+/* 44 */ if (a.x > b.x)
+/* */ {
+/* 46 */ t.lo.x = b.x;
+/* 47 */ t.hi.x = a.x;
+/* */ }
+/* */
+/* 50 */ if (a.y > b.y)
+/* */ {
+/* 52 */ t.lo.y = b.y;
+/* 53 */ t.hi.y = a.y;
+/* */ }
+/* */
+/* 56 */ if (a.z > b.z)
+/* */ {
+/* 58 */ t.lo.z = b.z;
+/* 59 */ t.hi.z = a.z;
+/* */ }
+/* 61 */ return t;
+/* */ }
+/* */
+/* */ public static BoundBoxTemp make(BoundBoxTemp b)
+/* */ {
+/* 66 */ return make(b.lo, b.hi);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public boolean contains(Point3Temp p)
+/* */ {
+/* 78 */ return (p.x >= this.lo.x) && (p.x <= this.hi.x) &&
+/* 79 */ (p.y >= this.lo.y) && (p.y <= this.hi.y) &&
+/* 80 */ (p.z >= this.lo.z) && (p.z <= this.hi.z);
+/* */ }
+/* */
+/* */ public boolean isEmpty()
+/* */ {
+/* 85 */ return (this.lo.x == this.hi.x) && (this.lo.y == this.hi.y) && (this.lo.z == this.hi.z);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public boolean overlaps(BoundBoxTemp r)
+/* */ {
+/* 93 */ return (this.hi.x >= r.lo.x) && (r.hi.x >= this.lo.x) &&
+/* 94 */ (this.hi.y >= r.lo.y) && (r.hi.y >= this.lo.y) &&
+/* 95 */ (this.hi.z >= r.lo.z) && (r.hi.z >= this.lo.z);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */ public void encompass(Point3Temp p)
+/* */ {
+/* 103 */ if (p.x < this.lo.x)
+/* 104 */ this.lo.x = p.x;
+/* 105 */ if (p.y < this.lo.y)
+/* 106 */ this.lo.y = p.y;
+/* 107 */ if (p.z < this.lo.z)
+/* 108 */ this.lo.z = p.z;
+/* 109 */ if (p.x > this.hi.x)
+/* 110 */ this.hi.x = p.x;
+/* 111 */ if (p.y > this.hi.y)
+/* 112 */ this.hi.y = p.y;
+/* 113 */ if (p.z > this.hi.z) {
+/* 114 */ this.hi.z = p.z;
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */ public String toString()
+/* */ {
+/* 122 */ return "BoundBoxTemp[lo=" + this.lo + ", hi=" + this.hi + "]";
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\BoundBoxTemp.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file