simulation: refresh the stepper latch only when a moving body is added or removed
Keeps the stationary add/remove path unchanged (test_surface_actuation builds a Simulation without a stepper). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e682d16c3a
commit
36eac713f4
@@ -172,6 +172,7 @@ class Simulation:
|
||||
self.bodies.stage_add(obj)
|
||||
return -1
|
||||
body_id = self.bodies.add(obj)
|
||||
if translation is not None:
|
||||
self._refresh_stepper_block()
|
||||
return body_id
|
||||
|
||||
@@ -273,7 +274,9 @@ class Simulation:
|
||||
if self._initialized:
|
||||
self.bodies.stage_remove(id)
|
||||
else:
|
||||
moving = self.bodies.get(id).motion is not None
|
||||
self.bodies.remove(id)
|
||||
if moving:
|
||||
self._refresh_stepper_block()
|
||||
|
||||
# -- Legacy convenience (keep for backward compat) -----------------------
|
||||
|
||||
Reference in New Issue
Block a user