#[repr(C)]pub struct DMat4 {}
Expand description
Double-precision 2x2 column major matrix.
Fields§
§m00: f64
§m01: f64
§m02: f64
§m03: f64
§m10: f64
§m11: f64
§m12: f64
§m13: f64
§m20: f64
§m21: f64
§m22: f64
§m23: f64
§m30: f64
§m31: f64
§m32: f64
§m33: f64
Implementations§
source§impl DMat4
impl DMat4
source§impl DMat4
impl DMat4
sourcepub fn determinant(self) -> f64
pub fn determinant(self) -> f64
Computes the matrix determinant.
sourcepub fn inverse(self) -> DMat4
pub fn inverse(self) -> DMat4
Computes the matrix inverse.
Panics
Panics if the matrix has no inverse (i.e. has zero determinant).
Examples found in repository?
examples/unproject.rs (line 24)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
fn unproject_double_precision(ndc: euler::Vec2) -> euler::DVec3 {
let projection = dmat4!();
let inverse_projection = projection.inverse();
let eye = inverse_projection * dvec4!(dvec2!(ndc), -1, 1);
let view = euler::DTrs::new(
dvec3!(1, 0, -1),
dquat!(1, 0, 0; f64::consts::PI / 2.0),
dvec3!(1.0),
)
.matrix();
let inverse_view = view.inverse();
let world = inverse_view * dvec4!(eye.xy(), -1, 0);
let ray = world.xyz().normalize();
ray
}
sourcepub fn try_invert(self) -> Option<DMat4>
pub fn try_invert(self) -> Option<DMat4>
Attempts to compute the matrix inverse, returning None
if the matrix is
non-invertible (i.e. has zero determinant).
Trait Implementations§
source§impl ApproxEq for DMat4
impl ApproxEq for DMat4
source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
source§fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
source§impl PartialEq<DMat4> for DMat4
impl PartialEq<DMat4> for DMat4
impl Copy for DMat4
impl StructuralPartialEq for DMat4
Auto Trait Implementations§
impl RefUnwindSafe for DMat4
impl Send for DMat4
impl Sync for DMat4
impl Unpin for DMat4
impl UnwindSafe for DMat4
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