Struct azalea_entity::LastSentPosition
source · pub struct LastSentPosition(/* private fields */);Expand description
The last position of the entity that was sent over the network.
Methods from Deref<Target = Vec3>§
pub fn with_delta(&self, delta: &impl PositionDeltaTrait) -> Vec3
pub fn length_squared(&self) -> f64
pub fn normalize(&self) -> Vec3
pub fn multiply(&self, x: f64, y: f64, z: f64) -> Vec3
pub fn scale(&self, amount: f64) -> Vec3
sourcepub fn length_sqr(&self) -> f64
pub fn length_sqr(&self) -> f64
Get the distance of this vector to the origin by doing x^2 + y^2 + z^2.
sourcepub fn distance_to_sqr(&self, other: &Vec3) -> f64
pub fn distance_to_sqr(&self, other: &Vec3) -> f64
Get the squared distance from this position to another position.
Equivalent to (self - other).length_sqr().
pub fn horizontal_distance_sqr(&self) -> f64
pub fn horizontal_distance_to_sqr(&self, other: &Vec3) -> f64
sourcepub fn down(&self, y: f64) -> Vec3
pub fn down(&self, y: f64) -> Vec3
Return a new instance of this position with the y coordinate decreased by the given number.
sourcepub fn up(&self, y: f64) -> Vec3
pub fn up(&self, y: f64) -> Vec3
Return a new instance of this position with the y coordinate increased by the given number.
pub fn dot(&self, other: Vec3) -> f64
sourcepub fn length(&self) -> f64
pub fn length(&self) -> f64
Get the distance of this vector to the origin by doing
sqrt(x^2 + y^2 + z^2).
sourcepub fn distance_to(&self, other: &Vec3) -> f64
pub fn distance_to(&self, other: &Vec3) -> f64
Get the distance from this position to another position.
Equivalent to (self - other).length().
Trait Implementations§
source§impl Clone for LastSentPosition
impl Clone for LastSentPosition
source§fn clone(&self) -> LastSentPosition
fn clone(&self) -> LastSentPosition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Component for LastSentPosition
impl Component for LastSentPosition
§type Storage = TableStorage
type Storage = TableStorage
A marker type indicating the storage type used for this component.
This must be either
TableStorage or SparseStorage.source§impl Debug for LastSentPosition
impl Debug for LastSentPosition
source§impl Default for LastSentPosition
impl Default for LastSentPosition
source§fn default() -> LastSentPosition
fn default() -> LastSentPosition
Returns the “default value” for a type. Read more
source§impl Deref for LastSentPosition
impl Deref for LastSentPosition
source§impl DerefMut for LastSentPosition
impl DerefMut for LastSentPosition
source§impl From<&LastSentPosition> for BlockPos
impl From<&LastSentPosition> for BlockPos
source§fn from(value: &LastSentPosition) -> Self
fn from(value: &LastSentPosition) -> Self
Converts to this type from the input type.
source§impl From<&LastSentPosition> for ChunkPos
impl From<&LastSentPosition> for ChunkPos
source§fn from(value: &LastSentPosition) -> Self
fn from(value: &LastSentPosition) -> Self
Converts to this type from the input type.
source§impl From<&LastSentPosition> for Vec3
impl From<&LastSentPosition> for Vec3
source§fn from(value: &LastSentPosition) -> Self
fn from(value: &LastSentPosition) -> Self
Converts to this type from the input type.
source§impl From<LastSentPosition> for BlockPos
impl From<LastSentPosition> for BlockPos
source§fn from(value: LastSentPosition) -> Self
fn from(value: LastSentPosition) -> Self
Converts to this type from the input type.
source§impl From<LastSentPosition> for ChunkPos
impl From<LastSentPosition> for ChunkPos
source§fn from(value: LastSentPosition) -> Self
fn from(value: LastSentPosition) -> Self
Converts to this type from the input type.
source§impl PartialEq for LastSentPosition
impl PartialEq for LastSentPosition
source§fn eq(&self, other: &LastSentPosition) -> bool
fn eq(&self, other: &LastSentPosition) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Copy for LastSentPosition
impl StructuralPartialEq for LastSentPosition
Auto Trait Implementations§
impl RefUnwindSafe for LastSentPosition
impl Send for LastSentPosition
impl Sync for LastSentPosition
impl Unpin for LastSentPosition
impl UnwindSafe for LastSentPosition
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
source§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
§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self using data from the given World.