DBivec3

Struct DBivec3 

Source
#[repr(C)]
pub struct DBivec3 { pub xy: f64, pub xz: f64, pub yz: f64, }
Expand description

A bivector in 3d space.

In 3d, a bivector has 3 components, each one representing the signed projected area of the bivector onto one of the 3 basis bivectors, which can be thought of as corresponding to each of the three basis planes. This is analogous to the components of a 3d vector, which correspond to the projected length of the vector onto the three basis *vectors. Since in 3d, there are three components for both vectors and bivectors, 3d bivectors have been historically confused with 3d vectors quite a lot.

Please see the module level documentation for more information on bivectors generally!

Fields§

§xy: f64§xz: f64§yz: f64

Implementations§

Source§

impl DBivec3

Source

pub const fn new(xy: f64, xz: f64, yz: f64) -> Self

Source

pub fn zero() -> Self

Source

pub fn from_normalized_axis(v: DVec3) -> Self

Create the bivector which represents the same plane of rotation as a given normalized ‘axis vector’

Source

pub fn unit_xy() -> Self

Source

pub fn unit_xz() -> Self

Source

pub fn unit_yz() -> Self

Source

pub fn mag_sq(&self) -> f64

Source

pub fn mag(&self) -> f64

Source

pub fn normalize(&mut self)

Source

pub fn normalized(&self) -> Self

Source

pub fn dot(&self, rhs: Self) -> f64

Source

pub fn layout() -> Layout

Source

pub fn as_slice(&self) -> &[f64]

Source

pub fn as_byte_slice(&self) -> &[u8]

Source

pub fn as_mut_slice(&mut self) -> &mut [f64]

Source

pub fn as_mut_byte_slice(&mut self) -> &mut [u8]

Source

pub const fn as_ptr(&self) -> *const f64

Returns a constant unsafe pointer to the underlying data in the underlying type. This function is safe because all types here are repr(C) and can be represented as their underlying type.

§Safety

It is up to the caller to correctly use this pointer and its bounds.

Source

pub fn as_mut_ptr(&mut self) -> *mut f64

Returns a mutable unsafe pointer to the underlying data in the underlying type. This function is safe because all types here are repr(C) and can be represented as their underlying type.

§Safety

It is up to the caller to correctly use this pointer and its bounds.

Trait Implementations§

Source§

impl Add for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the + operator.
Source§

fn add(self, rhs: DBivec3) -> Self

Performs the + operation. Read more
Source§

impl AddAssign for DBivec3

Source§

fn add_assign(&mut self, rhs: DBivec3)

Performs the += operation. Read more
Source§

impl Clone for DBivec3

Source§

fn clone(&self) -> DBivec3

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DBivec3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DBivec3

Source§

fn default() -> DBivec3

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DBivec3

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Div<f64> for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> DBivec3

Performs the / operation. Read more
Source§

impl Div for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the / operator.
Source§

fn div(self, rhs: DBivec3) -> Self

Performs the / operation. Read more
Source§

impl DivAssign<f64> for DBivec3

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl DivAssign for DBivec3

Source§

fn div_assign(&mut self, rhs: DBivec3)

Performs the /= operation. Read more
Source§

impl Lerp<f64> for DBivec3

Source§

fn lerp(&self, end: Self, t: f64) -> Self

Linearly interpolate between self and end by t between 0.0 and 1.0. i.e. (1.0 - t) * self + (t) * end.

For interpolating Rotors with linear interpolation, you almost certainly want to normalize the returned Rotor. For example,

let interpolated_rotor = rotor1.lerp(rotor2, 0.5).normalized();

For most cases (especially where performance is the primary concern, like in animation interpolation for games, this ‘normalized lerp’ or ‘nlerp’ is probably what you want to use. However, there are situations in which you really want the interpolation between two Rotors to be of constant angular velocity. In this case, check out Slerp.

Source§

impl Mul<DBivec3> for f64

Source§

type Output = DBivec3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: DBivec3) -> DBivec3

Performs the * operation. Read more
Source§

impl Mul<f64> for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self

Performs the * operation. Read more
Source§

impl Mul for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: DBivec3) -> Self

Performs the * operation. Read more
Source§

impl MulAssign<f64> for DBivec3

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for DBivec3

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl Neg for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl PartialEq for DBivec3

Source§

fn eq(&self, other: &DBivec3) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for DBivec3

Source§

fn serialize<T>(&self, serializer: T) -> Result<T::Ok, T::Error>
where T: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Slerp<f64> for DBivec3

Source§

fn slerp(&self, end: Self, t: f64) -> Self

Spherical-linear interpolation between self and end based on t from 0.0 to 1.0.

self and end should both be normalized or something bad will happen!

The implementation for SIMD types also requires that the two things being interpolated between are not exactly aligned, or else the result is undefined.

Basically, interpolation that maintains a constant angular velocity from one orientation on a unit hypersphere to another. This is sorta the “high quality” interpolation for Rotors, and it can also be used to interpolate other things, one example being interpolation of 3d normal vectors.

Note that you should often normalize the result returned by this operation, when working with Rotors, etc!

Source§

impl Sub for DBivec3

Source§

type Output = DBivec3

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: DBivec3) -> Self

Performs the - operation. Read more
Source§

impl SubAssign for DBivec3

Source§

fn sub_assign(&mut self, rhs: DBivec3)

Performs the -= operation. Read more
Source§

impl Zeroable for DBivec3

Available on crate feature f64 only.
Source§

fn zeroed() -> Self

Source§

impl Copy for DBivec3

Source§

impl Pod for DBivec3

Available on crate feature f64 only.
Source§

impl StructuralPartialEq for DBivec3

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> NoUninit for T
where T: Pod,