feat: 更新 IntoHole 的球体、滑槽和环境资产
- 为铁球、陶瓷球和木球制作风格化材质,归档 CC0 原始参考 - 更新方形球洞和实心滑槽,统一 90° 弯槽并兼容旧存档 - 用顺流泡沫表示水流方向,为冰块制作三种交错的裂纹 - 同步 Blender 源资产、Godot 加载、工坊和试玩预览
This commit is contained in:
@@ -12,7 +12,7 @@ func check(name: String, ok: bool, detail: Dictionary={}) -> void:
|
||||
func run() -> void:
|
||||
var app=load("res://playtest/baseline/scenes/main.tscn").instantiate()
|
||||
root.add_child(app)
|
||||
app.build_preset(4)
|
||||
app.build_preset(3)
|
||||
await physics_frame
|
||||
check("two_iron_balls_ready",app.merge_balls.size()==2 and app.merge_balls.all(func(b):return b.freeze and is_equal_approx(b.radius,.3) and b.linear_velocity.is_zero_approx()))
|
||||
check("separate_equal_height_branches",is_equal_approx(app.merge_balls[0].position.y,app.merge_balls[1].position.y) and is_equal_approx(absf(app.merge_balls[0].position.z-app.merge_balls[1].position.z),1.0))
|
||||
|
||||
@@ -26,35 +26,26 @@ func record(name: String, passed: bool, detail: Dictionary) -> void:
|
||||
if not passed:failures+=1
|
||||
print(("PASS " if passed else "FAIL ")+name+" "+JSON.stringify(detail))
|
||||
|
||||
func run_path(kind: String, rotation_step: int, branch: int, lower: bool, connected := false) -> void:
|
||||
func run_path(kind: String, rotation_step: int, branch: int, connected := false) -> void:
|
||||
await clear_arena()
|
||||
var basis:=Basis(Vector3.UP,-rotation_step*PI/2)
|
||||
arena.add_child(lib.create_piece(kind,Vector3.ZERO,rotation_step))
|
||||
var sphere=lib.create_ball()
|
||||
sphere.freeze=true
|
||||
var descending: bool=not lower and kind in ["gentle","steep"]
|
||||
var descending: bool=kind in ["gentle","steep"]
|
||||
var t:=.80 if descending else .05
|
||||
var direction: Vector3=lib.path_tangent(kind,0,branch,lower)
|
||||
var direction: Vector3=lib.path_tangent(kind,0,branch)
|
||||
var start: Vector3
|
||||
var target: Vector3
|
||||
var exit_direction: Vector3
|
||||
if lower:
|
||||
var guide: Dictionary=lib.lower_passage_spec(kind)
|
||||
arena.add_child(lib.create_box(Vector3(4,.1,4),Vector3(0,float(guide.floor_y)-.05,0),Color.GRAY))
|
||||
start=lib.path_point(kind,0,branch,true)-direction*.35+Vector3.UP*.015
|
||||
start.y=float(guide.center_height)+.015
|
||||
target=lib.path_point(kind,1,branch,true)
|
||||
target.y=float(guide.center_height)
|
||||
exit_direction=lib.path_tangent(kind,1,branch,true)
|
||||
else:
|
||||
start=lib.ball_on_surface(kind,t,branch)
|
||||
target=lib.ball_on_surface(kind,0 if descending else 1,branch)
|
||||
exit_direction=-lib.path_tangent(kind,0,branch) if descending else lib.path_tangent(kind,1,branch)
|
||||
if connected:
|
||||
for local_center in lib.y_connectors():arena.add_child(lib.create_piece("straight",basis*local_center,rotation_step))
|
||||
start=lib.path_point(kind,0,branch)+Vector3(-.65,-float(lib.catalog[kind].grooveRadius)+sphere.radius+.018,0)
|
||||
target=lib.path_point(kind,1,branch)+Vector3(.85,-float(lib.catalog[kind].grooveRadius)+sphere.radius,0)
|
||||
direction=Vector3.RIGHT
|
||||
start=lib.ball_on_surface(kind,t,branch)
|
||||
target=lib.ball_on_surface(kind,0 if descending else 1,branch)
|
||||
exit_direction=-lib.path_tangent(kind,0,branch) if descending else lib.path_tangent(kind,1,branch)
|
||||
if connected:
|
||||
for local_center in lib.y_connectors():arena.add_child(lib.create_piece("straight",basis*local_center,rotation_step))
|
||||
start=lib.path_point(kind,0,branch)+Vector3(-.65,-float(lib.catalog[kind].grooveRadius)+sphere.radius+.018,0)
|
||||
target=lib.path_point(kind,1,branch)+Vector3(.85,-float(lib.catalog[kind].grooveRadius)+sphere.radius,0)
|
||||
direction=Vector3.RIGHT
|
||||
arena.add_child(sphere)
|
||||
sphere.position=basis*start
|
||||
await physics_frame
|
||||
@@ -83,7 +74,7 @@ func run_path(kind: String, rotation_step: int, branch: int, lower: bool, connec
|
||||
time_at_exit=frame/120.0
|
||||
break
|
||||
if p.y < -2:break
|
||||
var path_name:="connected" if connected else ("lower" if lower else "upper")
|
||||
var path_name:="connected" if connected else "upper"
|
||||
record("%s_%s_r%d_b%d" % [path_name,kind,rotation_step*90,branch],reached and contact_frames>0,
|
||||
{"reached_exit":reached,"time":time_at_exit,"initial_speed":0.0 if descending else initial_speed,"closest_m":closest,"contact_frames":contact_frames,"max_speed":highest_speed,"final":vec(basis.inverse()*sphere.position),"trace":trace})
|
||||
|
||||
@@ -156,13 +147,12 @@ func run() -> void:
|
||||
for i in range(150):await physics_frame
|
||||
var momentum_error: float=(left.linear_velocity+right.linear_velocity).length()
|
||||
record("ball_to_ball_collision_enabled",left.linear_velocity.x<-.02 and right.linear_velocity.x>.02 and momentum_error<.02,{"left_velocity":vec(left.linear_velocity),"right_velocity":vec(right.linear_velocity),"normalized_momentum_error":momentum_error})
|
||||
for kind in ["straight","turn_cw","turn_ccw","gentle","steep","y_merge"]:
|
||||
for kind in ["straight","turn_90","gentle","steep","y_merge"]:
|
||||
for q in range(4):
|
||||
for branch in range(2 if kind=="y_merge" else 1):
|
||||
await run_path(kind,q,branch,false)
|
||||
await run_path(kind,q,branch,true)
|
||||
await run_path(kind,q,branch)
|
||||
for q in range(4):
|
||||
for branch in range(2):await run_path("y_merge",q,branch,false,true)
|
||||
for branch in range(2):await run_path("y_merge",q,branch,true)
|
||||
# Air response independently of contacts; compare actual simulated velocities.
|
||||
var air_velocities: Array=[]
|
||||
for mass_factor in [1.0,10.0]:
|
||||
|
||||
@@ -43,12 +43,12 @@ func run() -> void:
|
||||
check("rotation_cycle_"+kind,app.preview_quarter==0 and app.records[0].quarter==0)
|
||||
check("y_has_declared_four_cell_footprint",app.lib.footprint("y_merge")==Vector2i(2,2) and app.lib.catalog.y_merge.declaredBoundsFits and app.lib.catalog.y_merge.ports.size()==3)
|
||||
check("y_not_mislabelled_as_steep_exception",not app.warning_label.text.contains("陡坡"))
|
||||
app.build_preset(3)
|
||||
app.build_preset(2)
|
||||
await physics_frame
|
||||
var previous: int=app.records.size()
|
||||
app.selected_cell=Vector2i(2,0)
|
||||
app.placement_height=.5
|
||||
app.choose_kind("turn_cw")
|
||||
app.choose_kind("turn_90")
|
||||
app.place_selected()
|
||||
check("place_adjacent_tile",app.records.size()==previous+1 and app.find_cell(Vector2i(2,0))>=0)
|
||||
app.toggle_run()
|
||||
|
||||
Reference in New Issue
Block a user