pub struct TriggerVolume {
pub asset_id: AssetId,
pub position: [f32; 3],
pub rotation_deg: [f32; 3],
pub collider: PropCollider,
pub detects: TriggerFilter,
}Expand description
An invisible sensor region that reports when something enters or leaves it.
A trigger volume senses overlap and never collides: nothing bounces off
it and it blocks no movement. Behaviors listen for its
crossings with an enter or exit source, so “when the player steps into
this area, open that door” is two declared assets. detects filters what
sets it off: the player character, dynamic props, or anything. Volumes
sense at their authored position; they do not move at runtime.
TriggerVolume {
position: [4.0, 1.0, -2.0],
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
position: [f32; 3]World-space position of the volume’s center.
rotation_deg: [f32; 3]Euler rotation of the volume in degrees.
collider: PropColliderThe sensed region, in the same shape vocabulary as a
PropCollider: a cuboid with half_extents, a ball
with radius, or a capsule.
detects: TriggerFilterWhat sets the volume off: the player character, dynamic props, or
any of them.
Trait Implementations§
Source§impl Clone for TriggerVolume
impl Clone for TriggerVolume
Source§fn clone(&self) -> TriggerVolume
fn clone(&self) -> TriggerVolume
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for TriggerVolume
impl Component for TriggerVolume
Source§const NAME: &'static str = "TriggerVolume"
const NAME: &'static str = "TriggerVolume"
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§impl ComponentSlot for TriggerVolume
impl ComponentSlot for TriggerVolume
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.