extends TestCase ## The client sea from issue W6 follows the simulation's sea level. func test_surface_follows_the_simulation_sea_level() -> void: var sim: Simulation = Simulation.new(1, SimGround.flat()) var view: WaterView = WaterView.new() view.follow(sim) assert_eq(view.surface().position.y, Tuning.SEA_LEVEL_START) sim.set_sea_level(8.0) view.follow(sim) assert_eq(view.surface().position.y, 8.0) assert_eq(view.level, 8.0) # The surface covers the whole world and well past it, so no edge is ever in view. var mesh: PlaneMesh = view.surface().mesh assert_true(mesh.size.x >= Tuning.WORLD_SIZE_METRES * 4.0) assert_near(view.surface().position.x, Tuning.WORLD_SIZE_METRES * 0.5, 0.001) assert_eq(view.surface().cast_shadow, GeometryInstance3D.SHADOW_CASTING_SETTING_OFF) view.free()