Vixen
02b45cc4
csharp
public struct VirtualCamera

A shot: somewhere the camera could be, with a lens and a claim on being the one that renders.

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

As a scene component

Size
40 bytes — 315 rows in a 16 KB chunk, alone on the archetype

Remarks

A virtual camera is not a camera. It renders nothing and owns no target. It describes a point of view, and a CameraDirector picks one of them each frame and moves the single real Camera to it, blending when the choice changes. That indirection is the whole idea: a level can hold twenty framed shots, each set up once and left alone, and the cuts between them are a matter of which one currently has the highest Priority rather than of code that moves a camera about.

What it does is decided by which stage components sit beside it. A body — one of FollowBody, FramingBody, OrbitBody, HardLockBody — decides where it is; an aim — ComposerAim, HardLookAim, PovAim, MatchTargetAim — decides where it looks. Neither is required: a shot with no body and no aim sits exactly where its entity's transform puts it, which is what a hand-placed establishing shot wants.

⚠ Two bodies, or two aims, on one shot is a configuration error the engine cannot report. The stages are separate chunk sweeps and they run in a fixed order, so the last one to run wins and the other silently does nothing. It is checked by VirtualCameras.Validate, which the editor's inspector and a test can call and the frame loop deliberately does not — a per-frame archetype interrogation to catch a mistake that is made once at authoring time is the wrong place to spend the budget.

Fields and properties (5)

  • public int Priority

    Which shot wins. The enabled shot with the highest priority is the one the director drives towards.

  • public bool Enabled

    Whether this shot is a candidate at all.

  • public CameraLens Lens

    The optics this shot asks for.

  • public int Channel

    Which director this shot answers to.

  • public static VirtualCamera Default

    An enabled shot at priority zero, through the default lens.

Used by (16)

  • CameraDirectorSystemVixen.Engine
  • CameraDirectorTestsVixen.Engine.Tests
  • ComponentRegistrationVixen.Engine
  • PlayerAllocationTestsVixen.Engine.Tests
  • PlayerCameraTestsVixen.Engine.Tests
  • PlayerCamerasVixen.Engine
  • PossessionTestsVixen.Engine.Tests
  • RigVixen.Engine.Tests
  • RigVixen.Engine.Tests
  • TrackedDollyTestsVixen.Engine.Tests
  • TypeRegistrationVixen.Engine
  • VirtualCameraSystemVixen.Engine
  • VirtualCameraTestsVixen.Engine.Tests
  • VirtualCamerasVixen.Engine
  • Vixen_Engine_Cameras_VirtualCameraSerializerVixen.Engine
  • MaterialIconsVixen.Editor.App