|
1 | | -import { MiraType } from "@/mirabuf/MirabufLoader" |
2 | | -import MirabufSceneObject from "@/mirabuf/MirabufSceneObject" |
3 | 1 | import SimulationSystem from "@/systems/simulation/SimulationSystem" |
4 | | -import World from "@/systems/World" |
5 | | -import type SceneRenderer from "../scene/SceneRenderer" |
| 2 | +import World from "@/systems/World.ts" |
6 | 3 | import MatchMode from "./MatchMode" |
7 | 4 |
|
8 | 5 | const BUFFER_HEIGHT = 0.1 |
@@ -31,14 +28,10 @@ class RobotDimensionTracker { |
31 | 28 | this._sideExtensionPenalty = sideExtensionPenalty |
32 | 29 | } |
33 | 30 |
|
34 | | - public static update(sceneRenderer: SceneRenderer): void { |
| 31 | + public static update(): void { |
35 | 32 | if (!MatchMode.getInstance().isMatchEnabled()) return |
36 | 33 |
|
37 | | - const robots = [...sceneRenderer.sceneObjects.values()].filter( |
38 | | - (obj): obj is MirabufSceneObject => obj instanceof MirabufSceneObject && obj.miraType === MiraType.ROBOT |
39 | | - ) |
40 | | - |
41 | | - robots.forEach(robot => { |
| 34 | + World.sceneRenderer.mirabufSceneObjects.getRobots().forEach(robot => { |
42 | 35 | const dimensions = this._ignoreRotation ? robot.getDimensionsWithoutRotation() : robot.getDimensions() |
43 | 36 |
|
44 | 37 | if (dimensions.height > this._maxHeight + BUFFER_HEIGHT) { |
@@ -69,11 +62,7 @@ class RobotDimensionTracker { |
69 | 62 | this._robotSize.clear() |
70 | 63 | this._robotLastFramePenalty.clear() |
71 | 64 |
|
72 | | - const robots = [...World.sceneRenderer.sceneObjects.values()].filter( |
73 | | - (obj): obj is MirabufSceneObject => obj instanceof MirabufSceneObject && obj.miraType === MiraType.ROBOT |
74 | | - ) |
75 | | - |
76 | | - robots.forEach(robot => { |
| 65 | + World.sceneRenderer.mirabufSceneObjects.getRobots().forEach(robot => { |
77 | 66 | this._robotSize.set(robot.id, robot.getDimensions()) |
78 | 67 | }) |
79 | 68 | } |
|
0 commit comments