Skip to main content

Bound

Struct Bound 

Source
pub struct Bound {
    pub transform: Rigid,
    pub min_target: Vec3,
    pub max_target: Vec3,
    pub min_eye: Vec3,
    pub max_eye: Vec3,
    pub min_up: Vec3,
    pub max_up: Vec3,
    pub min_distance: f32,
    pub max_distance: f32,
    pub hysteresis: f32,
}
Expand description

Orthogonal boundary conditions implementing Clamp.

Implements Default and can be created with Bound::default().

Fields§

§transform: Rigid

Isometry in world space of bound inversely transforming target and eye positions.

§min_target: Vec3

Minimum components of target position in world space. Default splats f32::MIN.

§max_target: Vec3

Maximum components of target position in world space. Default splats f32::MAX.

§min_eye: Vec3

Minimum components of eye position in world space. Default splats f32::MIN.

§max_eye: Vec3

Maximum components of eye position in world space. Default splats f32::MAX.

§min_up: Vec3

Minimum components of up axis in bound space following yaw. Default splats f32::MIN.

See Clamp::up() implementation of Bound.

§max_up: Vec3

Maximum components of up axis in bound space following yaw. Default splats f32::MAX.

See Clamp::up() implementation of Bound.

§min_distance: f32

Minimum distance of eye from target. Default is 0.0.

§max_distance: f32

Maximum distance of eye from target. Default is f32::MAX.

§hysteresis: f32

Epsilon allowing clamped Delta to more likely pass revalidation.

Default is f32::EPSILON.sqrt().

Trait Implementations§

Source§

impl Clamp for Bound

Source§

fn loops(&self) -> usize

Using lower loop limit for flat boundary conditions.

Source§

fn target(&self, frame: Frame) -> Option<Plane>

Find any boundary plane exceeded by target position.

Source§

fn eye(&self, frame: Frame) -> Option<Plane>

Find any boundary plane exceeded by eye position.

Distance planes are orthogonal to the roll axis at minimum or maximum distance from target.

Source§

fn up(&self, frame: Frame) -> Option<Plane>

Find any boundary plane exceeded by up position.

Up position is expressed in bound space following yaw, i.e., rotated around y-axis by the heading whose x-axis is the horizontal pitch axis. Its y-component bounds the tilt (e.g., min_up.y = 0.0 prevents turning upside down but allows rolling sideways over the pole) whereas its x-component bounds the roll (e.g., min_up.x = max_up.x = 0.0 prevents rolling and stops at the pole like a turntable) and its z-component bounds the forward tilt.

Source§

fn compute( &self, frame: Frame, scope: Scope, delta: Delta, ) -> Option<(Delta, usize)>

Computes clamped Delta wrt abstract boundary conditions of Frame and Scope. Read more
Source§

impl Clone for Bound

Source§

fn clone(&self) -> Bound

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Bound

Source§

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

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

impl Default for Bound

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Bound

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 PartialEq for Bound

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Bound

Source§

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

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

impl Copy for Bound

Source§

impl StructuralPartialEq for Bound

Auto Trait Implementations§

§

impl Freeze for Bound

§

impl RefUnwindSafe for Bound

§

impl Send for Bound

§

impl Sync for Bound

§

impl Unpin for Bound

§

impl UnsafeUnpin for Bound

§

impl UnwindSafe for Bound

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> 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, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

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

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,