pub struct Vec3f32 {
pub x: f32,
pub y: f32,
pub z: f32,
}Expand description
A lower precision Vec3, used for some fields in entity metadata.
Fields§
§x: f32§y: f32§z: f32Implementations§
Source§impl Vec3f32
impl Vec3f32
pub const fn new(x: f32, y: f32, z: f32) -> Self
Sourcepub fn length_squared(&self) -> f32
pub fn length_squared(&self) -> f32
Get the distance of this vector to the origin by doing x^2 + y^2 + z^2.
Sourcepub fn distance_squared_to(self, other: Self) -> f32
pub fn distance_squared_to(self, other: Self) -> f32
Get the squared distance from this position to another position.
Equivalent to (self - other).length_squared().
pub fn horizontal_distance_squared(&self) -> f32
pub fn horizontal_distance_squared_to(self, other: Self) -> f32
Sourcepub fn down(&self, y: f32) -> Self
pub fn down(&self, y: f32) -> Self
Return a new instance of this position with the y coordinate decreased by the given number.
Sourcepub fn up(&self, y: f32) -> Self
pub fn up(&self, y: f32) -> Self
Return a new instance of this position with the y coordinate increased by the given number.
Sourcepub fn north(&self, z: f32) -> Self
pub fn north(&self, z: f32) -> Self
Return a new instance of this position with the z coordinate subtracted by the given number.
Sourcepub fn east(&self, x: f32) -> Self
pub fn east(&self, x: f32) -> Self
Return a new instance of this position with the x coordinate increased by the given number.
Sourcepub fn south(&self, z: f32) -> Self
pub fn south(&self, z: f32) -> Self
Return a new instance of this position with the z coordinate increased by the given number.
Sourcepub fn west(&self, x: f32) -> Self
pub fn west(&self, x: f32) -> Self
Return a new instance of this position with the x coordinate subtracted by the given number.
pub fn dot(&self, other: Self) -> f32
pub fn cross(&self, other: Self) -> Self
Sourcepub fn min(&self, other: Self) -> Self
pub fn min(&self, other: Self) -> Self
Make a new position with the lower coordinates for each axis.
Sourcepub fn max(&self, other: Self) -> Self
pub fn max(&self, other: Self) -> Self
Make a new position with the higher coordinates for each axis.
pub fn with_x(&self, x: f32) -> Self
pub fn with_y(&self, y: f32) -> Self
pub fn with_z(&self, z: f32) -> Self
Trait Implementations§
Source§impl AddAssign for Vec3f32
impl AddAssign for Vec3f32
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl AzBuf for Vec3f32
impl AzBuf for Vec3f32
fn azalea_write(&self, ctx: Ctx<'_>, buf: &mut impl Write) -> Result<()>
fn azalea_read( ctx: Ctx<'_>, buf: &mut Cursor<&[u8]>, ) -> Result<Self, BufReadError>
Source§impl<O: Ops> Codec<O> for Vec3f32
impl<O: Ops> Codec<O> for Vec3f32
Source§fn codec_read(ops: &O) -> ReadResult<Self>
fn codec_read(ops: &O) -> ReadResult<Self>
Source§fn codec_write(&self) -> WriteResult<O>
fn codec_write(&self) -> WriteResult<O>
type Incomplete = Result<Self, ReadError>
impl Copy for Vec3f32
Source§impl<O: Ops> Defaultable<O> for Vec3f32
impl<O: Ops> Defaultable<O> for Vec3f32
fn is_default(&self) -> bool
Source§impl<'de> Deserialize<'de> for Vec3f32
impl<'de> Deserialize<'de> for Vec3f32
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl DivAssign<f32> for Vec3f32
impl DivAssign<f32> for Vec3f32
Source§fn div_assign(&mut self, divisor: f32)
fn div_assign(&mut self, divisor: f32)
/= operation. Read moreSource§impl MulAssign<f32> for Vec3f32
impl MulAssign<f32> for Vec3f32
Source§fn mul_assign(&mut self, multiplier: f32)
fn mul_assign(&mut self, multiplier: f32)
*= operation. Read moreimpl StructuralPartialEq for Vec3f32
Auto Trait Implementations§
impl Forget for Vec3f32
impl Freeze for Vec3f32
impl Move for Vec3f32
impl RefUnwindSafe for Vec3f32
impl Send for Vec3f32
impl Sync for Vec3f32
impl Unpin for Vec3f32
impl UnsafeUnpin for Vec3f32
impl UnwindSafe for Vec3f32
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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>, which can then be
downcast into Box<dyn 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>, which 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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<A, B> Interchangeable<A> for B
impl<A, B> Interchangeable<A> for B
fn interchangeable_into(self) -> A
fn interchangeable_from(other: A) -> B
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.§impl<T> TypeData for T
impl<T> TypeData for T
§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.