Vixen
02b45cc4
csharp
public sealed class EntityGizmoTarget

An entity, as something the gizmo can move.

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

Remarks

The adapter between the gizmo's arithmetic — which knows nothing about worlds — and the ECS. It is a class rather than a ref struct over Transform because the gizmo holds its targets across the frames of a drag, and the engine's Transform façade is deliberately a view that cannot outlive the frame it was made in.

⚠ Reads and writes go straight to the chunk, every time. Nothing is cached: two adapters over one entity therefore cannot disagree, and a script that moved the entity mid-drag is seen rather than overwritten. The cost is a component lookup per property access, which against a drag's handful of targets per frame is not a cost.

⚠ World rotation is written back through the parent's inverse, and the parent's world transform is whatever the last TransformSystem pass produced. Dragging a child in the same frame as its parent therefore lands relative to where the parent was at the start of the frame and is corrected next pass — which is exactly what Transform's own remarks say about setting a world-space property, and it is Unity's behaviour too.

Fields and properties (5)

  • public Entity Entity

    The entity being moved.

  • public Vector3 Position

    Where it is, in world space.

  • public Quaternion Rotation

    How it is turned, in world space.

  • public Vector3 Scale

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

  • public Matrix4x4 ParentToWorld

Methods (3)

Used by (2)

  • EditorApplicationVixen.Editor.App
  • OneEditPathTestsVixen.Editor.App.Tests