H11: Hide pines between the shoulder camera and the player
PropView.clear_view() hides every pine whose drawn shape crosses the line from the camera to the followed player's chest or head, or holds the camera, and shows it again once the line is clear. Candidates come from the trunks in the ground's solid index around the line. MatchView.follow() applies it; look_from() (framing, overview) shows everything again. Test: a player against the most crowded pine on seed 2, at 16 yaws, hides exactly the blocking pines and brings them all back afterwards. Captures canopy and canopy_before (tools/capture.sh canopy ...). Closes #75 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -105,6 +105,10 @@ func follow(entity_id: int, pitch: float = NAN, look_yaw: float = NAN) -> bool:
|
||||
feet = figure.position
|
||||
camera.transform = rig.solve(feet, yaw, look_pitch, player.crouching, sim.ground)
|
||||
camera.fov = rig.fov()
|
||||
# Pines between the lens and the player are hidden (H11).
|
||||
var height: float = Movement.body_height(player)
|
||||
var lines: Array[Vector3] = [feet + Vector3(0.0, height * 0.6, 0.0), feet + Vector3(0.0, height, 0.0)]
|
||||
props.clear_view(sim.ground, camera.transform.origin, lines)
|
||||
_focus()
|
||||
return true
|
||||
|
||||
@@ -138,6 +142,8 @@ func frame(entity_id: int, distance: float = 6.0, height: float = 2.6, beyond: V
|
||||
func look_from(eye: Vector3, target: Vector3) -> void:
|
||||
camera.transform = Transform3D(Basis.IDENTITY, eye).looking_at(target, Vector3.UP)
|
||||
camera.fov = CameraRig.FOV
|
||||
var none: Array[Vector3] = []
|
||||
props.clear_view(sim.ground, eye, none)
|
||||
_focus()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user