API Reference · Capturing a frame

Rendering.CameraSnapshot

Namespace: Ava3D.Rendering

public readonly record struct Rendering.CameraSnapshot

The camera, frozen for one frame. Small enough to send every time the view changes, and what a CapturedFrame reports it was drawn from.

Up arrives already resolved from the camera's roll rather than being re-derived here, because the render thread must not read a Camera the UI thread is still moving. It is also what makes a rolled camera roll its sprites on every backend: all three take a billboard's axes from the columns of CameraSnapshot.View, so there is nothing further to plumb.

Constructors

MemberDescription
Rendering.CameraSnapshot(Vector3 Position, Vector3 Target, Vector3 Up, float FieldOfViewDegrees, float Near, float Far)

The camera, frozen for one frame. Small enough to send every time the view changes, and what a CapturedFrame reports it was drawn from.

Up arrives already resolved from the camera's roll rather than being re-derived here, because the render thread must not read a Camera the UI thread is still moving. It is also what makes a rolled camera roll its sprites on every backend: all three take a billboard's axes from the columns of CameraSnapshot.View, so there is nothing further to plumb.

Position

Where the camera is, in world units.

Target

What it looks at.

Up

Which way is up, with the camera's roll applied.

FieldOfViewDegrees

The vertical field of view.

Near

The near clipping distance.

Far

The far clipping distance.

Properties

MemberDescription
float Far { get; set; }

The far clipping distance.

float FieldOfViewDegrees { get; set; }

The vertical field of view.

float Near { get; set; }

The near clipping distance.

Vector3 Position { get; set; }

Where the camera is, in world units.

Vector3 Target { get; set; }

What it looks at.

Vector3 Up { get; set; }

Which way is up, with the camera's roll applied.

Matrix4x4 View { get; }

The view matrix: world to camera.

Methods

MemberDescription
static Rendering.CameraSnapshot From(Camera camera)

The camera as it is now. Read it on the thread that owns the camera.

Matrix4x4 GetProjection(float aspectRatio)

The projection matrix for a viewport of this aspect ratio.

See also