extends SceneTree ## Does the greengrocer actually come to REST, or does it jitter forever? A pyramid of ## spheres that never quite stops is fruit slowly walking off the display all shift. func _initialize() -> void: var main: Node = (load("res://main.tscn") as PackedScene).instantiate() get_root().add_child(main) await process_frame main._load_level("grocer") for t in 10: for i in 60: await physics_frame var total := 0.0 var worst := 0.0 var awake := 0 for n in get_nodes_in_group("smashable"): var b := n as RigidBody3D if b == null or b.freeze: continue if not b.sleeping: awake += 1 var v := b.linear_velocity.length() total += v worst = maxf(worst, v) print("t=%2ds total %6.3f m/s worst body %5.3f awake %d" % [ t + 1, total, worst, awake]) quit()