Table of Contents

Class Presenter

Namespace
FrameOfReference.Presentation
Assembly
FrameOfReference.Presentation.dll

Handles the visual representation of FrameOfReference.World content in the OmegaEngine

public abstract class Presenter : PresenterBase<Universe, Vector2>, IDisposable
Inheritance
Presenter
Implements
Derived
Inherited Members
Extension Methods

Constructors

Presenter(Engine, Universe)

Creates a new presenter.

protected Presenter(Engine engine, Universe universe)

Parameters

engine Engine

The engine to use for rendering.

universe Universe

The game world to present.

Fields

Lighting

Use lighting in this presentation?

protected bool Lighting

Field Value

bool

Properties

BoundingBoxEntities

Visualize the bounding boxes of all entities

public bool BoundingBoxEntities { get; set; }

Property Value

bool

BoundingSphereEntities

Visualize the bounding spheres of all entities

public bool BoundingSphereEntities { get; set; }

Property Value

bool

CameraState

Retreives the current state of the Camera for storage in the Universe.

public CameraState<Vector2> CameraState { get; }

Property Value

CameraState<Vector2>

The current state of the Camera or null if it can not be determined at this time (e.g. cinematic animation in progress).

MaxCameraRadius

The value for MaxRadius.

protected virtual double MaxCameraRadius { get; }

Property Value

double

Terrain

The OmegaEngine representation of Terrain

public Terrain? Terrain { get; }

Property Value

Terrain

WireframeEntities

Render all entities in wireframe-mode

public bool WireframeEntities { get; set; }

Property Value

bool

WireframeTerrain

Render the Terrain in wireframe-mode

public bool WireframeTerrain { get; set; }

Property Value

bool

Methods

CameraController(DoubleVector3)

Ensures the camera does not go under or outside the Terrain.

protected virtual double CameraController(DoubleVector3 coordinates)

Parameters

coordinates DoubleVector3

Returns

double

The minimum height the camera must have.

CreateCamera(CameraState<Vector2>?)

Creates a new camera based on a state usually loaded from the Universe.

protected Camera CreateCamera(CameraState<Vector2>? state = null)

Parameters

state CameraState<Vector2>

The state to place the new camera in; null for default (looking at the center of the terrain).

Returns

Camera

The newly created Camera.

DimDown()

Dims in the screen down.

public override void DimDown()

DimUp()

Dims in the screen back up.

public override void DimUp()

Dispose(bool)

To be called by Dispose() and the object destructor.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true if called manually and not by the garbage collector.

Initialize()

Generate Terrain and Renderables from Positionables and keeps everything in sync using events

public override void Initialize()

Remarks

Should be called before HookIn() is used

Exceptions

FileNotFoundException

A required Asset file could not be found.

IOException

There was an error reading an Asset file.

InvalidDataException

An Asset file contains invalid data.

RebuildTerrain()

Rebuilds the terrain from Terrain to reflect any modifications performed.

public void RebuildTerrain()

RegisterRenderComponent<TComponent>(RenderCompononentToEngine<TComponent>)

Registers a callback for converting a Render component to an Engine representation.

protected void RegisterRenderComponent<TComponent>(Presenter.RenderCompononentToEngine<TComponent> create) where TComponent : Render

Parameters

create Presenter.RenderCompononentToEngine<TComponent>

The callback for mapping a Render component to an Engine representation.

Type Parameters

TComponent

The specific type of Render component to handle.

RegisterRenderablesSync()

Hook to configure RenderablesSync and LightsSync.

protected override void RegisterRenderablesSync()

UpdateLighting()

Updates FrameOfReference.Presentation.Presenter._lightSun and FrameOfReference.Presentation.Presenter._lightMoon based on the light phase in Universe.

protected void UpdateLighting()

UpdateRepresentation(Positionable<Vector2>, IPositionable)

Applies the position of a Model element to a View representation.

protected void UpdateRepresentation(Positionable<Vector2> element, IPositionable representation)

Parameters

element Positionable<Vector2>
representation IPositionable

UpdateRepresentation(Entity, PointLight)

Applies the position and rotation of a Model element to a View representation.

protected void UpdateRepresentation(Entity element, PointLight representation)

Parameters

element Entity
representation PointLight

UpdateRepresentation(Entity, PositionableRenderable)

Applies the position and rotation of a Model element to a View representation.

protected void UpdateRepresentation(Entity element, PositionableRenderable representation)

Parameters

element Entity
representation PositionableRenderable