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<TriggerVolume, CnResult>
fn from_baked(bytes: &[u8]) -> Result<TriggerVolume, 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.Source§fn slot(s: &ComponentStorage) -> &Column<TriggerVolume>
fn slot(s: &ComponentStorage) -> &Column<TriggerVolume>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<TriggerVolume>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<TriggerVolume>
Source§impl Debug for TriggerVolume
impl Debug for TriggerVolume
Source§impl Default for TriggerVolume
impl Default for TriggerVolume
Source§fn default() -> TriggerVolume
fn default() -> TriggerVolume
Source§impl<'de> Deserialize<'de> for TriggerVolumewhere
TriggerVolume: Default,
impl<'de> Deserialize<'de> for TriggerVolumewhere
TriggerVolume: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TriggerVolume, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TriggerVolume, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<TriggerVolume> for ComponentAsset
impl From<TriggerVolume> for ComponentAsset
Source§fn from(c: TriggerVolume) -> ComponentAsset
fn from(c: TriggerVolume) -> ComponentAsset
impl RuntimeComponent for TriggerVolume
Source§impl Serialize for TriggerVolume
impl Serialize for TriggerVolume
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TriggerVolume
impl RefUnwindSafe for TriggerVolume
impl Send for TriggerVolume
impl Sync for TriggerVolume
impl Unpin for TriggerVolume
impl UnsafeUnpin for TriggerVolume
impl UnwindSafe for TriggerVolume
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().