Exemple #1
0
        public void set(AABox box)
        {
            mins.x = box.mins.x;
            mins.y = box.mins.y;
            mins.z = box.mins.z;

            maxs.x = box.maxs.x;
            maxs.y = box.maxs.y;
            maxs.z = box.maxs.z;
        }
Exemple #2
0
        public static void sub(AABox b, Vector3 p)
        {
            b.mins.x -= p.x;
            b.mins.y -= p.y;
            b.mins.z -= p.z;

            b.maxs.x -= p.x;
            b.maxs.y -= p.y;
            b.maxs.z -= p.z;
        }
Exemple #3
0
        public static void add(AABox b, Vector3 p)
        {
            b.mins.x += p.x;
            b.mins.y += p.y;
            b.mins.z += p.z;

            b.maxs.x += p.x;
            b.maxs.y += p.y;
            b.maxs.z += p.z;
        }
Exemple #4
0
        public static void sub(out AABox r, AABox b, Vector3 p)
        {
            r = new AABox();

            r.mins.x = b.mins.x - p.x;
            r.mins.y = b.mins.y - p.y;
            r.mins.z = b.mins.z - p.z;

            r.maxs.x = b.maxs.x - p.x;
            r.maxs.y = b.maxs.y - p.y;
            r.maxs.z = b.maxs.z - p.z;
        }
Exemple #5
0
        // AABox operations
        public static void add(out AABox r, AABox b, Vector3 p)
        {
            r = new AABox();

            r.mins.x = b.mins.x + p.x;
            r.mins.y = b.mins.y + p.y;
            r.mins.z = b.mins.z + p.z;

            r.maxs.x = b.maxs.x + p.x;
            r.maxs.y = b.maxs.y + p.y;
            r.maxs.z = b.maxs.z + p.z;
        }
Exemple #6
0
 public AABox(AABox box)
 {
     mins = new Vector3(box.mins);
     maxs = new Vector3(box.maxs);
 }
Exemple #7
0
 public static bool testIntersection(AABox box1, AABox box2)
 {
     // Look for a separating axis on each box for each axis
     return(!(box1.mins.x > box2.maxs.x || box1.mins.y > box2.maxs.y || box1.mins.z > box2.maxs.z ||
              box2.mins.x > box1.maxs.x || box2.mins.y > box1.maxs.y || box2.mins.z > box1.maxs.z));
 }
Exemple #8
0
 public static bool testInside(Vector3 point, AABox box)
 {
     return(Math.allComponentsGreaterThan(point, box.mins) && Math.allComponentsLessThan(point, box.maxs));
 }