Back to project page Layrd.
The source code is released under:
MIT License
If you think the Android project Layrd listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.Voltronics.game; /*from w w w. ja v a 2s . c om*/ import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; public class LayrdPhysics { public static boolean overlapRectangles (Rectangle r1, Rectangle r2) { if (r1.x < r2.x + r2.width && r1.x + r1.width > r2.x && r1.y < r2.y + r2.height && r1.y + r1.height > r2.y) return true; else return false; } public static boolean pointInRectangle (Rectangle r, Vector2 p) { return r.x <= p.x && r.x + r.width >= p.x && r.y <= p.y && r.y + r.height >= p.y; } public static boolean pointInRectangle (Rectangle r, float x, float y) { return r.x <= x && r.x + r.width >= x && r.y <= y && r.y + r.height >= y; } }