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

interface ICameraViewport in Tinman.AddOns.Components

Base interface for classes that represent a camera-based viewport on the screen.

interface ICameraViewport base of ICameraViewportDepth

Attributes

Camera

The Camera object.

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

Center

Returns the screen coordinates that represent the camera direction.

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

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.

Remarks:

Defaults to 768.

Width

Returns the viewport width, in screen pixels.

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

Remarks:

Defaults to 1024.

Methods

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.

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.

Extensions

ScreenToWorld

Computes a viewport ray for the given screen coordinates.

[Pure]
method ScreenToWorld (Vec2F pixel, out Vec3D origin, out Vec3D direction)
params pixel The screen coordinates (see PerspectiveRay).
  origin Output of viewport ray origin.
  direction Output of unit-length viewport ray direction.

WorldToScreen

Projects the given point onto the viewport plane.

[Pure]
method WorldToScreen (Vec3D point)
type Vec2F
params point The point, in world-space.
returns The screen coordinates or Undefined if the given point is undefined or behind the viewport plane.