pub struct Vec3 {
pub x: Fixed,
pub y: Fixed,
pub z: Fixed,
}Expand description
A three-dimensional vector. See Vec2 for the contract; it is the same.
Fields§
§x: Fixed§y: Fixed§z: FixedImplementations§
Source§impl Vec3
impl Vec3
Sourcepub fn length_squared(self) -> Fixed
pub fn length_squared(self) -> Fixed
The squared length. See Vec2::length_squared on why to prefer it.
Sourcepub fn length_squared_wide(self) -> Wide
pub fn length_squared_wide(self) -> Wide
The squared length at full width. See Vec2::length_squared_wide.
Sourcepub fn normalize(self) -> Option<Self>
pub fn normalize(self) -> Option<Self>
A unit vector in the same direction, or None for the zero vector.
See Vec2::normalize on how close to unit the result is.
Sourcepub fn slide_along(self, normal: Self) -> Self
pub fn slide_along(self, normal: Self) -> Self
self with its component along a unit normal removed.
Trait Implementations§
impl Copy for Vec3
impl Eq 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