Scripting API

Scripting API

Lens

Record struct in Abyss.Core, from Abyss.Core.

How a camera sees: where it is, which way it is turned, how wide it sees and how near, and how big the view it draws into is; for an orthographic camera, how tall a piece of the world it sees in place of how wide an angle.

public readonly record struct Lens

Remarks

Laid out as abyss_core::gizmo::Lens is, 48 bytes.

Constructors

Lens

public Lens(Vector3 Position, Quaternion Rotation, float FieldOfView, float Near, float Width, float Height, float HalfHeight = 0)

How a camera sees: where it is, which way it is turned, how wide it sees and how near, and how big the view it draws into is; for an orthographic camera, how tall a piece of the world it sees in place of how wide an angle.

Parameters

  • Position: Where the camera is, in world space.
  • Rotation: Which way it is turned; it looks along its -Z.
  • FieldOfView: Its field of view, from the top of the view to the bottom, in radians; zero for an orthographic camera.
  • Near: How far along where it looks its near plane is, in world units: in front of it for a perspective camera, anywhere for an orthographic one.
  • Width: How wide the view is.
  • Height: How tall.
  • HalfHeight: For an orthographic camera, half of how much of the world its view shows from its top to its bottom, in world units; zero for a perspective one.

Laid out as abyss_core::gizmo::Lens is, 48 bytes.

Properties

Position

public Vector3 Position { get; init; }

Where the camera is, in world space.

Rotation

public Quaternion Rotation { get; init; }

Which way it is turned; it looks along its -Z.

FieldOfView

public float FieldOfView { get; init; }

Its field of view, from the top of the view to the bottom, in radians; zero for an orthographic camera.

Near

public float Near { get; init; }

How far along where it looks its near plane is, in world units: in front of it for a perspective camera, anywhere for an orthographic one.

Width

public float Width { get; init; }

How wide the view is.

Height

public float Height { get; init; }

How tall.

HalfHeight

public float HalfHeight { get; init; }

For an orthographic camera, half of how much of the world its view shows from its top to its bottom, in world units; zero for a perspective one.