Cleanup, optimization

This commit is contained in:
Anuken
2020-05-01 16:35:18 -04:00
parent 3101fc8056
commit 135b87fdb2
20 changed files with 138 additions and 154 deletions
+4 -4
View File
@@ -45,8 +45,8 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
array.sort(comp);
}
public void collide(EntityGroup<? extends Hitboxc> other){
collisions.collideGroups((EntityGroup<? extends Hitboxc>)this, other);
public void collide(){
collisions.collide((EntityGroup<? extends Hitboxc>)this);
}
public void updatePhysics(){
@@ -108,14 +108,14 @@ public class EntityGroup<T extends Entityc> implements Iterable<T>{
public void intersect(float x, float y, float width, float height, Cons<? super T> out){
//don't waste time for empty groups
if(isEmpty()) return;
tree.getIntersect(out, x, y, width, height);
tree.intersect(height, x, y, width, out);
}
public Array<T> intersect(float x, float y, float width, float height){
intersectArray.clear();
//don't waste time for empty groups
if(isEmpty()) return intersectArray;
tree.getIntersect(intersectArray, intersectRect.set(x, y, width, height));
tree.intersect(intersectRect.set(x, y, width, height), intersectArray);
return intersectArray;
}