Vixen
02b45cc4
csharp
public sealed class VfxPreviewView

The effect, running, drawn as the particles it actually has.

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

Remarks

The simulation is real and the picture is honest about being a projection. What steps is VfxSystem — the class a game runs, over the VfxCompiledGraph the document just compiled — so what an author is looking at is their graph's behaviour rather than a mock of it. What draws is this control, projecting each particle's position with a fixed orbit camera and filling a disc of its size in its colour.

⚠ A drawn projection rather than the scene viewport, and the reason is doc 20's own. Particles are drawn by a material, the editor's viewport is a tool renderer with no materials, and Phase 7's wiring is what closes that — the same dependency the picking stage and three view modes are waiting on. A preview that borrowed the tool renderer would be a second thing to rewrite when the real one lands and would still not show a textured sprite. Projecting here costs one transform per particle, needs no device, and is therefore the only form of this that a headless test can assert.

⚠ Nothing is allocated per particle per frame. A preview of ten thousand particles at sixty frames a second is the one control in this assembly where that would matter, so the projection writes into a reused array and the discs are drawn straight from it.

Fields and properties (7)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • public VfxSystem? System

    The system to draw, or for nothing.

  • public float Yaw

    How the effect is looked at, in radians around Y.

  • public float Pitch

    And how far above it, in radians.

  • public float Distance

    How far away the camera is, in world units.

  • public bool IsPlaying

    Whether the effect is being stepped.

  • public float Elapsed

    How much simulated time has passed since the preview last restarted.

Methods (4)

  • public void Step(TimeSpan delta)

    Steps the simulation, if there is one and it is playing.

  • public void Restart()

    Starts the effect again from nothing.

  • protected override void OnDraw(DrawContext context)

    Draws whatever this element is, beyond what a stylesheet can describe.

  • public string Readout()

    What the readout under the preview says.

Used by (1)

  • VfxGraphViewVixen.Editor.AssetEditors