pub struct Velocity(pub Vec2);Expand description
How fast an entity moves, in pixels a second. The system
nadir::movement moves it by velocity × dt each tick: with a
Collider, it slides along what it meets.
Tuple Fields§
§0: Vec2Trait Implementations§
impl Component for Velocity
impl Copy for Velocity
Source§impl FromValue for Velocity
impl FromValue for Velocity
Source§const TYPE_NAME: &'static str = "Velocity"
const TYPE_NAME: &'static str = "Velocity"
The type’s name, as
Reflect::type_name gives it.Source§fn from_value(
value: &Value,
cx: &mut ReflectContext<'_>,
) -> Result<Self, ReflectError>
fn from_value( value: &Value, cx: &mut ReflectContext<'_>, ) -> Result<Self, ReflectError>
Makes a value of the type from
value. Read moreSource§impl Reflect for Velocity
impl Reflect for Velocity
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
The type’s name: for the macros’ types, its name as written
(
Health), which prefabs and saves use.Source§fn kind(&self) -> ReflectKind
fn kind(&self) -> ReflectKind
What sort of value it is.
Source§fn fields(&self) -> &'static [FieldInfo]
fn fields(&self) -> &'static [FieldInfo]
The fields of a struct, in order; none for other kinds.
Source§fn variants(&self) -> &'static [&'static str]
fn variants(&self) -> &'static [&'static str]
The variants of an enum, by name, in order, as data writes them:
what an inspector offers to pick from. None for other kinds, and by
default:
reflect_enum! gives its enum’s.Source§fn field(&self, index: usize) -> Option<&dyn Reflect>
fn field(&self, index: usize) -> Option<&dyn Reflect>
Field
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>
Field or element
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>
Sets the value from
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 moreimpl StructuralPartialEq for Velocity
Auto Trait Implementations§
impl Forget for Velocity
impl Freeze for Velocity
impl Move for Velocity
impl RefUnwindSafe for Velocity
impl Send for Velocity
impl Sync for Velocity
impl Unpin for Velocity
impl UnsafeUnpin for Velocity
impl UnwindSafe for Velocity
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
Mutably borrows from an owned value. Read more