simvx.core.gizmo¶
Transform gizmos for 3D scene editing (translate, rotate, scale).
Handles the interaction math for picking and dragging gizmo handles. Actual rendering of gizmo visuals is the graphics backend’s responsibility.
Module Contents¶
Classes¶
Data¶
API¶
- simvx.core.gizmo.__all__¶
[‘GizmoMode’, ‘GizmoAxis’, ‘Gizmo’]
- class simvx.core.gizmo.GizmoMode¶
Bases:
enum.EnumActive manipulation mode for the gizmo.
- TRANSLATE¶
‘auto(…)’
- ROTATE¶
‘auto(…)’
- SCALE¶
‘auto(…)’
- __new__(value)¶
- __repr__()¶
- __str__()¶
- __dir__()¶
- __format__(format_spec)¶
- __hash__()¶
- __reduce_ex__(proto)¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.gizmo.GizmoAxis¶
Bases:
enum.EnumWhich axis or axis-pair the user is interacting with.
- X¶
‘auto(…)’
- Y¶
‘auto(…)’
- Z¶
‘auto(…)’
- XY¶
‘auto(…)’
- XZ¶
‘auto(…)’
- YZ¶
‘auto(…)’
- ALL¶
‘auto(…)’
- __new__(value)¶
- __repr__()¶
- __str__()¶
- __dir__()¶
- __format__(format_spec)¶
- __hash__()¶
- __reduce_ex__(proto)¶
- __deepcopy__(memo)¶
- __copy__()¶
- name()¶
- value()¶
- class simvx.core.gizmo.Gizmo¶
Interactive transform gizmo operating in world space.
Supports three manipulation modes (translate, rotate, scale) and provides ray-based picking / dragging logic. The graphics backend is responsible for drawing the visual handles; this class only does the math.
Initialization
- property mode: simvx.core.gizmo.GizmoMode¶
- pick_axis(ray_origin: simvx.core.math.types.Vec3, ray_dir: simvx.core.math.types.Vec3) simvx.core.gizmo.GizmoAxis | None¶
Ray-test the gizmo handles and return the closest hit axis.
For translate/scale modes the handles are axis shafts (thin cylinders) and small plane-pair quads. For rotate mode the handles are three circles (one per principal axis).
Returns
Nonewhen nothing is hit.
- begin_drag(axis: simvx.core.gizmo.GizmoAxis, ray_origin: simvx.core.math.types.Vec3, ray_dir: simvx.core.math.types.Vec3) None¶
Start a drag interaction on axis.
- update_drag(ray_origin: simvx.core.math.types.Vec3, ray_dir: simvx.core.math.types.Vec3) simvx.core.math.types.Vec3¶
Compute the incremental delta since the last update.
Returns a
Vec3whose meaning depends on the current mode:TRANSLATE – world-space translation delta.
ROTATE – (angle_x, angle_y, angle_z) in radians.
SCALE – per-axis scale factor delta (centred on 1.0 = no change, returned as additive offset so caller does
current_scale += delta).
- end_drag() None¶
Finish dragging and reset internal drag state.
- cycle_mode() None¶
Cycle through TRANSLATE -> ROTATE -> SCALE -> TRANSLATE.