OrbitAnimation
struct · ferroui-xaml-behaviors-animations · v0.5.0
struct OrbitAnimation
Maintains and applies a composition orientation for an orbit-style pointer interaction.
Deviation (DEVIATIONS.md, Behaviors): the orientation (a property with a private setter in
the reference) is kept in a cell, so that rotate and reset take &self as the methods of
the reference's class do.
Members
new
fn new() -> Self
Creates an orbit animation at the identity orientation.
orientation
fn orientation(self: &Self) -> Quaternion
Gets the current orientation.
calculate_orientation
fn calculate_orientation(orientation: Quaternion, pointer_delta: Vector, sensitivity: f64) -> Quaternion
Calculates the next normalized orientation from the current orientation and the pointer
movement since the previous update; sensitivity is the rotation sensitivity.
rotate
fn rotate(self: &Self, target: Option<&Control>, pointer_delta: Vector, sensitivity: f64) -> bool
Updates the orientation and applies it to a control's composition visual. Returns true
when a composition visual was animated; otherwise, false.
update_center_point
fn update_center_point(target: Option<&Control>) -> bool
Updates a control's composition center point from its current bounds. Returns true when
a composition visual was updated; otherwise, false.
reset
fn reset(self: &Self)
Resets the maintained orientation to the identity quaternion.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherDebugDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.