pub struct Vec3 {
pub x: f64,
pub y: f64,
pub z: f64,
}Fields§
§x: f64§y: f64§z: f64Implementations§
Source§impl Vec3
impl Vec3
pub const ZERO: Self
pub const X: Self
pub const Y: Self
pub const Z: Self
Sourcepub fn normalized_or(self, fallback: Self) -> Self
pub fn normalized_or(self, fallback: Self) -> Self
Normalize using the standard vector guard, or return the caller’s fallback.
Sourcepub fn rotate_about(self, axis: Self, angle: f64) -> Self
pub fn rotate_about(self, axis: Self, angle: f64) -> Self
Rodrigues rotation about a unit axis through the origin.
Sourcepub fn distance_to_segment(self, start: Self, end: Self, guard: f64) -> f64
pub fn distance_to_segment(self, start: Self, end: Self, guard: f64) -> f64
Distance to a segment. guard is the caller’s squared-length threshold.
Sourcepub fn distance_to_segment_squared(self, start: Self, end: Self) -> f64
pub fn distance_to_segment_squared(self, start: Self, end: Self) -> f64
Squared distance, retaining the seed sweep’s projection on zero-length segments.
pub fn new(x: f64, y: f64, z: f64) -> Self
pub fn sub(self, rhs: Self) -> Self
pub fn add(self, rhs: Self) -> Self
pub fn scale(self, factor: f64) -> Self
pub fn cross(self, rhs: Self) -> Self
pub fn dot(self, rhs: Self) -> f64
pub fn length(self) -> f64
pub fn length_squared(self) -> f64
pub fn normalized(self) -> Result<Self, String>
pub fn perpendicular(self) -> Result<Self, String>
Trait Implementations§
impl Copy for Vec3
Source§impl<'de> Deserialize<'de> for Vec3
impl<'de> Deserialize<'de> for Vec3
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for Vec3
impl Freeze for Vec3
impl Move 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