pub struct Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}Fields§
§x: f32§y: f32§z: f32Implementations§
Source§impl Vec3
impl Vec3
pub fn new(x: f32, y: f32, z: f32) -> Self
pub fn zero() -> Self
pub fn one() -> Self
pub fn splat(v: f32) -> Self
pub fn from_xy(v: Vec2, z: f32) -> Self
pub fn xy(self) -> Vec2
pub fn dot(self, o: Self) -> f32
pub fn cross(self, o: Self) -> Self
pub fn length_squared(self) -> f32
pub fn length(self) -> f32
pub fn normalize(self) -> Self
pub fn clamp_length(self, max: f32) -> Self
pub fn distance(self, o: Self) -> f32
pub fn distance_squared(self, o: Self) -> f32
pub fn reflect(self, normal: Self) -> Self
pub fn project_onto(self, onto: Self) -> Self
pub fn lerp(self, other: Self, t: f32) -> Self
pub fn abs(self) -> Self
pub fn floor(self) -> Self
pub fn ceil(self) -> Self
pub fn round(self) -> Self
pub fn min(self, o: Self) -> Self
pub fn max(self, o: Self) -> Self
pub fn clamp(self, lo: Self, hi: Self) -> Self
pub fn min_component(self) -> f32
pub fn max_component(self) -> f32
pub fn approx_eq(self, other: Self, eps: f32) -> bool
Trait Implementations§
Source§impl AddAssign for Vec3
impl AddAssign for Vec3
Source§fn add_assign(&mut self, o: Self)
fn add_assign(&mut self, o: Self)
Performs the
+= operation. Read moreSource§impl DivAssign<f32> for Vec3
impl DivAssign<f32> for Vec3
Source§fn div_assign(&mut self, s: f32)
fn div_assign(&mut self, s: f32)
Performs the
/= operation. Read moreSource§impl MulAssign<f32> for Vec3
impl MulAssign<f32> for Vec3
Source§fn mul_assign(&mut self, s: f32)
fn mul_assign(&mut self, s: f32)
Performs the
*= operation. Read moreSource§impl SubAssign for Vec3
impl SubAssign for Vec3
Source§fn sub_assign(&mut self, o: Self)
fn sub_assign(&mut self, o: Self)
Performs the
-= operation. Read moreimpl Copy for Vec3
impl StructuralPartialEq for Vec3
Auto Trait Implementations§
impl Freeze for Vec3
impl RefUnwindSafe for Vec3
impl Send for Vec3
impl Sync for Vec3
impl Unpin for Vec3
impl UnsafeUnpin for Vec3
impl UnwindSafe for Vec3
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
Mutably borrows from an owned value. Read more