Skip to main content

concinnity_core/components/
volume_event.rs

1// src/components/volume_event.rs
2
3use crate::ecs::asset_id::AssetId;
4
5/// Runtime-only event published by the physics system when something crossing
6/// a TriggerVolume boundary passes the volume's `detects` filter. `entered` is
7/// true on the way in and false on the way out. BehaviorSystem reads these
8/// from its `Events<VolumeEvent>` queue each step (one tick after the crossing,
9/// since physics runs later in the schedule). World authors never declare
10/// this type directly.
11#[derive(Debug, Clone, Copy)]
12pub struct VolumeEvent {
13    /// The TriggerVolume that was crossed.
14    pub volume: AssetId,
15    /// `true` on the way in, `false` on the way out.
16    pub entered: bool,
17}