Torque 3D - Script Manual: GuiTSCtrl Class Reference

TorqueScript

Main   Class List   Namespace List   Online

GuiTSCtrl Class Reference
[3D Controls]

Abstract base class for controls that render 3D scenes. More...

Inheritance diagram for GuiTSCtrl:

List of all members.

Public Member Functions

float calculateViewDistance (float radius)
 Given the camera's current FOV, get the distance from the camera's viewpoint at which the given radius will fit in the render area.
Point2F getWorldToScreenScale ()
 Get the ratio between world-space units and pixels.
Point3F project (Point3F worldPosition)
 Transform world-space coordinates to screen-space (x, y, depth) coordinates.
Point3F unproject (Point3F screenPosition)
 Transform 3D screen-space coordinates (x, y, depth) to world space.

Public Attributes

Camera

float cameraZRot
 Z rotation angle of camera.
float forceFOV
 The vertical field of view in degrees or zero to use the normal camera FOV.
Rendering

float reflectPriority
 The share of the per-frame reflection update work this control's rendering should run.

Detailed Description

Abstract base class for controls that render 3D scenes.

GuiTSCtrl is the base class for controls that render 3D camera views in Torque. The class itself does not implement a concrete scene rendering. Use GuiObjectView to display invidiual shapes in the Gui and GameTSCtrl to render full scenes.

See also:
GameTSCtrl
GuiObjectView

Member Function Documentation

float GuiTSCtrl::calculateViewDistance ( float  radius  ) 

Given the camera's current FOV, get the distance from the camera's viewpoint at which the given radius will fit in the render area.

Parameters:
radius Radius in world-space units which should fit in the view.
Returns:
The distance from the viewpoint at which the given radius would be fully visible.
Point2F GuiTSCtrl::getWorldToScreenScale (  ) 

Get the ratio between world-space units and pixels.

Returns:
The amount of world-space units covered by the extent of a single pixel.
Point3F GuiTSCtrl::project ( Point3F  worldPosition  ) 

Transform world-space coordinates to screen-space (x, y, depth) coordinates.

Parameters:
worldPosition The world-space position to transform to screen-space.
Returns:
The
Point3F GuiTSCtrl::unproject ( Point3F  screenPosition  ) 

Transform 3D screen-space coordinates (x, y, depth) to world space.

This method can be, for example, used to find the world-space position relating to the current mouse cursor position.

Parameters:
screenPosition The x/y position on the screen plus the depth from the screen-plane outwards.
Returns:
The world-space position corresponding to the given screen-space coordinates.

Member Data Documentation

Z rotation angle of camera.

The vertical field of view in degrees or zero to use the normal camera FOV.

The share of the per-frame reflection update work this control's rendering should run.

The reflect update priorities of all visible GuiTSCtrls are added together and each control is assigned a share of the per-frame reflection update time according to its percentage of the total priority value.



Copyright © GarageGames, LLC. All Rights Reserved.