Subversion Repositories AndroidProjects

Rev

Blame | Last modification | View Log | RSS feed

package com.gebauz.bauzoid.math.collisionx;

/** Interface for objects that can be enclosed in an axis-aligned bounding box. */
public class AABoundingBox
{

        // Constants========================================================================================

        // Embedded Types===================================================================================

        // Fields===========================================================================================
       
        public float left = 0;
        public float top = 0;
        public float bottom = 0;
        public float right = 0;

        // Methods==========================================================================================
       
        public AABoundingBox(float l, float t, float r, float b)
        {
                left = l; top = t; bottom = b; right = r;
        }
       
        public boolean intersetcs(AABoundingBox other)
        {
                return !((other.left > right) ||
                                 (other.right < left) ||
                                 (other.top > bottom) ||
                                 (other.bottom < top));
        }

        // Getters/Setters==================================================================================


}