예제 #1
0
        // Finds if the two cylinders are intersecting each other
        public bool intersects(ref BVCylinder collider)
        {
            if(Math.Abs(pPos.x-collider.pPos.x)> pRadius+collider.radius)
                return false;
            if(Math.Abs(pPos.z-collider.pPos.z)> pRadius+collider.radius)
                return false;
            if(pPos.y> collider.topPos.y)
                return false;
            if(topPos.y< collider.pPos.y)
                return false;

            return true;
        }
예제 #2
0
 public bool intersects(BVCylinder collider)
 {
     return intersects(ref collider);
 }
예제 #3
0
        // Finds if the cylinder collides with the box
        public bool intersects(ref BVCylinder collider)
        {
            // Variables
            BVRectangle	rect=	toRectangle();
            BVCircle	circ=	collider.toCircle();

            if(!rect.intersects(ref circ))
                return false;

            return true;
        }