pub struct Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}Expand description
A 3D vector
Fields§
§x: f32§y: f32§z: f32Implementations§
Source§impl Vec3
impl Vec3
pub const ZERO: Self
pub const ONE: Self
pub const UP: Self
pub const FORWARD: Self
pub const RIGHT: Self
pub const fn new(x: f32, y: f32, z: f32) -> Self
pub fn from_array(arr: [f32; 3]) -> Self
pub fn to_array(&self) -> [f32; 3]
pub fn length(&self) -> f32
pub fn normalized(&self) -> Self
pub fn dot(&self, other: &Self) -> f32
pub fn cross(&self, other: &Self) -> Self
Trait Implementations§
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
impl 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 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