Struct slender_math::Vector3f
source · #[repr(C, align(16))]pub struct Vector3f(_);Expand description
A vector with 3 f32 components
Implementations§
source§impl Vector3f
impl Vector3f
sourcepub const fn new(x: f32, y: f32, z: f32) -> Self
pub const fn new(x: f32, y: f32, z: f32) -> Self
Creates a new vector from the given components
sourcepub const fn from_scalar(scalar: f32) -> Self
pub const fn from_scalar(scalar: f32) -> Self
Creates a new vector by setting all components to the given scalar
sourcepub const fn from_array(array: [f32; 3]) -> Self
pub const fn from_array(array: [f32; 3]) -> Self
Creates a new vector from the given array
sourcepub const fn from_v2f(v: v2f, z: f32) -> Self
pub const fn from_v2f(v: v2f, z: f32) -> Self
Creates a new vector from the given 2-component vector
sourcepub fn as_mut_array(&mut self) -> &mut [f32; 3]
pub fn as_mut_array(&mut self) -> &mut [f32; 3]
Returns a mutable array reference to the vector
source§impl Vector3f
impl Vector3f
sourcepub fn abs(self) -> Self
pub fn abs(self) -> Self
Returns a vector with each component set to the absolute value of the corresponding component in this vector
sourcepub fn recip(self) -> Self
pub fn recip(self) -> Self
Returns a vector with each component set to the reciprocal of the corresponding component in this vector
sourcepub fn floor(self) -> Self
pub fn floor(self) -> Self
Returns a vector with each component set to the floor of the corresponding component in this vector
sourcepub fn ceil(self) -> Self
pub fn ceil(self) -> Self
Returns a vector with each component set to the ceiling of the corresponding component in this vector
sourcepub fn fract(self) -> Self
pub fn fract(self) -> Self
Returns a vector with each component set to the fractional part of the corresponding component in this vector
sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Normalizes the vector
sourcepub fn lerp(self, rhs: Self, t: f32) -> Self
pub fn lerp(self, rhs: Self, t: f32) -> Self
Linearily interpolates between this vector and rhs
sourcepub fn min(self, rhs: Self) -> Self
pub fn min(self, rhs: Self) -> Self
Returns a vector with each component set to the minimum of the corresponding components between this vector and rhs
§impl Vector3f
impl Vector3f
pub fn xx(&self) -> Vector2f
pub fn rr(&self) -> Vector2f
pub fn xy(&self) -> Vector2f
pub fn rg(&self) -> Vector2f
pub fn xz(&self) -> Vector2f
pub fn rb(&self) -> Vector2f
pub fn yx(&self) -> Vector2f
pub fn gr(&self) -> Vector2f
pub fn yy(&self) -> Vector2f
pub fn gg(&self) -> Vector2f
pub fn yz(&self) -> Vector2f
pub fn gb(&self) -> Vector2f
pub fn zx(&self) -> Vector2f
pub fn br(&self) -> Vector2f
pub fn zy(&self) -> Vector2f
pub fn bg(&self) -> Vector2f
pub fn zz(&self) -> Vector2f
pub fn bb(&self) -> Vector2f
pub fn xxx(&self) -> Vector3f
pub fn rrr(&self) -> Vector3f
pub fn xxy(&self) -> Vector3f
pub fn rrg(&self) -> Vector3f
pub fn xxz(&self) -> Vector3f
pub fn rrb(&self) -> Vector3f
pub fn xyx(&self) -> Vector3f
pub fn rgr(&self) -> Vector3f
pub fn xyy(&self) -> Vector3f
pub fn rgg(&self) -> Vector3f
pub fn xyz(&self) -> Vector3f
pub fn rgb(&self) -> Vector3f
pub fn xzx(&self) -> Vector3f
pub fn rbr(&self) -> Vector3f
pub fn xzy(&self) -> Vector3f
pub fn rbg(&self) -> Vector3f
pub fn xzz(&self) -> Vector3f
pub fn rbb(&self) -> Vector3f
pub fn yxx(&self) -> Vector3f
pub fn grr(&self) -> Vector3f
pub fn yxy(&self) -> Vector3f
pub fn grg(&self) -> Vector3f
pub fn yxz(&self) -> Vector3f
pub fn grb(&self) -> Vector3f
pub fn yyx(&self) -> Vector3f
pub fn ggr(&self) -> Vector3f
pub fn yyy(&self) -> Vector3f
pub fn ggg(&self) -> Vector3f
pub fn yyz(&self) -> Vector3f
pub fn ggb(&self) -> Vector3f
pub fn yzx(&self) -> Vector3f
pub fn gbr(&self) -> Vector3f
pub fn yzy(&self) -> Vector3f
pub fn gbg(&self) -> Vector3f
pub fn yzz(&self) -> Vector3f
pub fn gbb(&self) -> Vector3f
pub fn zxx(&self) -> Vector3f
pub fn brr(&self) -> Vector3f
pub fn zxy(&self) -> Vector3f
pub fn brg(&self) -> Vector3f
pub fn zxz(&self) -> Vector3f
pub fn brb(&self) -> Vector3f
pub fn zyx(&self) -> Vector3f
pub fn bgr(&self) -> Vector3f
pub fn zyy(&self) -> Vector3f
pub fn bgg(&self) -> Vector3f
pub fn zyz(&self) -> Vector3f
pub fn bgb(&self) -> Vector3f
pub fn zzx(&self) -> Vector3f
pub fn bbr(&self) -> Vector3f
pub fn zzy(&self) -> Vector3f
pub fn bbg(&self) -> Vector3f
pub fn zzz(&self) -> Vector3f
pub fn bbb(&self) -> Vector3f
pub fn xxxx(&self) -> Vector4f
pub fn rrrr(&self) -> Vector4f
pub fn xxxy(&self) -> Vector4f
pub fn rrrg(&self) -> Vector4f
pub fn xxxz(&self) -> Vector4f
pub fn rrrb(&self) -> Vector4f
pub fn xxyx(&self) -> Vector4f
pub fn rrgr(&self) -> Vector4f
pub fn xxyy(&self) -> Vector4f
pub fn rrgg(&self) -> Vector4f
pub fn xxyz(&self) -> Vector4f
pub fn rrgb(&self) -> Vector4f
pub fn xxzx(&self) -> Vector4f
pub fn rrbr(&self) -> Vector4f
pub fn xxzy(&self) -> Vector4f
pub fn rrbg(&self) -> Vector4f
pub fn xxzz(&self) -> Vector4f
pub fn rrbb(&self) -> Vector4f
pub fn xyxx(&self) -> Vector4f
pub fn rgrr(&self) -> Vector4f
pub fn xyxy(&self) -> Vector4f
pub fn rgrg(&self) -> Vector4f
pub fn xyxz(&self) -> Vector4f
pub fn rgrb(&self) -> Vector4f
pub fn xyyx(&self) -> Vector4f
pub fn rggr(&self) -> Vector4f
pub fn xyyy(&self) -> Vector4f
pub fn rggg(&self) -> Vector4f
pub fn xyyz(&self) -> Vector4f
pub fn rggb(&self) -> Vector4f
pub fn xyzx(&self) -> Vector4f
pub fn rgbr(&self) -> Vector4f
pub fn xyzy(&self) -> Vector4f
pub fn rgbg(&self) -> Vector4f
pub fn xyzz(&self) -> Vector4f
pub fn rgbb(&self) -> Vector4f
pub fn xzxx(&self) -> Vector4f
pub fn rbrr(&self) -> Vector4f
pub fn xzxy(&self) -> Vector4f
pub fn rbrg(&self) -> Vector4f
pub fn xzxz(&self) -> Vector4f
pub fn rbrb(&self) -> Vector4f
pub fn xzyx(&self) -> Vector4f
pub fn rbgr(&self) -> Vector4f
pub fn xzyy(&self) -> Vector4f
pub fn rbgg(&self) -> Vector4f
pub fn xzyz(&self) -> Vector4f
pub fn rbgb(&self) -> Vector4f
pub fn xzzx(&self) -> Vector4f
pub fn rbbr(&self) -> Vector4f
pub fn xzzy(&self) -> Vector4f
pub fn rbbg(&self) -> Vector4f
pub fn xzzz(&self) -> Vector4f
pub fn rbbb(&self) -> Vector4f
pub fn yxxx(&self) -> Vector4f
pub fn grrr(&self) -> Vector4f
pub fn yxxy(&self) -> Vector4f
pub fn grrg(&self) -> Vector4f
pub fn yxxz(&self) -> Vector4f
pub fn grrb(&self) -> Vector4f
pub fn yxyx(&self) -> Vector4f
pub fn grgr(&self) -> Vector4f
pub fn yxyy(&self) -> Vector4f
pub fn grgg(&self) -> Vector4f
pub fn yxyz(&self) -> Vector4f
pub fn grgb(&self) -> Vector4f
pub fn yxzx(&self) -> Vector4f
pub fn grbr(&self) -> Vector4f
pub fn yxzy(&self) -> Vector4f
pub fn grbg(&self) -> Vector4f
pub fn yxzz(&self) -> Vector4f
pub fn grbb(&self) -> Vector4f
pub fn yyxx(&self) -> Vector4f
pub fn ggrr(&self) -> Vector4f
pub fn yyxy(&self) -> Vector4f
pub fn ggrg(&self) -> Vector4f
pub fn yyxz(&self) -> Vector4f
pub fn ggrb(&self) -> Vector4f
pub fn yyyx(&self) -> Vector4f
pub fn gggr(&self) -> Vector4f
pub fn yyyy(&self) -> Vector4f
pub fn gggg(&self) -> Vector4f
pub fn yyyz(&self) -> Vector4f
pub fn gggb(&self) -> Vector4f
pub fn yyzx(&self) -> Vector4f
pub fn ggbr(&self) -> Vector4f
pub fn yyzy(&self) -> Vector4f
pub fn ggbg(&self) -> Vector4f
pub fn yyzz(&self) -> Vector4f
pub fn ggbb(&self) -> Vector4f
pub fn yzxx(&self) -> Vector4f
pub fn gbrr(&self) -> Vector4f
pub fn yzxy(&self) -> Vector4f
pub fn gbrg(&self) -> Vector4f
pub fn yzxz(&self) -> Vector4f
pub fn gbrb(&self) -> Vector4f
pub fn yzyx(&self) -> Vector4f
pub fn gbgr(&self) -> Vector4f
pub fn yzyy(&self) -> Vector4f
pub fn gbgg(&self) -> Vector4f
pub fn yzyz(&self) -> Vector4f
pub fn gbgb(&self) -> Vector4f
pub fn yzzx(&self) -> Vector4f
pub fn gbbr(&self) -> Vector4f
pub fn yzzy(&self) -> Vector4f
pub fn gbbg(&self) -> Vector4f
pub fn yzzz(&self) -> Vector4f
pub fn gbbb(&self) -> Vector4f
pub fn zxxx(&self) -> Vector4f
pub fn brrr(&self) -> Vector4f
pub fn zxxy(&self) -> Vector4f
pub fn brrg(&self) -> Vector4f
pub fn zxxz(&self) -> Vector4f
pub fn brrb(&self) -> Vector4f
pub fn zxyx(&self) -> Vector4f
pub fn brgr(&self) -> Vector4f
pub fn zxyy(&self) -> Vector4f
pub fn brgg(&self) -> Vector4f
pub fn zxyz(&self) -> Vector4f
pub fn brgb(&self) -> Vector4f
pub fn zxzx(&self) -> Vector4f
pub fn brbr(&self) -> Vector4f
pub fn zxzy(&self) -> Vector4f
pub fn brbg(&self) -> Vector4f
pub fn zxzz(&self) -> Vector4f
pub fn brbb(&self) -> Vector4f
pub fn zyxx(&self) -> Vector4f
pub fn bgrr(&self) -> Vector4f
pub fn zyxy(&self) -> Vector4f
pub fn bgrg(&self) -> Vector4f
pub fn zyxz(&self) -> Vector4f
pub fn bgrb(&self) -> Vector4f
pub fn zyyx(&self) -> Vector4f
pub fn bggr(&self) -> Vector4f
pub fn zyyy(&self) -> Vector4f
pub fn bggg(&self) -> Vector4f
pub fn zyyz(&self) -> Vector4f
pub fn bggb(&self) -> Vector4f
pub fn zyzx(&self) -> Vector4f
pub fn bgbr(&self) -> Vector4f
pub fn zyzy(&self) -> Vector4f
pub fn bgbg(&self) -> Vector4f
pub fn zyzz(&self) -> Vector4f
pub fn bgbb(&self) -> Vector4f
pub fn zzxx(&self) -> Vector4f
pub fn bbrr(&self) -> Vector4f
pub fn zzxy(&self) -> Vector4f
pub fn bbrg(&self) -> Vector4f
pub fn zzxz(&self) -> Vector4f
pub fn bbrb(&self) -> Vector4f
pub fn zzyx(&self) -> Vector4f
pub fn bbgr(&self) -> Vector4f
pub fn zzyy(&self) -> Vector4f
pub fn bbgg(&self) -> Vector4f
pub fn zzyz(&self) -> Vector4f
pub fn bbgb(&self) -> Vector4f
pub fn zzzx(&self) -> Vector4f
pub fn bbbr(&self) -> Vector4f
pub fn zzzy(&self) -> Vector4f
pub fn bbbg(&self) -> Vector4f
pub fn zzzz(&self) -> Vector4f
pub fn bbbb(&self) -> Vector4f
Trait Implementations§
source§impl AddAssign<Vector3f> for Vector3f
impl AddAssign<Vector3f> for Vector3f
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moresource§impl AddAssign<f32> for Vector3f
impl AddAssign<f32> for Vector3f
source§fn add_assign(&mut self, rhs: f32)
fn add_assign(&mut self, rhs: f32)
+= operation. Read moresource§impl DivAssign<Vector3f> for Vector3f
impl DivAssign<Vector3f> for Vector3f
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moresource§impl DivAssign<f32> for Vector3f
impl DivAssign<f32> for Vector3f
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
/= operation. Read moresource§impl Mul<Vector3f> for Quaternion
impl Mul<Vector3f> for Quaternion
source§impl MulAssign<Vector3f> for Vector3f
impl MulAssign<Vector3f> for Vector3f
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moresource§impl MulAssign<f32> for Vector3f
impl MulAssign<f32> for Vector3f
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*= operation. Read moresource§impl PartialEq<Vector3f> for Vector3f
impl PartialEq<Vector3f> for Vector3f
source§impl RemAssign<Vector3f> for Vector3f
impl RemAssign<Vector3f> for Vector3f
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%= operation. Read moresource§impl RemAssign<f32> for Vector3f
impl RemAssign<f32> for Vector3f
source§fn rem_assign(&mut self, rhs: f32)
fn rem_assign(&mut self, rhs: f32)
%= operation. Read moresource§impl SubAssign<Vector3f> for Vector3f
impl SubAssign<Vector3f> for Vector3f
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moresource§impl SubAssign<f32> for Vector3f
impl SubAssign<f32> for Vector3f
source§fn sub_assign(&mut self, rhs: f32)
fn sub_assign(&mut self, rhs: f32)
-= operation. Read moreimpl Copy for Vector3f
impl Pod for Vector3f
Auto Trait Implementations§
impl RefUnwindSafe for Vector3f
impl Send for Vector3f
impl Sync for Vector3f
impl Unpin for Vector3f
impl UnwindSafe for Vector3f
Blanket Implementations§
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.