pub struct GizmoView {
pub at: Vector3,
pub axes: [Vector3; 3],
pub modes: Modes,
pub parts: Vec<GizmoPart>,
pub hover: Option<GizmoPart>,
pub active: Option<GizmoPart>,
pub readout: Option<String>,
}Expand description
A gizmo as the viewer draws it: where, along which axes, what it lets the user do, which part the pointer is over and which is dragged, and what a drag under way has done so far, in words.
Fields§
§at: Vector3§axes: [Vector3; 3]Unit and orthogonal: the world’s, or what it stands on’s own.
modes: Modes§parts: Vec<GizmoPart>The parts it shows, as its modes give them: what a viewer draws, and the pointer is tested against.
hover: Option<GizmoPart>§active: Option<GizmoPart>§readout: Option<String>Implementations§
Source§impl GizmoView
impl GizmoView
Sourcepub fn moved(self, motion: &Motion) -> Self
pub fn moved(self, motion: &Motion) -> Self
The gizmo moved by motion: drawn where the part it is of is placed.
Sourcepub fn of(gizmo: &Gizmo, orientation: Orientation) -> Self
pub fn of(gizmo: &Gizmo, orientation: Orientation) -> Self
gizmo turned as orientation says.
Sourcepub fn shown(&self, part: GizmoPart, dir: &Vector3) -> bool
pub fn shown(&self, part: GizmoPart, dir: &Vector3) -> bool
Whether part is shown looking along dir (see size::FACING).
Sourcepub fn reach(&self, pointer: &Pointer) -> Scalar
pub fn reach(&self, pointer: &Pointer) -> Scalar
How large one reach is at its centre, for pointer.
Sourcepub fn hit(&self, pointer: &Pointer) -> Option<GizmoPart>
pub fn hit(&self, pointer: &Pointer) -> Option<GizmoPart>
The part pointer is over. One it is over as drawn comes first —
the ball, a square, a cube within its own size — before one it only
passes within a reach of: a square is hit only where it is drawn, so
a cube or a ring reaching over it by that reach must not take it.
Then of the cubes and the ball, then the arrows and squares, then
the rings, the one nearest the pointer on screen.