pub struct Collider(pub Collider);Expand description
What an entity collides with: a nadir_collision::Collider, offset
from its Transform. The engine builds the
Collisions world from these each tick.
A child’s solid collider (Parent) is in its own parent’s way when
the child’s layer is in the parent’s mask, as Collider::solid makes
it: the parent moves while the child is still where the last tick left
it, so a move toward the child stops at it, as at a wall. Give the child
a layer outside its parent’s mask, or make it a trigger, which stops
nothing.
It is reflected by hand, its layers by the names
App::collision_layers gives them
(crate::reflected, ADR-0038).
Tuple Fields§
§0: ColliderImplementations§
Trait Implementations§
impl Component for Collider
impl Copy for Collider
Source§impl FromValue for Collider
impl FromValue for Collider
Source§fn from_value(
value: &Value,
cx: &mut ReflectContext<'_>,
) -> Result<Self, ReflectError>
fn from_value( value: &Value, cx: &mut ReflectContext<'_>, ) -> Result<Self, ReflectError>
A solid collider on every layer, colliding with every layer, at the
entity’s position, as Collider::solid makes one, of the value’s
shape, which it needs; then the other fields the value names.
Source§const TYPE_NAME: &'static str = "Collider"
const TYPE_NAME: &'static str = "Collider"
Reflect::type_name gives it.Source§impl Reflect for Collider
impl Reflect for Collider
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Health), which prefabs and saves use.Source§fn kind(&self) -> ReflectKind
fn kind(&self) -> ReflectKind
Source§fn fields(&self) -> &'static [FieldInfo]
fn fields(&self) -> &'static [FieldInfo]
Source§fn field(&self, _index: usize) -> Option<&dyn Reflect>
fn field(&self, _index: usize) -> Option<&dyn Reflect>
index of a struct, or element index of a list or an
option.Source§fn field_mut(&mut self, _index: usize) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, _index: usize) -> Option<&mut dyn Reflect>
index, to change it.Source§fn apply_value(
&mut self,
value: &Value,
cx: &mut ReflectContext<'_>,
) -> Result<(), ReflectError>
fn apply_value( &mut self, value: &Value, cx: &mut ReflectContext<'_>, ) -> Result<(), ReflectError>
value. A field that value does not name
keeps its value; a field it names that the type does not have is a
warning. On an error, what was applied before it stays applied. Read moreSource§fn variants(&self) -> &'static [&'static str]
fn variants(&self) -> &'static [&'static str]
reflect_enum! gives its enum’s.