Vixen
02b45cc4
csharp
public sealed class MeshGizmoTarget

A mesh's selected elements, as one thing the gizmo can move.

Read the guide page for this →

Remarks

EntityGizmoTarget's counterpart for doc 24's P2, and it is deliberately one target rather than one per position. The gizmo's arithmetic recomputes every target from where it was at mouse-down — see TransformGizmo — so a hundred selected vertices as a hundred targets would work and would rotate each of them about its own centre, which is not what rotating a face means. One target whose origin is the selection's centre is what makes rotate and scale behave.

⚠ The whole transform is applied to the covered positions, in the mesh's own space. A gizmo hands back a world position, a world rotation and a scale; what a mesh wants is where each of its corners went. So the delta is assembled here, taken into local space through the entity's inverse, and applied about the centre the drag started from.

⚠ The entity does not move, and that is the difference from dragging it. Moving a wall in face mode moves the wall's geometry inside the entity; the entity's transform is what object mode drags. Confusing the two is how a designer ends up with a corridor whose pivot is nowhere near it.

Fields and properties (7)

  • public IReadOnlyList<int> Positions

    Which positions this drag is moving, and where each of them started.

  • public IReadOnlyList<Vector3> Before

    Where each of them was when the drag began.

  • public Vector3 Position

    Where it is, in world space.

  • public Quaternion Rotation
  • public Vector3 Scale

    How big it is, in its parent's space.

  • public Matrix4x4 ParentToWorld
  • public bool IsEmpty

    Whether there is anything to move.

Methods (2)

Used by (2)

  • EditorApplicationVixen.Editor.App
  • MeshEditTestsVixen.Editor.SceneView.Tests