pub struct ItemDisplayTranslation(pub Vec3);
Tuple Fields§
§0: Vec3
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.
Sourcepub fn north(&self, z: f64) -> Vec3
pub fn north(&self, z: f64) -> Vec3
Return a new instance of this position with the z coordinate subtracted by the given number.
Sourcepub fn east(&self, x: f64) -> Vec3
pub fn east(&self, x: f64) -> Vec3
Return a new instance of this position with the x coordinate increased by the given number.
Sourcepub fn south(&self, z: f64) -> Vec3
pub fn south(&self, z: f64) -> Vec3
Return a new instance of this position with the z coordinate increased by the given number.
Sourcepub fn west(&self, x: f64) -> Vec3
pub fn west(&self, x: f64) -> Vec3
Return a new instance of this position with the x coordinate subtracted 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 ItemDisplayTranslation
impl Clone for ItemDisplayTranslation
Source§fn clone(&self) -> ItemDisplayTranslation
fn clone(&self) -> ItemDisplayTranslation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Component for ItemDisplayTranslation
impl Component for ItemDisplayTranslation
Source§impl Deref for ItemDisplayTranslation
impl Deref for ItemDisplayTranslation
Auto Trait Implementations§
impl Freeze for ItemDisplayTranslation
impl RefUnwindSafe for ItemDisplayTranslation
impl Send for ItemDisplayTranslation
impl Sync for ItemDisplayTranslation
impl Unpin for ItemDisplayTranslation
impl UnwindSafe for ItemDisplayTranslation
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<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)
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>
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>
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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.