Cleanup, optimization
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user