Scripting API

Scripting API

SceneProjection

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

How a camera projects: the editor's Scene panel's, and a game's own through World.SetProjection — SceneProjection.Perspective(70f, 0.05f, 600f).

public readonly record struct SceneProjection

Remarks

Laid out as abyss_core::render::SceneProjection is, 16 bytes.

Constructors

SceneProjection

public SceneProjection(float FieldOfView, float Near, float Far, float Across)

How a camera projects: the editor's Scene panel's, and a game's own through World.SetProjection — SceneProjection.Perspective(70f, 0.05f, 600f).

Parameters

  • FieldOfView: Its field of view, from the top of the view to the bottom, in radians; zero for an orthographic projection.
  • Near: How far along where it looks its near plane is, in world units: in front of it in perspective, anywhere orthographic, behind it included.
  • Far: How far its far plane is, which what is beyond is culled by.
  • Across: For an orthographic projection, how much of the world its view shows across its shorter side, in world units.

Laid out as abyss_core::render::SceneProjection is, 16 bytes.

Properties

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 projection.

Near

public float Near { get; init; }

How far along where it looks its near plane is, in world units: in front of it in perspective, anywhere orthographic, behind it included.

Far

public float Far { get; init; }

How far its far plane is, which what is beyond is culled by.

Across

public float Across { get; init; }

For an orthographic projection, how much of the world its view shows across its shorter side, in world units.

FieldOfViewDegrees

public float FieldOfViewDegrees { get; }

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

Methods

Perspective

public static SceneProjection Perspective(float degrees, float near = 0.1, float far = 1000)

A perspective projection, its field of view from the top of the view to the bottom in degrees.

Parameters

  • degrees
  • near
  • far