Refactor fishing surfaces around authored water

This commit is contained in:
Alexander Sellite 2026-08-15 09:52:50 -04:00
parent 9f52620a73
commit 9afa60f6a5
11 changed files with 198 additions and 172 deletions

View file

@ -1,10 +1,6 @@
class_name FishingPresentation
extends Node3D
const WaterSurfaceMotionType = preload(
"res://world/water_surface_motion.gd"
)
signal cast_completed
signal outcome_completed(outcome: StringName)
signal presentation_interrupted
@ -58,7 +54,6 @@ var _rod_tip: Marker3D
var _rod_neutral_rotation: Vector3
var _cast_arrival_position: Vector3
var _active_cast_arc_height: float = 0.0
var _cast_tracks_water_surface: bool = false
var _bobber_surface_position: Vector3
var _bobber_idle_elapsed: float = 0.0
var _bobber_base_scale: Vector3 = Vector3.ONE
@ -76,9 +71,6 @@ func _process(delta: float) -> void:
if _mode == VisualMode.FISHING and _bobber.visible:
_bobber_idle_elapsed += delta
_apply_bobber_idle_motion()
var bobber_position := _bobber.global_position
bobber_position.y += WaterSurfaceMotionType.get_default_height_offset()
_bobber.global_position = bobber_position
if _line_mode != LineMode.HIDDEN:
_update_line(delta)
@ -173,8 +165,6 @@ func begin_cast(
if resolved_arc_height >= 0.0
else cast_arc_height
)
_cast_tracks_water_surface = not cast_is_blocked
var cast_start: Vector3 = _rod_tip.global_position
_bobber.global_position = cast_start
_begin_rod_release()
@ -311,7 +301,6 @@ func cleanup() -> void:
_bobber.rotation = Vector3.ZERO
_cast_arrival_position = Vector3.ZERO
_active_cast_arc_height = 0.0
_cast_tracks_water_surface = false
_bobber_surface_position = Vector3.ZERO
_bobber_idle_elapsed = 0.0
set_line_mode(LineMode.HIDDEN)
@ -329,11 +318,6 @@ func _set_cast_sample(
) -> void:
var sample: Vector3 = start.lerp(target, progress)
sample.y += sin(progress * PI) * _active_cast_arc_height
if _cast_tracks_water_surface:
sample.y += (
WaterSurfaceMotionType.get_default_height_offset()
* smoothstep(0.72, 1.0, progress)
)
_bobber.global_position = sample