OSDN Git Service

fixed issue 1070, Sphere#overlaps was wrong. oops
authorMario Zechner <contact@badlogicgames.com>
Sun, 30 Sep 2012 16:10:14 +0000 (18:10 +0200)
committerMario Zechner <contact@badlogicgames.com>
Sun, 30 Sep 2012 16:10:14 +0000 (18:10 +0200)
gdx/src/com/badlogic/gdx/math/collision/Sphere.java

index 3b790d2..2511006 100644 (file)
@@ -41,6 +41,6 @@ public class Sphere implements Serializable {
        /** @param sphere the other sphere\r
         * @return whether this and the other sphere overlap */\r
        public boolean overlaps (Sphere sphere) {\r
-               return center.dst2(sphere.center) < radius * radius + sphere.radius * radius;\r
+               return center.dst2(sphere.center) < (radius+sphere.radius)*(radius+sphere.radius);\r
        }\r
 }\r