pub struct MotorGizmo3D {
pub pivot_motor: Motor,
pub mode: GizmoMode,
pub axis_length: f32,
pub ring_radius: f32,
pub pick_tolerance: f32,
pub hovered_handle: Option<GizmoHandle>,
pub active_handle: Option<GizmoHandle>,
}Expand description
Zero-heap 3D ray-pickable PGA Motor manipulation gizmo.
Fields§
§pivot_motor: MotorCurrent world-space pose of the gizmo pivot.
mode: GizmoModeCurrent manipulation mode.
axis_length: f32Length of the X/Y/Z axis arrows in world units.
ring_radius: f32Radius of the X/Y/Z rotation rings in world units.
pick_tolerance: f32Picking tolerance tube radius in world units.
hovered_handle: Option<GizmoHandle>Currently hovered handle.
active_handle: Option<GizmoHandle>Currently dragged handle.
Implementations§
Source§impl MotorGizmo3D
impl MotorGizmo3D
Sourcepub const fn new(pivot_motor: Motor, mode: GizmoMode) -> Self
pub const fn new(pivot_motor: Motor, mode: GizmoMode) -> Self
Creates a gizmo at pivot_motor with the given mode.
Sourcepub fn world_origin(&self) -> [f32; 3]
pub fn world_origin(&self) -> [f32; 3]
World-space origin of the gizmo pivot.
Sourcepub fn world_axis(&self, local_axis: [f32; 3]) -> [f32; 3]
pub fn world_axis(&self, local_axis: [f32; 3]) -> [f32; 3]
World-space unit direction for a local axis [lx, ly, lz].
Sourcepub fn pick_ray(
&self,
ray_origin: [f32; 3],
ray_dir: [f32; 3],
) -> Option<GizmoPickHit>
pub fn pick_ray( &self, ray_origin: [f32; 3], ray_dir: [f32; 3], ) -> Option<GizmoPickHit>
Tests a world-space mouse picking ray (ray_origin, ray_dir) against the gizmo’s
X/Y/Z axis arrows, XY/YZ/XZ plane quads, and X/Y/Z rotation rings in zero heap.
Sourcepub fn compute_drag_delta(
&self,
handle: GizmoHandle,
start_ray_origin: [f32; 3],
start_ray_dir: [f32; 3],
cur_ray_origin: [f32; 3],
cur_ray_dir: [f32; 3],
) -> GizmoDragDelta
pub fn compute_drag_delta( &self, handle: GizmoHandle, start_ray_origin: [f32; 3], start_ray_dir: [f32; 3], cur_ray_origin: [f32; 3], cur_ray_dir: [f32; 3], ) -> GizmoDragDelta
Computes the exact PGA Motor and scale delta between an initial mouse ray and
current mouse ray for handle.
Trait Implementations§
Source§impl Clone for MotorGizmo3D
impl Clone for MotorGizmo3D
impl Copy for MotorGizmo3D
Source§impl Debug for MotorGizmo3D
impl Debug for MotorGizmo3D
Source§impl Default for MotorGizmo3D
impl Default for MotorGizmo3D
Source§impl PartialEq for MotorGizmo3D
impl PartialEq for MotorGizmo3D
impl StructuralPartialEq for MotorGizmo3D
Auto Trait Implementations§
impl Freeze for MotorGizmo3D
impl RefUnwindSafe for MotorGizmo3D
impl Send for MotorGizmo3D
impl Sync for MotorGizmo3D
impl Unpin for MotorGizmo3D
impl UnsafeUnpin for MotorGizmo3D
impl UnwindSafe for MotorGizmo3D
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.