GuiTSCtrl

Engine/source/gui/3d/guiTSControl.h

Abstract base class for 3D viewport GUIs.

More...

Public Types

enum
RenderStyles {
  RenderStyleStandard = 0
  RenderStyleStereoSideBySide = (1<<0)
  RenderStyleStereoSeparate = (1<<1)
}

Private Types

Parent 

Protected Static Attributes

A list of GuiTSCtrl which are awake and most likely rendering.

Public Functions

_internalRender(RectI guiViewport, RectI renderViewport, Frustum & frustum)

Returns the distance required to fit the given radius within the camera's view.

DECLARE_CATEGORY("Gui 3D" )
DECLARE_DESCRIPTION("Abstract base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> controls that <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D viewport." )
drawLine(Point3F p0, Point3F p1, const ColorI & color, F32 width)

Takes Points in World Space representing a Line or LineList.

drawLineList(const Vector< Point3F > & points, const ColorI color, F32 width)

Returns the last camera query set in onRender.

Returns the last Frustum set in onRender.

Returns the last Projection Matrix set in onRender.

Returns the last Viewport Rect set in onRender.

Returns the last World Matrix set in onRender.

Returns the scale for converting world space units to screen space units...

Do special pre-render processing.

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

Called when this object is asked to sleep.

bool

Called when this object is asked to wake up returns true if it's actually awake at the end.

bool
project(const Point3F & pt, Point3F * dest)

Returns the screen space X,Y and Z for world space point.

projectRadius(F32 dist, F32 radius)
renderDisplayPreview(const RectI & updateRect, GFXTexHandle & previewTexture)
renderGui(Point2I offset, const RectI & updateRect)

Subclasses can override this to perform 2D rendering.

renderWorld(const RectI & updateRect)

Subclasses can override this to perform 3D rendering.

bool

Returns the world space point for X, Y and Z.

Public Static Functions

Detailed Description

Abstract base class for 3D viewport GUIs.

Public Types

RenderStyles

Enumerator

RenderStyleStandard = 0
RenderStyleStereoSideBySide = (1<<0)
RenderStyleStereoSeparate = (1<<1)

Private Types

typedef GuiContainer Parent 

Protected Static Attributes

Vector< GuiTSCtrl * > smAwakeTSCtrls 

A list of GuiTSCtrl which are awake and most likely rendering.

U32 smFrameCount 
bool smUseLatestDisplayTransform 

Protected Attributes

F32 mCameraZRot 
F32 mForceFOV 
CameraQuery mLastCameraQuery 

The last camera query set in onRender.

F32 mOrthoHeight 
F32 mOrthoWidth 
F32 mReflectPriority 

A scalar which controls how much of the reflection update timeslice for this viewport to get.

U32 mRenderStyle 

The current render type.

Frustum mSaveFrustum 
MatrixF mSaveModelview 
MatrixF mSaveProjection 
RectI mSaveViewport 
Point2F mSaveWorldToScreenScale 

The saved world to screen space scale.

SimObjectPtr< GuiOffscreenCanvas > mStereoCanvas 
GFXStateBlockRef mStereoGuiSB 
NamedTexTargetRef mStereoGuiTarget 
GFXVertexBufferHandle< GFXVertexPCT > mStereoOverlayVB 
GFXStateBlockRef mStereoPreviewSB 
GFXVertexBufferHandle< GFXVertexPCT > mStereoPreviewVB 

Public Functions

GuiTSCtrl()

_internalRender(RectI guiViewport, RectI renderViewport, Frustum & frustum)

calculateViewDistance(F32 radius)

Returns the distance required to fit the given radius within the camera's view.

DECLARE_CATEGORY("Gui 3D" )

DECLARE_CONOBJECT(GuiTSCtrl )

DECLARE_DESCRIPTION("Abstract base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> controls that <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D viewport." )

drawLine(Point3F p0, Point3F p1, const ColorI & color, F32 width)

Takes Points in World Space representing a Line or LineList.

These will be projected into screen space and rendered with the requested width in pixels.

This is a 2D drawing operation and should not be called from within renderScene without preparing the GFX for 2D rendering first.

These methods are NOT optimized for performance in any way and are only intended for debug rendering, editor rendering, or infrequent rendering.

drawLineList(const Vector< Point3F > & points, const ColorI color, F32 width)

getLastCameraQuery()

Returns the last camera query set in onRender.

getLastFrustum()

Returns the last Frustum set in onRender.

getLastProjectionMatrix()

Returns the last Projection Matrix set in onRender.

getLastViewportRect()

Returns the last Viewport Rect set in onRender.

getLastWorldMatrix()

Returns the last World Matrix set in onRender.

getWorldToScreenScale()

Returns the scale for converting world space units to screen space units...

aka pixels.

onPreRender()

Reimplemented from: GuiContainer

Reimplemented by: TerrainEditor

onRender(Point2I offset, const RectI & updateRect)

Reimplemented from: GuiControl

Reimplemented by: EditTSCtrl, GuiDecalEditorCtrl, GuiNavEditorCtrl, GameTSCtrl

onSleep()

Reimplemented from: GuiControl

Reimplemented by: GuiMeshRoadEditorCtrl, GuiRiverEditorCtrl, GuiRoadEditorCtrl, ForestEditorCtrl, GuiConvexEditorCtrl, GuiDecalEditorCtrl, TerrainEditor, GuiNavEditorCtrl

onWake()

Reimplemented from: GuiControl

Reimplemented by: ForestEditorCtrl, GuiShapeEdPreview, GuiConvexEditorCtrl, GuiDecalEditorCtrl, TerrainEditor, GuiMaterialPreview, GuiObjectView, VPathEditor

processCameraQuery(CameraQuery * query)

Reimplemented by: afxTSCtrl, EditTSCtrl, GameTSCtrl, GuiMaterialPreview, GuiObjectView

project(const Point3F & pt, Point3F * dest)

Returns the screen space X,Y and Z for world space point.

The input z coord is depth, from 0 to 1.

projectRadius(F32 dist, F32 radius)

renderDisplayPreview(const RectI & updateRect, GFXTexHandle & previewTexture)

renderGui(Point2I offset, const RectI & updateRect)

Subclasses can override this to perform 2D rendering.

Reimplemented by: GuiRoadEditorCtrl, ForestEditorCtrl, GuiShapeEdPreview, GuiDecalEditorCtrl, TerrainEditor

renderWorld(const RectI & updateRect)

Subclasses can override this to perform 3D rendering.

Reimplemented by: afxTSCtrl, GuiShapeEdPreview, EditTSCtrl, GameTSCtrl, GuiMaterialPreview, GuiObjectView

setStereoGui(GuiOffscreenCanvas * canvas)

shouldRenderChildControls()

unproject(const Point3F & pt, Point3F * dest)

Returns the world space point for X, Y and Z.

The ouput z coord is depth, from 0 to 1

Public Static Functions

consoleInit()

getFrameCount()

initPersistFields()