fix(client): cutaway cuts the camera-character sightline corridor, not a proximity dome (T-1088)
Live-session finding: the half-disc cut bit nearby side walls while leaving the wall actually occluding the character at full height, with dome-contour scallops across the two-row walls. Rewritten as a sightline corridor: walls within CUT_CORRIDOR_HALF_W of the character's x, camera-side, out to a pitch-derived reach (WALL_H / tan(pitch) — how far a wall can still occlude in ortho; ~4.3 m at -30, breathes with the T-cycle tilt) drop to the stub. FollowCamera3D exposes pitch_deg(); reach clamped 0.5-16 m. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -270,7 +270,14 @@ func _install_facing_provider() -> void:
|
||||
func _per_frame_update(delta: float) -> void:
|
||||
if not _first_snapshot_seen:
|
||||
return
|
||||
greybox.set_cutaway_char_pos(player_rig.global_position)
|
||||
# Corridor reach: how far camera-side a WALL_H wall can still occlude the
|
||||
# character in ortho at the current (smoothed) pitch. Clamped: the -5 deg
|
||||
# frontal preset would otherwise ask for a ~29 m corridor.
|
||||
var pitch_abs: float = maxf(absf(camera_rig.pitch_deg()), 5.0)
|
||||
var reach: float = clampf(
|
||||
SandboxConstants.WALL_H / tan(deg_to_rad(pitch_abs)), 0.5, 16.0
|
||||
)
|
||||
greybox.set_cutaway_char_pos(player_rig.global_position, reach)
|
||||
_anim.update(delta)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user