Vixen
02b45cc4
csharp
public sealed class ProxyShapeGizmoTarget

One proxy shape, as something the viewport's gizmo can drag.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

What "sized with handles" needs. The shapes already draw — DrawShapes puts every one of them in a viewport — and what was missing was a way to take hold of one. This is the same IGizmoTarget an entity and a mesh selection go through, so the move, rotate and scale modes, the snapping and the world/parent space toggle all work without any of them knowing what a proxy shape is.

⚠ Scale writes the extents, because a proxy shape has no scale of its own. Its size is its extents, so a scale handle that wrote a separate field would be a second size that has to be reconciled with the first — and a sphere with a radius of 0.2 and a scale of 3 is a sphere whose radius nobody can read off the panel.

⚠ One undo entry per drag, not one per frame. The gizmo recomputes from mouse-down and writes absolute values every frame it moves; a target that called Edit from its setters would put sixty entries on the stack for one gesture. The drag mutates a copy and Commit records the edit, which is MeshGizmoTarget's arrangement for the same reason.

Fields and properties (7)

  • public ProxyShapeRecord Current

    What the shape is at this moment of the drag, before it has been recorded.

  • public BoneTransform Joint

    Where the joint the shape hangs off is, in world space.

  • public Vector3 Position

    Where it is, in world space.

  • public Quaternion Rotation

    How it is turned, in world space.

  • public Vector3 Scale
  • public Matrix4x4 ParentToWorld

    Its parent's local-to-world matrix, or the identity for a root.

  • public bool IsDirty

    Whether the drag changed anything.

Methods (4)

Used by (2)

  • ProxyShapeEditorTestsVixen.Editor.AssetEditors.Tests
  • ProxyShapeViewVixen.Editor.AssetEditors