TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface ICameraViewportDepth in Tinman.AddOns.Components

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

interface ICameraViewportDepth extends ICameraViewport
  base of CameraViewport

Attributes

Camera

The Camera object.

property Camera { get }
type Camera
value [not-null] The Camera object.
inherited ICameraViewport.Camera

Center

Returns the screen coordinates that represent the camera direction.

property Center { get }
type Vec2F
value The screen coordinates that represent the camera direction.
inherited ICameraViewport.Center

Remarks:

Usually, this is the center of the screen, but might be a different location, for example to compensate for GUI overlays.

Height

Returns the viewport height, in screen pixels.

property Height { get }
type int32
value [>0] The viewport height.
inherited ICameraViewport.Height

Remarks:

Defaults to 768.

Width

Returns the viewport width, in screen pixels.

property Width { get }
type int32
value [>0] The viewport width.
inherited ICameraViewport.Width

Remarks:

Defaults to 1024.

ZRange

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

property ZRange { get set }
type RangeD
value The depth range:
Start is the denormalized depth value of Near,
End is the denormalized depth value of Far

Remarks:

Defaults to [0.001..20000000].

Methods

DepthDenormalize

Denormalizes the given depth value.

[Pure]
method DepthDenormalize (float32 z)
type float64
params z The normalized depth value, in the range [0..1].
returns The denormalized depth value (see ZRange).

DepthNormalize

Normalizes the given depth value.

[Pure]
method DepthNormalize (float64 z)
type float32
params z The denormalized depth value (see ZRange).
returns The normalized depth value, in the range [0..1].

ScreenToWorld

Computes a viewport ray for the given screen coordinates.

[Pure]
method ScreenToWorld (float32 pixelX, float32 pixelY, out Vec3D origin, out Vec3D direction)
params pixelX The screen X-coordinate (see PerspectiveRay).
  pixelY The screen Y-coordinate (see PerspectiveRay).
  origin Output of viewport ray origin, in world-space.
  direction Output of unit-length viewport ray direction, in world-space.
inherited ICameraViewport.ScreenToWorld

WorldToScreen

Projects the given point onto the viewport plane.

[Pure]
method WorldToScreen (float64 x, float64 y, float64 z)
type Vec2F
params x The point X-coordinate, in world-space.
  y The point Y-coordinate, in world-space.
  z The point Z-coordinate, in world-space.
returns The screen coordinates or Undefined if the given point is undefined or behind the viewport plane.
inherited ICameraViewport.WorldToScreen

WorldToScreenDepth

Projects the given point onto the screen.

[Pure]
method WorldToScreenDepth (float64 x, float64 y, float64 z, float64 offset = 0)
type Vec3F
params x The point X-coordinate, in world-space.
  y The point Y-coordinate, in world-space.
  z The point Z-coordinate, in world-space.
  offset 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). Default to 0.
returns The screen coordinates (see X and Y) and normalized depth value (see Z) in the range [0..1] or Undefined if the given point is undefined or behind the viewport plane.

Extensions

WorldToScreenDepth

Projects the given point onto the screen.

[Pure]
method WorldToScreenDepth (Vec3D point, float64 offset = 0)
type Vec3F
params point The point coordinates, in world-space.
  offset 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). Default to 0.
returns The screen coordinates (see X and Y) and normalized depth value (see Z) in the range [0..1] or Undefined if the given point is undefined or behind the viewport plane.

See also:

Graphics.PushDepth