ICameraViewportDepth

Description

interface Tinman.Engine.Components.ICameraViewportDepth

Derived from

ICameraViewport

Extended by

CameraViewport sealed

Base interface for classes that represent a camera-based viewport on the screen, with additional functionality regarding depth values.

Public / Methods

Depth​Denormalize


[Pure]
public method DepthDenormalize → (1)

in : float32

The normalized depth value, in the range [0..1].

returns → float64

The denormalized depth value (see ZRange).

Denormalizes the given depth value.

Depth​Normalize


[Pure]
public method DepthNormalize → (1)

in : float64

The denormalized depth value (see ZRange).

returns → float32

The normalized depth value, in the range [0..1].

Normalizes the given depth value.

World​To​Screen​Depth


[Pure]
public method WorldToScreenDepth → (4)

in : float64

The point X-coordinate, in world-space.

in : float64

The point Y-coordinate, in world-space.

in : float64

The point Z-coordinate, in world-space.

offset opt : float64 = 0

Optional depth offset to use, given as a circle radius in screen-space. If positive, the projected depth will be decreased (i.e. nearer). If negative, the projected depth will be increased (i.e. farther).

returns → Vec3F

The screen coordinates (see Vec3F.X and Vec3F.Y) and normalized depth value (see Vec3F.Z) in the range [0..1] or Vec3F.Undefined if the given point is undefined or behind the viewport plane.

Projects the given point onto the screen.

Public / Attributes

ZRange


public attribute ZRange → (get,set)

value : RangeD

The depth range:
RangeD.Start is the denormalized depth value of ViewFrustumPlane.Near,
RangeD.End is the denormalized depth value of ViewFrustumPlane.Far

The depth range to use for computing normalized depth values in the range [0..1].

Defaults to [0.001..20000000].

Extensions

Screen​Interpolate


[Pure]
public static method ScreenInterpolate → (3)

in : Vec3F

First screen coordinate.

in : Vec3F

Second screen coordinate.

in : float32

The interpolation factor: 0 = in, 1 = in.

returns → Vec3F

The interpolated screen coordinates with depth.

Interpolates between the given screen coordinates, including the normalized depth coordinate in Vec3F.Z.

World​To​Screen​Depth


[Pure]
public static method WorldToScreenDepth → (2)

point in : Vec3D

The point coordinates, in world-space.

offset opt : float64 = 0

Optional depth offset to use, given as a circle radius in screen-space. If positive, the projected depth will be decreased (i.e. nearer). If negative, the projected depth will be increased (i.e. farther).

returns → Vec3F

The screen coordinates (see Vec3F.X and Vec3F.Y) and normalized depth value (see Vec3F.Z) in the range [0..1] or Vec3F.Undefined if the given point is undefined or behind the viewport plane.

Projects the given point onto the screen.

ZRange​Far


public static method ZRangeFar → (2)

zFar in : float64

The value for RangeD.End.

ratio opt : float64 = 5E-10

The quotient of RangeD.Start and RangeD.End.

Sets the value of ICameraViewportDepth.