Table of Contents

Component Gameplay

(NOTE) Manages all setup between Camera, Renderer, and viewport UI that is required to define how anything is to be rendered.

Methods Properties Base Classes Derived Classes
Constructor Camera component
ScreenToViewport CameraPath
ScreenToWorldPlane FinalTexture
ScreenToWorldRay ForwardViewportEvents
ScreenToWorldViewPlane Frustum
ScreenToWorldZPlane MarginColor
ViewPlaneSize MouseWorldRay
ViewportTakeFocus NormalizedOffset
ViewportToScreen NormalizedSize
WorldToScreen RendererPath
RenderInEditor
RenderInGame
RenderOrder
RenderToViewport
ResolutionOrAspect
ViewportHasFocus
ViewportOffset
ViewportOffsetWithMargin
ViewportResolution
ViewportResolutionWithMargin
ViewportScaling
ViewToPerspective
WorldToPerspective
WorldToView

Properties


Camera : camera

read-only

Find the Camera component from the CameraPath (or null if it doesn't exist).

var Camera : Camera

CameraPath : cogpath

Object with the Camera component to be used for rendering. A Camera can only be used by one CameraViewport, if already used by another usage will be stolen when assigned.

var CameraPath : CogPath

FinalTexture : texture

read-only

Texture that contains the end result of this CameraViewport's rendering. Must be explicitly written to in renderer script.

var FinalTexture : Texture

ForwardViewportEvents : boolean

Forwards mouse events to viewports underneath this viewport.

var ForwardViewportEvents : Boolean

Frustum : frustum

read-only

Creates a frustum using the CameraViewport's settings (including aspect ratio). If the Camera is null, then this will throw an exception.

var Frustum : Frustum

MarginColor : real4

Color to used for letterbox/scaling margins.

var MarginColor : Real4

MouseWorldRay : ray

read-only

Get the world ray starting from the mouse.

var MouseWorldRay : Ray

NormalizedOffset : real2

Offset of the viewport in normalized UI coordinates.

var NormalizedOffset : Real2

NormalizedSize : real2

Size of viewport in normalized UI coordinates.

var NormalizedSize : Real2

RendererPath : cogpath

Object with renderer script that connects to RenderTasksUpdate that determines what rendering will be done.

var RendererPath : CogPath

RenderInEditor : boolean

If rendering will be ran in edit mode.

var RenderInEditor : Boolean

RenderInGame : boolean

If rendering will be ran in play game mode.

var RenderInGame : Boolean

RenderOrder : integer

The order that rendering should be done relative to other CameraViewports, lowest to highest.

var RenderOrder : Integer

RenderToViewport : boolean

If the rendering result in FinalTexture should also be placed on the UI viewport.

var RenderToViewport : Boolean

ResolutionOrAspect : integer2

var ResolutionOrAspect : Integer2

ViewportHasFocus : boolean

read-only

If the viewport created by this CameraViewport, if rendering to one, has focus.

var ViewportHasFocus : Boolean

ViewportOffset : real2

read-only

The current offset of the viewport, in pixels.

var ViewportOffset : Real2

ViewportOffsetWithMargin : real2

read-only

The current offset of the viewport's margin, in pixels.

var ViewportOffsetWithMargin : Real2

ViewportResolution : real2

read-only

The current resolution of the viewport.

var ViewportResolution : Real2

ViewportResolutionWithMargin : real2

read-only

The current resolution of the viewport including margin.

var ViewportResolutionWithMargin : Real2

ViewportScaling : ViewportScaling

Method to use for sizing the viewport.

var ViewportScaling : ViewportScaling

ViewToPerspective : real4x4

read-only

Transformation that defines how the view frustum is mapped to normalized coordinates, pre W divide.

var ViewToPerspective : Real4x4

WorldToPerspective : real4x4

read-only

Concatenation of the WorldToView and ViewToPerspective transformations.

var WorldToPerspective : Real4x4

WorldToView : real4x4

read-only

Transformation that defines view space as the Camera at the origin and the view direction as -Z.

var WorldToView : Real4x4

Methods


CameraViewport : Void

constructor

Name Type Description
function CameraViewport()

ScreenToViewport : real2

Convert a screen point to a point relative to the viewport. |Name|Type|Description| |---|---|---| |screenPoint|real2| |

function ScreenToViewport(screenPoint : Real2) : Real2

ScreenToWorldPlane : real3

Convert the screen point to a position on a given plane. |Name|Type|Description| |---|---|---| |screenPoint|real2| | |worldPlaneNormal|real3| | |worldPlanePosition|real3| |

function ScreenToWorldPlane(screenPoint : Real2, worldPlaneNormal : Real3, worldPlanePosition : Real3) : Real3

ScreenToWorldRay : ray

Convert a screen point to a ray. |Name|Type|Description| |---|---|---| |screenPoint|real2| |

function ScreenToWorldRay(screenPoint : Real2) : Ray

ScreenToWorldViewPlane : real3

Convert the screen point to a position on the view plane at a given depth. |Name|Type|Description| |---|---|---| |screenPoint|real2| | |viewDepth|real| |

function ScreenToWorldViewPlane(screenPoint : Real2, viewDepth : Real) : Real3

ScreenToWorldZPlane : real3

Convert the screen point to a position on the z plane at a given depth. |Name|Type|Description| |---|---|---| |screenPoint|real2| | |worldDepth|real| |

function ScreenToWorldZPlane(screenPoint : Real2, worldDepth : Real) : Real3

ViewPlaneSize : real2

Size of the screen at a Depth. |Name|Type|Description| |---|---|---| |viewDepth|real| |

function ViewPlaneSize(viewDepth : Real) : Real2

ViewportTakeFocus : boolean

Returns whether or not it succeeded in taking focus. Will always fail if RenderToViewport is false. |Name|Type|Description| |---|---|---|

function ViewportTakeFocus() : Boolean

ViewportToScreen : real2

Convert a viewport point to a screen point. |Name|Type|Description| |---|---|---| |viewportPoint|real2| |

function ViewportToScreen(viewportPoint : Real2) : Real2

WorldToScreen : real2

Convert a world point to a screen point. |Name|Type|Description| |---|---|---| |worldPoint|real3| |

function WorldToScreen(worldPoint : Real3) : Real2