ICameraViewport

Description

interface Tinman.Engine.Components.ICameraViewport

Extended by

ICameraViewportDepth

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

Public / Methods

Screen​To​World


[Pure]
public method ScreenToWorld → (2)

pixelX in : float32

The screen X-coordinate.

pixelY in : float32

The screen Y-coordinate.

returns → Ray

The ray.

Computes a viewport ray for the given screen coordinates.

World​To​Screen


[Pure]
public method WorldToScreen → (3)

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.

returns → Vec2F

The screen coordinates or Vec2F.Undefined if the given point is undefined or behind the viewport plane.

Projects the given point onto the viewport plane.

Public / Attributes

Camera


[Constant]
public attribute Camera → (get)

value : Camera

[not-null]
The Camera object.

The Camera object.

Center


public attribute Center → (get)

value : Vec2F

The screen coordinates that represent the camera direction.

Returns the screen coordinates that represent the camera direction.

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

Height


public attribute Height → (get)

value : int32

[>0]
The viewport height.

Returns the viewport height, in screen pixels.

Defaults to 768.

Width


public attribute Width → (get)

value : int32

[>0]
The viewport width.

Returns the viewport width, in screen pixels.

Defaults to 1024.

Extensions

Field​Of​View

2 overloads


[Pure]
public static method FieldOfView1 → ()

returns → float64

The field of view, in degrees.

Returns the field of view.

This method returns either the horizontal or the vertical field of view, whichever is smaller. It assumes that a perspective projection is used, for example one created with Camera.MatrixPerspective).


[Pure]
public static method FieldOfView2 → (1)

mode in : FovMode

The field of view mode.

returns → float64

The field of view, in degrees.

Returns the field of view.

This method converts between vertical and horizontal field of view angles, if necessary. It assumes that a perspective projection is used, for example one created with Camera.MatrixPerspective).

Screen​To​World


[Pure]
public static method ScreenToWorld → (1)

pixel in : Vec2F

The screen coordinates (see Mat4D.PerspectiveRay).

returns → Ray

The viewport ray.

Computes a viewport ray for the given screen coordinates.

World​To​Screen


[Pure]
public static method WorldToScreen → (1)

point in : Vec3D

The point, in world-space.

returns → Vec2F

The screen coordinates or Vec2D.Undefined if the given point in is undefined or behind the viewport plane.

Projects the given point onto the viewport plane.