pub struct SpaceFrame { /* private fields */ }Expand description
An origin and a right-handed orthonormal triad of axes.
§Invariant
A SpaceFrame that exists is valid: finite, unit-length on every axis,
mutually perpendicular, and right-handed, all judged when it was built.
Fields are private so a struct literal cannot bypass that.
Implementations§
Source§impl SpaceFrame
impl SpaceFrame
Sourcepub const fn world() -> SpaceFrame
pub const fn world() -> SpaceFrame
The world axes at the origin.
Sourcepub fn new(
origin: DVec3,
x: DVec3,
y: DVec3,
z: DVec3,
tolerance: Tolerance,
) -> Result<SpaceFrame, FrameError>
pub fn new( origin: DVec3, x: DVec3, y: DVec3, z: DVec3, tolerance: Tolerance, ) -> Result<SpaceFrame, FrameError>
Validate a basis and build a frame from it.
Unit length, perpendicularity, and handedness are all DIMENSIONLESS properties, so all three are judged against the ANGULAR tolerance. Using the linear tolerance would tie a pure direction test to the model length unit.
Handedness is checked explicitly because it is invisible to the other two tests: a mirrored basis is perfectly orthonormal and still reflects every point it maps.
§Errors
Returns the property that failed, so a caller can name the cause.
Trait Implementations§
Source§impl Clone for SpaceFrame
impl Clone for SpaceFrame
Source§fn clone(&self) -> SpaceFrame
fn clone(&self) -> SpaceFrame
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpaceFrame
impl Debug for SpaceFrame
Source§impl PartialEq for SpaceFrame
impl PartialEq for SpaceFrame
impl Copy for SpaceFrame
impl StructuralPartialEq for SpaceFrame
Auto Trait Implementations§
impl Freeze for SpaceFrame
impl RefUnwindSafe for SpaceFrame
impl Send for SpaceFrame
impl Sync for SpaceFrame
impl Unpin for SpaceFrame
impl UnwindSafe for SpaceFrame
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
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>
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>
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