A view onto a 3D terrain mesh.
sealed class
|
TerrainView
|
extends
|
Disposable
|
||
implements
|
IGraphicsComponent
|
||||
IRenderable
|
|||||
IUpdateableFrameTime
|
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
.
The screen bounds of this terrain view.
public
property
|
Bounds
{
get
set
}
|
||
type
|
Box2I
|
||
value
|
The screen bounds. |
public
property
|
ConeCulling
{
get
}
|
||
type
|
ConeCulling
|
||
value
|
public
property
|
DistanceCulling
{
get
}
|
||
type
|
DistanceCulling
|
||
value
|
public
property
|
Flags
{
get
set
}
|
||
type
|
TerrainViewFlags
|
||
value
|
public
property
|
Frustum
{
get
}
|
||
type
|
ViewFrustum
|
||
value
|
public
property
|
FrustumCulling
{
get
}
|
||
type
|
FrustumCulling
|
||
value
|
public
property
|
HasLevelOfDetail
{
get
}
|
||
type
|
bool
|
||
value
|
public
property
|
HorizonCulling
{
get
}
|
||
type
|
HorizonCulling
|
||
value
|
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
The environment lightmap cube texture.
public
property
|
Lighting
{
get
set
}
|
||
type
|
IEnvironmentMap
|
||
value
|
|
The lightmap texture. |
Remarks:
Defaults to an EnvironmentMapSky object.
Size of the environment lightmap cube texture.
public
property
|
LightingSize
{
get
set
}
|
||
type
|
int32
|
||
value
|
|
The lightmap size. |
Remarks:
Defaults
to
256
.
public
property
|
MaterialOffset
{
get
set
}
|
||
type
|
Vec3D
|
||
value
|
public
property
|
ModelRendererStats
{
get
}
|
||
type
|
ModelRendererStats
|
||
value
|
public
property
|
ModeRendererPose
{
get
}
|
||
type
|
ModelPose
|
||
value
|
public
property
|
Progress
{
get
}
|
||
type
|
int32
|
||
value
|
public
property
|
Shadows
{
get
}
|
||
type
|
ShadowMapping
|
||
value
|
public
property
|
Terrain
{
get
}
|
||
type
|
TerrainMesh
|
||
value
|
public
property
|
TriangulationBuffer
{
get
}
|
||
type
|
TriangulationBuffer
|
||
value
|
public
property
|
Viewport
{
get
}
|
||
type
|
CameraViewport
|
||
value
|
public
property
|
VisibleCheck
{
get
}
|
||
type
|
ScreenVisibleCheck
|
||
value
|
The wind animation settings.
public
property
|
Wind
{
get
set
}
|
||
type
|
Wind
|
||
value
|
The wind settings. |
Creates a new instance of TerrainView.
public
constructor
|
TerrainView
(TerrainMesh terrain)
|
||
params
|
terrain
|
[not-null]
|
The terrain mesh to use. |
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.
public
method
|
ClearCache
()
|
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.
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.
Detaches this user interface component from its Graphics context.
public
method
|
GraphicsDetach
()
|
||
implements
|
IGraphicsComponent.GraphicsDetach
|
Remarks:
All graphics-related resources should be disposed here.
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.
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.GraphicsContextAttachPrepares 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.
public
method
|
ResetCamera
()
|
public
method
|
Stats
(TerrainViewStats stats)
|
||
type
|
float32
|
||
params
|
stats
|
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
|