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

class TerrainView in Tinman.AddOns.Components

A view onto a 3D terrain mesh.

sealed class TerrainView extends Disposable
  implements IGraphicsComponent
  IRenderable
  IUpdateableFrameTime

Public / Attributes

AmbientOcclusion

Scale factor for ambient occlusion terms in terrain vertices (see Horizon).

public property AmbientOcclusion { get set }
type float32
value The ambient occlusion scale factor, in the range [0..1].

Remarks:

Defaults to 1.

Bounds

The screen bounds of this terrain view.

public property Bounds { get set }
type Box2I
value The screen bounds.

ConeCulling

public property ConeCulling { get }
type ConeCulling
value

DistanceCulling

public property DistanceCulling { get }
type DistanceCulling
value

Flags

public property Flags { get set }
type TerrainViewFlags
value

Frustum

public property Frustum { get }
type ViewFrustum
value

FrustumCulling

public property FrustumCulling { get }
type FrustumCulling
value

HasLevelOfDetail

public property HasLevelOfDetail { get }
type bool
value

HorizonCulling

public property HorizonCulling { get }
type HorizonCulling
value

LifecycleState

Returns the lifecycle state of this object.

public virtual property LifecycleState { get }
type LifecycleState
value The lifecycle state.
inherited Disposable.LifecycleState

Lighting

The environment lightmap cube texture.

public property Lighting { get set }
type IEnvironmentMap
value [not-null] The lightmap texture.

Remarks:

Defaults to an EnvironmentMapSky object.

LightingSize

Size of the environment lightmap cube texture.

public property LightingSize { get set }
type int32
value [pow2] The lightmap size.

Remarks:

Defaults to 256.

MaterialOffset

public property MaterialOffset { get set }
type Vec3D
value

ModelRendererStats

public property ModelRendererStats { get }
type ModelRendererStats
value

ModeRendererPose

public property ModeRendererPose { get }
type ModelPose
value

Progress

public property Progress { get }
type int32
value

Shadows

public property Shadows { get }
type ShadowMapping
value

Terrain

public property Terrain { get }
type TerrainMesh
value

TriangulationBuffer

public property TriangulationBuffer { get }
type TriangulationBuffer
value

Viewport

public property Viewport { get }
type CameraViewport
value

VisibleCheck

public property VisibleCheck { get }
type ScreenVisibleCheck
value

Wind

The wind animation settings.

public property Wind { get set }
type Wind
value The wind settings.

Public / Constructors

TerrainView

Creates a new instance of TerrainView.

public constructor TerrainView (TerrainMesh terrain)
params terrain [not-null] The terrain mesh to use.

Public / Methods

AcquireTry

Acquires a strong reference to this disposable object.

[OwnerReturn, ThreadSafe]
public method AcquireTry ()
type IDisposable
returns this if a new strong reference has been acquired, null if this object is already being disposed.
inherited Disposable.AcquireTry

Remarks:

The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.

This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.

ClearCache

public method ClearCache ()

Dispose

Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.

[Dispose, OwnerThis, ThreadSafe]
public method Dispose ()
inherited Disposable.Dispose

Remarks:

The Dispose method silently returns if the object has already been disposed.

GraphicsAttach

Attaches this component to the given Graphics context.

public method GraphicsAttach (Graphics graphics)
params graphics [not-null] The graphics context.
implements IGraphicsComponent.GraphicsAttach

Remarks:

All graphics-related resources should be created here.

GraphicsDetach

Detaches this user interface component from its Graphics context.

public method GraphicsDetach ()
implements IGraphicsComponent.GraphicsDetach

Remarks:

All graphics-related resources should be disposed here.

GraphicsResize

The screen size has changed.

public method GraphicsResize (Vec2I screenSize)
params screenSize The new screen size, in pixels.
implements IGraphicsComponent.GraphicsResize

Remarks:

The given screen size is equal to the value of ScreenSize of the Graphics object that has been passed to GraphicsAttach earlier.

Render

Performs rendering.

public method Render ()
implements IRenderable.Render

Remarks:

Implementing methods must not assume that any specific render state is in place when being called. Instead, the implementing method is responsible for setting up all state that is required for rendering.

Usually, implementing classes receive their current graphics context directly or indirectly from GraphicsContextAttach or GraphicsAttach.

In order to maximize parallelism between the CPU and GPU, only actual rendering (using the current graphics context) should be performed here. All other preparation resp. setup should be done in RenderPrepare instead.

See also:

IApplication.GraphicsContextAttach
IGraphicsComponent.GraphicsAttach

RenderPrepare

Prepares rendering.

public method RenderPrepare ()
implements IRenderPreparable.RenderPrepare

Remarks:

This method is called before Render, when the graphics context has not yet begun to render the scene.

All setup work that does not require a graphics context (e.g. matrix computation, per-frame visibility determination) should be done here. This can help to maximize parallelism between the CPU and the GPU.

ResetCamera

public method ResetCamera ()

Stats

public method Stats (TerrainViewStats stats)
type float32
params stats

UpdateFrameTime

This method is called once per application frame.

public method UpdateFrameTime (float32 time)
type bool
params time [>0] The amount of time that has elapsed since the last frame, in seconds.
returns true if the object needs to be presented again, false if the current presentation is still valid.
implements IUpdateableFrameTime.UpdateFrameTime