| 205 | } |
| 206 | |
| 207 | function moveAABB(aabb: AABB) { |
| 208 | const d = { |
| 209 | x: Math.random(-0.5, 0.5), |
| 210 | y: Math.random(-0.5, 0.5), |
| 211 | }; |
| 212 | // d.x = 2.0; |
| 213 | // d.y = 0.0; |
| 214 | aabb.lowerBound.add(d); |
| 215 | aabb.upperBound.add(d); |
| 216 | |
| 217 | const c0 = Vec2.mid(aabb.lowerBound, aabb.upperBound); |
| 218 | const min = { |
| 219 | x: -WORLD_EXTENT, |
| 220 | y: 0.0, |
| 221 | }; |
| 222 | const max = { |
| 223 | x: WORLD_EXTENT, |
| 224 | y: 2.0 * WORLD_EXTENT, |
| 225 | }; |
| 226 | const c = Vec2.clampVec2(c0, min, max); |
| 227 | |
| 228 | aabb.lowerBound.add(c).sub(c0); |
| 229 | aabb.upperBound.add(c).sub(c0); |
| 230 | } |
| 231 | |
| 232 | function createProxy() { |
| 233 | for (let i = 0; i < actors.length; ++i) { |