Struct bevy_math::IVec3 [−][src]
A 3-dimensional vector.
Implementations
impl IVec3
[src]
pub const ZERO: IVec3
[src]
All zeroes.
pub const ONE: IVec3
[src]
All ones.
pub const X: IVec3
[src]
[1, 0, 0]
: a unit-length vector pointing along the positive X axis.
pub const Y: IVec3
[src]
[0, 1, 0]
: a unit-length vector pointing along the positive Y axis.
pub const Z: IVec3
[src]
[0, 0, 1]
: a unit-length vector pointing along the positive Z axis.
pub fn new(x: i32, y: i32, z: i32) -> IVec3
[src]
Creates a new 3D vector.
pub const fn unit_x() -> IVec3
[src]
Use Vec3::X instead
Creates a vector with values [x: 1.0, y: 0.0, z: 0.0]
.
pub const fn unit_y() -> IVec3
[src]
Use Vec3::Y instead
Creates a vector with values [x: 0.0, y: 1.0, z: 0.0]
.
pub const fn unit_z() -> IVec3
[src]
Use Vec3::Z instead
Creates a vector with values [x: 0.0, y: 0.0, z: 1.0]
.
pub fn extend(self, w: i32) -> IVec4
[src]
Creates a 4D vector from self
and the given w
value.
pub fn truncate(self) -> IVec2
[src]
Creates a Vec2
from the x
and y
elements of self
, discarding z
.
Truncation may also be performed by using self.xy()
or Vec2::from()
.
pub fn cross(self, other: IVec3) -> IVec3
[src]
Computes the cross product of self
and other
.
pub const fn zero() -> IVec3
[src]
use ZERO constant instead
Creates a vector with all elements set to 0.0
.
pub const fn one() -> IVec3
[src]
use ONE constant instead
Creates a vector with all elements set to 1.0
.
pub fn splat(v: i32) -> IVec3
[src]
Creates a vector with all elements set to v
.
pub fn select(mask: BVec3, if_true: IVec3, if_false: IVec3) -> IVec3
[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: IVec3) -> i32
[src]
Computes the dot product of self
and other
.
pub fn min(self, other: IVec3) -> IVec3
[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: IVec3) -> IVec3
[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 clamp(self, min: IVec3, max: IVec3) -> IVec3
[src]
Component-wise clamping of values, similar to [std::f32::clamp
].
Each element in min
must be less-or-equal to the corresponing element in max
.
If the glam-assert
feature is enabled, the function will panic if the contract is not
met, otherwise the behavior is undefined.
pub fn min_element(self) -> i32
[src]
Returns the horizontal minimum of self
.
In other words this computes min(x, y, ..)
.
pub fn max_element(self) -> i32
[src]
Returns the horizontal maximum of self
.
In other words this computes max(x, y, ..)
.
pub fn cmpeq(self, other: IVec3) -> BVec3
[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: IVec3) -> BVec3
[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: IVec3) -> BVec3
[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: IVec3) -> BVec3
[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: IVec3) -> BVec3
[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: IVec3) -> BVec3
[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: &[i32]) -> IVec3
[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 [i32])
[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 abs(self) -> IVec3
[src]
Returns a vector containing the absolute value of each element of self
.
pub fn signum(self) -> IVec3
[src]
Returns a vector with elements representing the sign of self
.
1.0
if the number is positive,+0.0
orINFINITY
-1.0
if the number is negative,-0.0
orNEG_INFINITY
NAN
if the number isNAN
pub fn as_f32(&self) -> Vec3
[src]
Casts all elements of self
to f32
.
pub fn as_f64(&self) -> DVec3
[src]
Casts all elements of self
to f64
.
pub fn as_u32(&self) -> UVec3
[src]
Casts all elements of self
to u32
.
Trait Implementations
impl Add<IVec3> for IVec3
[src]
type Output = IVec3
The resulting type after applying the +
operator.
pub fn add(self, other: IVec3) -> IVec3
[src]
impl AddAssign<IVec3> for IVec3
[src]
pub fn add_assign(&mut self, other: IVec3)
[src]
impl AsMut<[i32; 3]> for IVec3
[src]
impl AsRef<[i32; 3]> for IVec3
[src]
impl Clone for IVec3
[src]
impl Copy for IVec3
[src]
impl Debug for IVec3
[src]
impl Default for IVec3
[src]
impl Deref for IVec3
[src]
type Target = XYZ<i32>
The resulting type after dereferencing.
pub fn deref(&self) -> &<IVec3 as Deref>::Target
[src]
impl DerefMut for IVec3
[src]
impl<'de> Deserialize<'de> for IVec3
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<IVec3, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<IVec3, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for IVec3
[src]
impl Div<IVec3> for IVec3
[src]
type Output = IVec3
The resulting type after applying the /
operator.
pub fn div(self, other: IVec3) -> IVec3
[src]
impl Div<i32> for IVec3
[src]
type Output = IVec3
The resulting type after applying the /
operator.
pub fn div(self, other: i32) -> IVec3
[src]
impl DivAssign<IVec3> for IVec3
[src]
pub fn div_assign(&mut self, other: IVec3)
[src]
impl DivAssign<i32> for IVec3
[src]
pub fn div_assign(&mut self, other: i32)
[src]
impl Eq for IVec3
[src]
impl From<[i32; 3]> for IVec3
[src]
impl From<(IVec2, i32)> for IVec3
[src]
impl From<(i32, i32, i32)> for IVec3
[src]
impl From<IVec3> for XYZ<i32>
[src]
impl From<IVec3> for IVec2
[src]
impl From<IVec4> for IVec3
[src]
pub fn from(v: IVec4) -> IVec3
[src]
Creates a 3D vector from the x
, y
and z
elements of self
, discarding w
.
impl From<XYZ<i32>> for IVec3
[src]
impl GetTypeRegistration for IVec3
[src]
pub fn get_type_registration() -> TypeRegistration
[src]
impl Hash for IVec3
[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 IVec3
[src]
type Output = i32
The returned type after indexing.
pub fn index(&self, index: usize) -> &<IVec3 as Index<usize>>::Output
[src]
impl IndexMut<usize> for IVec3
[src]
impl Mul<IVec3> for IVec3
[src]
type Output = IVec3
The resulting type after applying the *
operator.
pub fn mul(self, other: IVec3) -> IVec3
[src]
impl Mul<i32> for IVec3
[src]
type Output = IVec3
The resulting type after applying the *
operator.
pub fn mul(self, other: i32) -> IVec3
[src]
impl MulAssign<IVec3> for IVec3
[src]
pub fn mul_assign(&mut self, other: IVec3)
[src]
impl MulAssign<i32> for IVec3
[src]
pub fn mul_assign(&mut self, other: i32)
[src]
impl Neg for IVec3
[src]
impl PartialEq<IVec3> for IVec3
[src]
pub fn eq(&self, other: &IVec3) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<IVec3> for IVec3
[src]
pub fn partial_cmp(&self, other: &IVec3) -> 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 IVec3> for IVec3
[src]
impl Reflect for IVec3
[src]
pub fn type_name(&self) -> &str
[src]
pub fn any(&self) -> &(dyn Any + 'static)
[src]
pub fn any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
pub fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
[src]
pub fn apply(&mut self, value: &(dyn Reflect + 'static))
[src]
pub fn set(
&mut self,
value: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
[src]
&mut self,
value: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
pub fn reflect_ref(&self) -> ReflectRef<'_>
[src]
pub fn reflect_mut(&mut self) -> ReflectMut<'_>
[src]
pub fn reflect_hash(&self) -> Option<u64>
[src]
pub fn reflect_partial_eq(
&self,
value: &(dyn Reflect + 'static)
) -> Option<bool>
[src]
&self,
value: &(dyn Reflect + 'static)
) -> Option<bool>
pub fn serializable(&self) -> Option<Serializable<'_>>
[src]
impl Serialize for IVec3
[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<IVec3> for IVec3
[src]
type Output = IVec3
The resulting type after applying the -
operator.
pub fn sub(self, other: IVec3) -> IVec3
[src]
impl SubAssign<IVec3> for IVec3
[src]
pub fn sub_assign(&mut self, other: IVec3)
[src]
impl<'a> Sum<&'a IVec3> for IVec3
[src]
impl Vec3Swizzles for IVec3
[src]
type Vec2 = IVec2
type Vec4 = IVec4
pub fn xxxx(self) -> IVec4
[src]
pub fn xxxy(self) -> IVec4
[src]
pub fn xxxz(self) -> IVec4
[src]
pub fn xxyx(self) -> IVec4
[src]
pub fn xxyy(self) -> IVec4
[src]
pub fn xxyz(self) -> IVec4
[src]
pub fn xxzx(self) -> IVec4
[src]
pub fn xxzy(self) -> IVec4
[src]
pub fn xxzz(self) -> IVec4
[src]
pub fn xyxx(self) -> IVec4
[src]
pub fn xyxy(self) -> IVec4
[src]
pub fn xyxz(self) -> IVec4
[src]
pub fn xyyx(self) -> IVec4
[src]
pub fn xyyy(self) -> IVec4
[src]
pub fn xyyz(self) -> IVec4
[src]
pub fn xyzx(self) -> IVec4
[src]
pub fn xyzy(self) -> IVec4
[src]
pub fn xyzz(self) -> IVec4
[src]
pub fn xzxx(self) -> IVec4
[src]
pub fn xzxy(self) -> IVec4
[src]
pub fn xzxz(self) -> IVec4
[src]
pub fn xzyx(self) -> IVec4
[src]
pub fn xzyy(self) -> IVec4
[src]
pub fn xzyz(self) -> IVec4
[src]
pub fn xzzx(self) -> IVec4
[src]
pub fn xzzy(self) -> IVec4
[src]
pub fn xzzz(self) -> IVec4
[src]
pub fn yxxx(self) -> IVec4
[src]
pub fn yxxy(self) -> IVec4
[src]
pub fn yxxz(self) -> IVec4
[src]
pub fn yxyx(self) -> IVec4
[src]
pub fn yxyy(self) -> IVec4
[src]
pub fn yxyz(self) -> IVec4
[src]
pub fn yxzx(self) -> IVec4
[src]
pub fn yxzy(self) -> IVec4
[src]
pub fn yxzz(self) -> IVec4
[src]
pub fn yyxx(self) -> IVec4
[src]
pub fn yyxy(self) -> IVec4
[src]
pub fn yyxz(self) -> IVec4
[src]
pub fn yyyx(self) -> IVec4
[src]
pub fn yyyy(self) -> IVec4
[src]
pub fn yyyz(self) -> IVec4
[src]
pub fn yyzx(self) -> IVec4
[src]
pub fn yyzy(self) -> IVec4
[src]
pub fn yyzz(self) -> IVec4
[src]
pub fn yzxx(self) -> IVec4
[src]
pub fn yzxy(self) -> IVec4
[src]
pub fn yzxz(self) -> IVec4
[src]
pub fn yzyx(self) -> IVec4
[src]
pub fn yzyy(self) -> IVec4
[src]
pub fn yzyz(self) -> IVec4
[src]
pub fn yzzx(self) -> IVec4
[src]
pub fn yzzy(self) -> IVec4
[src]
pub fn yzzz(self) -> IVec4
[src]
pub fn zxxx(self) -> IVec4
[src]
pub fn zxxy(self) -> IVec4
[src]
pub fn zxxz(self) -> IVec4
[src]
pub fn zxyx(self) -> IVec4
[src]
pub fn zxyy(self) -> IVec4
[src]
pub fn zxyz(self) -> IVec4
[src]
pub fn zxzx(self) -> IVec4
[src]
pub fn zxzy(self) -> IVec4
[src]
pub fn zxzz(self) -> IVec4
[src]
pub fn zyxx(self) -> IVec4
[src]
pub fn zyxy(self) -> IVec4
[src]
pub fn zyxz(self) -> IVec4
[src]
pub fn zyyx(self) -> IVec4
[src]
pub fn zyyy(self) -> IVec4
[src]
pub fn zyyz(self) -> IVec4
[src]
pub fn zyzx(self) -> IVec4
[src]
pub fn zyzy(self) -> IVec4
[src]
pub fn zyzz(self) -> IVec4
[src]
pub fn zzxx(self) -> IVec4
[src]
pub fn zzxy(self) -> IVec4
[src]
pub fn zzxz(self) -> IVec4
[src]
pub fn zzyx(self) -> IVec4
[src]
pub fn zzyy(self) -> IVec4
[src]
pub fn zzyz(self) -> IVec4
[src]
pub fn zzzx(self) -> IVec4
[src]
pub fn zzzy(self) -> IVec4
[src]
pub fn zzzz(self) -> IVec4
[src]
pub fn xxx(self) -> IVec3
[src]
pub fn xxy(self) -> IVec3
[src]
pub fn xxz(self) -> IVec3
[src]
pub fn xyx(self) -> IVec3
[src]
pub fn xyy(self) -> IVec3
[src]
pub fn xzx(self) -> IVec3
[src]
pub fn xzy(self) -> IVec3
[src]
pub fn xzz(self) -> IVec3
[src]
pub fn yxx(self) -> IVec3
[src]
pub fn yxy(self) -> IVec3
[src]
pub fn yxz(self) -> IVec3
[src]
pub fn yyx(self) -> IVec3
[src]
pub fn yyy(self) -> IVec3
[src]
pub fn yyz(self) -> IVec3
[src]
pub fn yzx(self) -> IVec3
[src]
pub fn yzy(self) -> IVec3
[src]
pub fn yzz(self) -> IVec3
[src]
pub fn zxx(self) -> IVec3
[src]
pub fn zxy(self) -> IVec3
[src]
pub fn zxz(self) -> IVec3
[src]
pub fn zyx(self) -> IVec3
[src]
pub fn zyy(self) -> IVec3
[src]
pub fn zyz(self) -> IVec3
[src]
pub fn zzx(self) -> IVec3
[src]
pub fn zzy(self) -> IVec3
[src]
pub fn zzz(self) -> IVec3
[src]
pub fn xx(self) -> IVec2
[src]
pub fn xy(self) -> IVec2
[src]
pub fn xz(self) -> IVec2
[src]
pub fn yx(self) -> IVec2
[src]
pub fn yy(self) -> IVec2
[src]
pub fn yz(self) -> IVec2
[src]
pub fn zx(self) -> IVec2
[src]
pub fn zy(self) -> IVec2
[src]
pub fn zz(self) -> IVec2
[src]
pub fn xyz(self) -> Self
[src]
Auto Trait Implementations
impl RefUnwindSafe for IVec3
impl Send for IVec3
impl Sync for IVec3
impl Unpin for IVec3
impl UnwindSafe for IVec3
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> 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> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T> GetPath for T where
T: Reflect,
[src]
T: Reflect,
pub fn path(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
[src]
&'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>>
[src]
&'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,
[src]
&'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,
[src]
&'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>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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,
[src]
T: 'static + Send + Sync + Clone,