pub struct Displacement {
pub dx: f64,
pub dy: f64,
pub dz: f64,
}
Fields§
§dx: f64
§dy: f64
§dz: f64
Implementations§
Source§impl Displacement
impl Displacement
pub const EYE_HEIGHT: Displacement
pub const EPSILON_Y: Displacement
pub const fn new(dx: f64, dy: f64, dz: f64) -> Displacement
pub fn zero_if_reachable(&self) -> Displacement
pub fn make_dy(&self, dy: f64) -> Displacement
pub fn mag(&self) -> f64
pub fn dot(&self, other: Displacement) -> f64
pub fn reflect(&self, normal: Displacement) -> Displacement
pub fn normalize(self) -> Displacement
pub fn mag2(&self) -> f64
pub fn cross(&self, other: Displacement) -> Displacement
pub fn has_length(&self) -> bool
Trait Implementations§
Source§impl Add<Displacement> for Location
impl Add<Displacement> for Location
Source§impl Add for Displacement
impl Add for Displacement
Source§impl ByteReadable for Displacement
impl ByteReadable for Displacement
fn read_from_bytes(byte_reader: &mut ByteReader) -> Self
Source§impl ByteWritable for Displacement
impl ByteWritable for Displacement
fn write_to_bytes(self, writer: &mut ByteWriter)
Source§impl Clone for Displacement
impl Clone for Displacement
Source§fn clone(&self) -> Displacement
fn clone(&self) -> Displacement
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Displacement
impl Debug for Displacement
Source§impl Default for Displacement
impl Default for Displacement
Source§fn default() -> Displacement
fn default() -> Displacement
Returns the “default value” for a type. Read more
Source§impl Display for Displacement
impl Display for Displacement
Source§impl From<Change> for Displacement
impl From<Change> for Displacement
Source§impl From<Displacement> for Direction
impl From<Displacement> for Direction
Source§fn from(displacement: Displacement) -> Self
fn from(displacement: Displacement) -> Self
Converts to this type from the input type.
Source§impl Index<usize> for Displacement
impl Index<usize> for Displacement
Source§impl Mul<f64> for Displacement
impl Mul<f64> for Displacement
Source§impl MulAssign<f64> for Displacement
impl MulAssign<f64> for Displacement
Source§fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the
*=
operation. Read moreSource§impl Neg for Displacement
impl Neg for Displacement
Source§impl Sub<Displacement> for Location
impl Sub<Displacement> for Location
Source§impl Sub for Displacement
impl Sub for Displacement
impl Copy for Displacement
Auto Trait Implementations§
impl Freeze for Displacement
impl RefUnwindSafe for Displacement
impl Send for Displacement
impl Sync for Displacement
impl Unpin for Displacement
impl UnwindSafe for Displacement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more