CameraViewport

Description

sealed class Tinman.Engine.Components.CameraViewport

Default implementation of the ICameraViewportDepth interface.

A perspective projection is used, see Mat4D.PerspectiveFov. Use the Width, Height, INearAtZero.NearAtZero and ICameraViewportDepth.ZRange properties to configure the projection matrix. The field-of-view angle and view matrices are taken from the camera (see Camera).

Public / Constructors

Camera​Viewport


public constructor CameraViewport → (1)

camera in : Camera

[not-null]
The camera object.

Creates a new instance of CameraViewport.

Public / Methods

Update


public method Update → (2)

frustum in : ViewFrustum

[not-null]
The view frustum to update.

viewLocal opt : bool = false

true to use MatrixViewProjectionLocal, false to use MatrixViewProjection.

Updates the given view frustum, using the current view-projection matrix.

Public / Attributes

Height


public attribute Height → (get,set)

value : int32

[>0]
The viewport height.

Returns the viewport height, in screen pixels.

Defaults to 768.

Matrix​Projection


public attribute MatrixProjection → (get)

value : Mat4D

The projection matrix.

The current projection matrix.

Matrix​View


public attribute MatrixView → (get)

value : Mat4D

The view matrix.

The current view matrix.

Matrix​View​Local


public attribute MatrixViewLocal → (get)

value : Mat4D

The view matrix.

The current view matrix (camera-centric).

Matrix​View​Projection


public attribute MatrixViewProjection → (get)

value : Mat4D

The view-projection matrix.

The current view-projection matrix.

Matrix​View​Projection​Inverse


public attribute MatrixViewProjectionInverse → (get)

value : Mat4D

The inverse view-projection matrix.

The current inverse view-projection matrix.

Matrix​View​Projection​Local


public attribute MatrixViewProjectionLocal → (get)

value : Mat4D

The view-projection matrix.

The current view-projection matrix (camera-centric).

Matrix​View​Projection​Local​Inverse


public attribute MatrixViewProjectionLocalInverse → (get)

value : Mat4D

The inverse view-projection matrix.

The current inverse view-projection matrix (camera-centric).

Width


public attribute Width → (get,set)

value : int32

[>0]
The viewport width.

Returns the viewport width, in screen pixels.

Defaults to 1024.

ZLog


public attribute ZLog → (get,set)

value : bool

true to use logarithmic depth values, false to use linear ones.

Use logarithmic depth values?

When set to true, the normalized depth value zLog is computed like this:

zLog = max(1, z + 1) / log(zFar + 1)

where z is the denormalized depth value of the point and zFar is the denormalized depth value of the far plane.

Defaults to false.