public sealed class ProxyShapeGizmoTargetOne 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 CurrentWhat the shape is at this moment of the drag, before it has been recorded.
public BoneTransform JointWhere the joint the shape hangs off is, in world space.
public Vector3 PositionWhere it is, in world space.
public Quaternion RotationHow it is turned, in world space.
public Vector3 Scalepublic Matrix4x4 ParentToWorldIts parent's local-to-world matrix, or the identity for a root.
public bool IsDirtyWhether the drag changed anything.
Methods (4)
public ProxyShapeGizmoTarget(ProxyShapeDocument document, ProxyShapeRecord shape, in BoneTransform joint)Takes hold of a shape.
public ProxyShapeRecord Commit()Records the whole drag as one undoable edit.
public GizmoEdit? Record(in GizmoDrag drag)public static BoneTransform JointOf(Skeleton skeleton, ReadOnlySpan<BoneTransform> model, ProxyShapeRecord shape, in BoneTransform world)Where a shape's joint is, given a rig and a pose.
Used by (2)
- ProxyShapeEditorTestsVixen.Editor.AssetEditors.Tests
- ProxyShapeViewVixen.Editor.AssetEditors