pub struct Vector3Float {
pub x: f32,
pub y: f32,
pub z: f32,
}Expand description
Custom vector type containing 3 single precision fields
Fields§
§x: f32The first value within the vector
y: f32The second value within the vector
z: f32The third value within the vector
Implementations§
Source§impl Vector3Float
impl Vector3Float
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 with the given components.
Sourcepub fn normalize(&self) -> Option<Self>
pub fn normalize(&self) -> Option<Self>
Returns a normalized version of this vector (unit length).
pub fn serialize(&self, buf: &mut BytesMut)
pub fn deserialize(buf: &mut BytesMut) -> Vector3Float
Trait Implementations§
Source§impl Add for Vector3Float
impl Add for Vector3Float
Source§impl Clone for Vector3Float
impl Clone for Vector3Float
Source§fn clone(&self) -> Vector3Float
fn clone(&self) -> Vector3Float
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Vector3Float
impl Debug for Vector3Float
Source§impl Default for Vector3Float
impl Default for Vector3Float
Source§fn default() -> Vector3Float
fn default() -> Vector3Float
Returns the “default value” for a type. Read more
Source§impl Div<f32> for Vector3Float
impl Div<f32> for Vector3Float
Source§impl Mul<f32> for Vector3Float
impl Mul<f32> for Vector3Float
Source§impl PartialEq for Vector3Float
impl PartialEq for Vector3Float
Source§impl Sub for Vector3Float
impl Sub for Vector3Float
impl Copy for Vector3Float
impl StructuralPartialEq for Vector3Float
Auto Trait Implementations§
impl Freeze for Vector3Float
impl RefUnwindSafe for Vector3Float
impl Send for Vector3Float
impl Sync for Vector3Float
impl Unpin for Vector3Float
impl UnwindSafe for Vector3Float
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