optimize collider & fix sort of pendingRemoval array
@@ -110,11 +110,9 @@ class Collider
110
110
this.gameObject.transform.position.y + hh
111
111
];
112
112
113
if (points[0] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw ||
114
points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)
113
if (points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)
115
114
{
116
if (points[2] > o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh ||
117
points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)
115
if (points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)
118
116
{
119
117
hit = true;
120
118
}
@@ -110,11 +110,9 @@ class Collider110
this.gameObject.transform.position.y + hh110
this.gameObject.transform.position.y + hh111
];111
];112
112
113
if (points[0] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw ||113
if (points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)114
points[1] >= o2.transform.position.x - ohw && points[0] <= o2.transform.position.x + ohw)115
{114
{116
if (points[2] > o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh ||115
if (points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)117
points[3] >= o2.transform.position.y - ohh && points[2] <= o2.transform.position.y + ohh)118
{116
{119
hit = true;117
hit = true;120
}118
}@@ -125,7 +125,7 @@ class Scene
125
125
126
126
if (this.pendingRemoval.length)
127
127
{
128
this.pendingRemoval.sort();
128
this.pendingRemoval.sort((a, b) => a - b);
129
129
130
130
for (let i = this.pendingRemoval.length - 1; i >= 0; i--)
131
131
{
@@ -125,7 +125,7 @@ class Scene125
125
126
if (this.pendingRemoval.length)126
if (this.pendingRemoval.length)127
{127
{128
this.pendingRemoval.sort();128
this.pendingRemoval.sort((a, b) => a - b);129
129
130
for (let i = this.pendingRemoval.length - 1; i >= 0; i--) 130
for (let i = this.pendingRemoval.length - 1; i >= 0; i--) 131
{131
{