pub struct Physics {
pub velocity: Vec3,
pub xxa: f32,
pub yya: f32,
pub zza: f32,
pub on_ground: bool,
pub last_on_ground: bool,
pub dimensions: EntityDimensions,
pub bounding_box: AABB,
pub has_impulse: bool,
pub horizontal_collision: bool,
pub vertical_collision: bool,
}
Expand description
The physics data relating to the entity, such as position, velocity, and bounding box.
Fields§
§velocity: Vec3
How fast the entity is moving.
xxa: f32
X acceleration.
yya: f32
Y acceleration.
zza: f32
Z acceleration.
on_ground: bool
§last_on_ground: bool
§dimensions: EntityDimensions
The width and height of the entity.
bounding_box: AABB
The bounding box of the entity. This is more than just width and height, unlike dimensions.
has_impulse: bool
§horizontal_collision: bool
§vertical_collision: bool
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Physics
impl RefUnwindSafe for Physics
impl Send for Physics
impl Sync for Physics
impl Unpin for Physics
impl UnwindSafe for Physics
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
§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId), )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.