// 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; }
public bool intersects(BVCylinder collider) { return intersects(ref collider); }
// 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; }