File tree Expand file tree Collapse file tree
systems/simulation/synthesis_brain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import InitialConfigPanel from "@/panels/configuring/initial-config/InitialConfi
88import { PAUSE_REF_ASSEMBLY_SPAWNING } from "@/systems/physics/PhysicsTypes.ts"
99import { createMirabuf } from "@/mirabuf/MirabufSceneObject.ts"
1010import { getTargetControls } from "@/systems/scene/CameraControls.ts"
11+ import { detectAndTagWheels } from "@/systems/simulation/synthesis_brain/WheelDetector"
1112import type { EncodedAssembly , Message } from "@/systems/multiplayer/types.ts"
1213import { ProgressHandle } from "@/components/ProgressNotificationData.ts"
1314
@@ -271,6 +272,10 @@ class MirabufCachingService {
271272 return
272273 }
273274
275+ if ( assembly . dynamic ) {
276+ detectAndTagWheels ( assembly )
277+ }
278+
274279 const info = await MirabufCachingService . storeAssemblyInCache ( assembly , { miraType } )
275280 if ( ! info ) return
276281
Original file line number Diff line number Diff line change @@ -287,6 +287,9 @@ export function detectAndTagWheels(assembly: mirabuf.Assembly): void {
287287 const jointDefs = assembly . data ?. joints ?. jointDefinitions as Record < string , mirabuf . joint . IJoint > | undefined
288288 if ( ! jointDefs ) return
289289
290+ const hasExistingWheels = Object . values ( jointDefs ) . some ( jDef => jDef . userData ?. data ?. [ "wheel" ] === "true" )
291+ if ( hasExistingWheels ) return
292+
290293 const candidates = extractCandidates ( jointDefs )
291294 if ( candidates . length < 2 ) return
292295
You can’t perform that action at this time.
0 commit comments