Struct bevy::math::prelude::UVec2 [−][src]
A 2-dimensional vector.
Implementations
impl UVec2
[src]
pub const ZERO: UVec2
[src]
All zeroes.
pub const ONE: UVec2
[src]
All ones.
pub const X: UVec2
[src]
[1, 0]
: a unit-length vector pointing along the positive X axis.
pub const Y: UVec2
[src]
[0, 1]
: a unit-length vector pointing along the positive Y axis.
pub fn new(x: u32, y: u32) -> UVec2
[src]
Creates a new vector.
pub const fn unit_x() -> UVec2
[src]
Use Vec2::X instead
Creates a vector with values [x: 1.0, y: 0.0]
.
pub const fn unit_y() -> UVec2
[src]
Use Vec2::Y instead
Creates a vector with values [x: 0.0, y: 1.0]
.
pub fn extend(self, z: u32) -> UVec3
[src]
Creates a 3D vector from self
and the given z
value.
pub const fn zero() -> UVec2
[src]
use ZERO constant instead
Creates a vector with all elements set to 0.0
.
pub const fn one() -> UVec2
[src]
use ONE constant instead
Creates a vector with all elements set to 1.0
.
pub fn splat(v: u32) -> UVec2
[src]
Creates a vector with all elements set to v
.
pub fn select(mask: BVec2, if_true: UVec2, if_false: UVec2) -> UVec2
[src]
Creates a vector from the elements in if_true
and if_false
, selecting which to use
for each element of self
.
A true element in the mask uses the corresponding element from if_true
, and false
uses the element from if_false
.
pub fn dot(self, other: UVec2) -> u32
[src]
Computes the dot product of self
and other
.
pub fn min(self, other: UVec2) -> UVec2
[src]
Returns a vector containing the mininum values for each element of self
and other
.
In other words this computes [self.x.max(other.x), self.y.max(other.y), ..]
.
pub fn max(self, other: UVec2) -> UVec2
[src]
Returns a vector containing the maximum values for each element of self
and other
.
In other words this computes [self.x.max(other.x), self.y.max(other.y), ..]
.
pub fn min_element(self) -> u32
[src]
Returns the horizontal minimum of self
.
In other words this computes min(x, y, ..)
.
pub fn max_element(self) -> u32
[src]
Returns the horizontal maximum of self
.
In other words this computes max(x, y, ..)
.
pub fn cmpeq(self, other: UVec2) -> BVec2
[src]
Returns a vector mask containing the result of a ==
comparison for each element of
self
and other
.
In other words, this computes [self.x == other.x, self.y == other.y, ..]
for all
elements.
pub fn cmpne(self, other: UVec2) -> BVec2
[src]
Returns a vector mask containing the result of a !=
comparison for each element of
self
and other
.
In other words this computes [self.x != other.x, self.y != other.y, ..]
for all
elements.
pub fn cmpge(self, other: UVec2) -> BVec2
[src]
Returns a vector mask containing the result of a >=
comparison for each element of
self
and other
.
In other words this computes [self.x >= other.x, self.y >= other.y, ..]
for all
elements.
pub fn cmpgt(self, other: UVec2) -> BVec2
[src]
Returns a vector mask containing the result of a >
comparison for each element of
self
and other
.
In other words this computes [self.x > other.x, self.y > other.y, ..]
for all
elements.
pub fn cmple(self, other: UVec2) -> BVec2
[src]
Returns a vector mask containing the result of a <=
comparison for each element of
self
and other
.
In other words this computes [self.x <= other.x, self.y <= other.y, ..]
for all
elements.
pub fn cmplt(self, other: UVec2) -> BVec2
[src]
Returns a vector mask containing the result of a <
comparison for each element of
self
and other
.
In other words this computes [self.x < other.x, self.y < other.y, ..]
for all
elements.
pub fn from_slice_unaligned(slice: &[u32]) -> UVec2
[src]
Creates a vector from the first N values in slice
.
Panics
Panics if slice
is less than N elements long.
pub fn write_to_slice_unaligned(self, slice: &mut [u32])
[src]
Writes the elements of self
to the first N elements in slice
.
Panics
Panics if slice
is less than N elements long.
pub fn as_f32(&self) -> Vec2
[src]
Casts all elements of self
to f32
.
pub fn as_f64(&self) -> DVec2
[src]
Casts all elements of self
to f64
.
pub fn as_i32(&self) -> IVec2
[src]
Casts all elements of self
to i32
.
Trait Implementations
impl Add<UVec2> for UVec2
[src]
type Output = UVec2
The resulting type after applying the +
operator.
pub fn add(self, other: UVec2) -> UVec2
[src]
impl AddAssign<UVec2> for UVec2
[src]
pub fn add_assign(&mut self, other: UVec2)
[src]
impl AsMut<[u32; 2]> for UVec2
[src]
impl AsRef<[u32; 2]> for UVec2
[src]
impl Clone for UVec2
[src]
impl Copy for UVec2
[src]
impl Debug for UVec2
[src]
impl Default for UVec2
[src]
impl Deref for UVec2
[src]
type Target = XY<u32>
The resulting type after dereferencing.
pub fn deref(&self) -> &<UVec2 as Deref>::Target
[src]
impl DerefMut for UVec2
[src]
impl<'de> Deserialize<'de> for UVec2
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<UVec2, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<UVec2, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for UVec2
[src]
impl Div<UVec2> for UVec2
[src]
type Output = UVec2
The resulting type after applying the /
operator.
pub fn div(self, other: UVec2) -> UVec2
[src]
impl Div<u32> for UVec2
[src]
type Output = UVec2
The resulting type after applying the /
operator.
pub fn div(self, other: u32) -> UVec2
[src]
impl DivAssign<UVec2> for UVec2
[src]
pub fn div_assign(&mut self, other: UVec2)
[src]
impl DivAssign<u32> for UVec2
[src]
pub fn div_assign(&mut self, other: u32)
[src]
impl Eq for UVec2
[src]
impl From<[u32; 2]> for UVec2
[src]
impl From<(u32, u32)> for UVec2
[src]
impl From<UVec2> for XY<u32>
[src]
impl From<UVec2> for [u32; 2]
[src]
impl From<UVec2> for (u32, u32)
[src]
impl From<UVec3> for UVec2
[src]
impl From<UVec4> for UVec2
[src]
pub fn from(v: UVec4) -> UVec2
[src]
Creates a 2D vector from the x
and y
elements of self
, discarding z
and
w
.
impl From<XY<u32>> for UVec2
[src]
impl GetTypeRegistration for UVec2
pub fn get_type_registration() -> TypeRegistration
impl Hash for UVec2
[src]
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Index<usize> for UVec2
[src]
type Output = u32
The returned type after indexing.
pub fn index(&self, index: usize) -> &<UVec2 as Index<usize>>::Output
[src]
impl IndexMut<usize> for UVec2
[src]
impl Mul<UVec2> for UVec2
[src]
type Output = UVec2
The resulting type after applying the *
operator.
pub fn mul(self, other: UVec2) -> UVec2
[src]
impl Mul<u32> for UVec2
[src]
type Output = UVec2
The resulting type after applying the *
operator.
pub fn mul(self, other: u32) -> UVec2
[src]
impl MulAssign<UVec2> for UVec2
[src]
pub fn mul_assign(&mut self, other: UVec2)
[src]
impl MulAssign<u32> for UVec2
[src]
pub fn mul_assign(&mut self, other: u32)
[src]
impl PartialEq<UVec2> for UVec2
[src]
pub fn eq(&self, other: &UVec2) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<UVec2> for UVec2
[src]
pub fn partial_cmp(&self, other: &UVec2) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> Product<&'a UVec2> for UVec2
[src]
impl Reflect for UVec2
pub fn type_name(&self) -> &str
pub fn any(&self) -> &(dyn Any + 'static)
pub fn any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
pub fn apply(&mut self, value: &(dyn Reflect + 'static))
pub fn set(
&mut self,
value: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
&mut self,
value: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
pub fn reflect_ref(&self) -> ReflectRef<'_>
pub fn reflect_mut(&mut self) -> ReflectMut<'_>
pub fn reflect_hash(&self) -> Option<u64>
pub fn reflect_partial_eq(
&self,
value: &(dyn Reflect + 'static)
) -> Option<bool>
&self,
value: &(dyn Reflect + 'static)
) -> Option<bool>
pub fn serializable(&self) -> Option<Serializable<'_>>
impl Serialize for UVec2
[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl Sub<UVec2> for UVec2
[src]
type Output = UVec2
The resulting type after applying the -
operator.
pub fn sub(self, other: UVec2) -> UVec2
[src]
impl SubAssign<UVec2> for UVec2
[src]
pub fn sub_assign(&mut self, other: UVec2)
[src]
impl<'a> Sum<&'a UVec2> for UVec2
[src]
impl Vec2Swizzles for UVec2
[src]
type Vec3 = UVec3
type Vec4 = UVec4
pub fn xxxx(self) -> UVec4
[src]
pub fn xxxy(self) -> UVec4
[src]
pub fn xxyx(self) -> UVec4
[src]
pub fn xxyy(self) -> UVec4
[src]
pub fn xyxx(self) -> UVec4
[src]
pub fn xyxy(self) -> UVec4
[src]
pub fn xyyx(self) -> UVec4
[src]
pub fn xyyy(self) -> UVec4
[src]
pub fn yxxx(self) -> UVec4
[src]
pub fn yxxy(self) -> UVec4
[src]
pub fn yxyx(self) -> UVec4
[src]
pub fn yxyy(self) -> UVec4
[src]
pub fn yyxx(self) -> UVec4
[src]
pub fn yyxy(self) -> UVec4
[src]
pub fn yyyx(self) -> UVec4
[src]
pub fn yyyy(self) -> UVec4
[src]
pub fn xxx(self) -> UVec3
[src]
pub fn xxy(self) -> UVec3
[src]
pub fn xyx(self) -> UVec3
[src]
pub fn xyy(self) -> UVec3
[src]
pub fn yxx(self) -> UVec3
[src]
pub fn yxy(self) -> UVec3
[src]
pub fn yyx(self) -> UVec3
[src]
pub fn yyy(self) -> UVec3
[src]
pub fn xx(self) -> UVec2
[src]
pub fn yx(self) -> UVec2
[src]
pub fn yy(self) -> UVec2
[src]
Auto Trait Implementations
impl RefUnwindSafe for UVec2
impl Send for UVec2
impl Sync for UVec2
impl Unpin for UVec2
impl UnwindSafe for UVec2
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
T: Hash + ?Sized,
pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
B: BuildHasher,
H: Hash + ?Sized,
B: BuildHasher,
H: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash,
T: Hash,
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> Downcast<T> for T
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> DynEq for T where
T: Any + Eq,
T: Any + Eq,
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool
impl<T> DynHash for T where
T: DynEq + Hash,
T: DynEq + Hash,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> FromWorld for T where
T: Default,
T: Default,
pub fn from_world(_world: &mut World) -> T
impl<T> GetPath for T where
T: Reflect,
T: Reflect,
pub fn path(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
pub fn path_mut(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
pub fn get_path<T>(
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>> where
T: Reflect,
&'r self,
path: &'p str
) -> Result<&'r T, ReflectPathError<'p>> where
T: Reflect,
pub fn get_path_mut<T>(
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>> where
T: Reflect,
&'r mut self,
path: &'p str
) -> Result<&'r mut T, ReflectPathError<'p>> where
T: Reflect,
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
[src]
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<M> Measure for M where
M: Debug + PartialOrd<M> + Add<M, Output = M> + Default + Clone,
[src]
M: Debug + PartialOrd<M> + Add<M, Output = M> + Default + Clone,
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> TypeData for T where
T: 'static + Send + Sync + Clone,
T: 'static + Send + Sync + Clone,
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
impl<T> Upcast<T> for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,