diff options
author | Steve <steveb9@u.washington.edu> | 2011-03-06 01:34:43 +0000 |
---|---|---|
committer | Steve <steveb9@u.washington.edu> | 2011-03-06 01:34:43 +0000 |
commit | a8cc6dd29f58272ca68821ae8084e9f7cd24029c (patch) | |
tree | 0797617922bcd566178880a685a1395fd571d152 /src/tesseract | |
parent | e21875c280c9e5b6ca5ddfb631bd5faf27b121d4 (diff) |
Remove size check calculateCollisions. It always returns 0. Darn
Diffstat (limited to 'src/tesseract')
-rw-r--r-- | src/tesseract/World.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/tesseract/World.java b/src/tesseract/World.java index 9b1e607..381e272 100644 --- a/src/tesseract/World.java +++ b/src/tesseract/World.java @@ -268,23 +268,25 @@ public class World implements Observer { for (int i = 0; i < myObjects.size() - 1; i++) { //Used to get size of CollsionInfo and if > 0 then there is a collison. - ArrayList<CollisionInfo> collisions = - CollisionDetector.calculateCollisions(myObjects.get(i),myObjects.get(i + 1)); - - if (collisions.size() > 0) { + /* ArrayList<CollisionInfo> collisions = + CollisionDetector.calculateCollisions(myObjects.get(i), myObjects.get(i + 1)); + + System.out.println("collision size: " + collisions.size());*/ + + // if (collisions.size() > 0) { for (int j = i + 1; j < myObjects.size(); j++) { //i and j are not a HalfSpaces, then they are regular objects colliding if (!(myObjects.get(i) instanceof HalfSpace) && !(myObjects.get(j) instanceof HalfSpace)) { - myObjects.get(i).resolveCollisions(myObjects.get(j), collisions); + myObjects.get(i).resolveCollisions(myObjects.get(j)); //i is a top or bottom so resolve regular collision } else if (myObjects.get(i).equals(my_top) || myObjects.get(i).equals(my_bottom)) { - myObjects.get(i).resolveCollisions(myObjects.get(j), collisions); + myObjects.get(i).resolveCollisions(myObjects.get(j)); //j is a top or bottom so resolve regular collision } else if (myObjects.get(j).equals(my_top) || myObjects.get(j).equals(my_bottom)) { - myObjects.get(i).resolveCollisions(myObjects.get(j), collisions); + myObjects.get(i).resolveCollisions(myObjects.get(j)); //i is now either a side or shape so if it is a side transmit j through side i if a neighbor exits } else if (myObjects.get(i) instanceof HalfSpace && myPeer.getPeerInDirection @@ -313,7 +315,7 @@ public class World implements Observer { continue; } } - } + // } } |