feat(simulation): add vision cone with forward/peripheral/blind sectors (#111)

Implement direction-dependent visibility modulation per D-015.
Forward cone (~120 deg) at full range, peripheral (~180 deg each side)
at reduced range, blind spot (~60 deg behind) excluded. Facing component
updated on player movement via facing_from_delta.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 00:21:01 +01:00
co-authored by Claude Opus 4.6
parent 3323678ddf
commit f760624967
4 changed files with 305 additions and 1 deletions
+5
View File
@@ -3,6 +3,7 @@
// PlayerInput: semantic actions (MoveNorth, Interact, UsePerceptionMode)
use crate::bridge::types::{PlayerAction, PlayerInput};
use crate::perception::vision_cone::{facing_from_delta, Facing};
use crate::simulation::movement::{MoveIntent, PlayerCharacter, TilePosition};
use crate::simulation::time::SimulationTime;
use bevy_ecs::prelude::*;
@@ -101,6 +102,10 @@ fn apply_move(
commands.entity(entity).insert(MoveIntent {
target: TilePosition::new(pos.x + dx, pos.y + dy, pos.z),
});
// Update facing direction based on movement (D-015 vision cone)
commands
.entity(entity)
.insert(Facing(facing_from_delta(dx, dy)));
} else {
tracing::warn!("No player entity found for movement input");
}