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
Fields
Lighting
Use lighting in this presentation?
protected bool Lighting
Field Value
Properties
BoundingBoxEntities
Visualize the bounding boxes of all entities
public bool BoundingBoxEntities { get; set; }
Property Value
BoundingSphereEntities
Visualize the bounding spheres of all entities
public bool BoundingSphereEntities { get; set; }
Property Value
CameraState
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
Terrain
The OmegaEngine representation of Terrain
public Terrain? Terrain { get; }
Property Value
WireframeEntities
Render all entities in wireframe-mode
public bool WireframeEntities { get; set; }
Property Value
WireframeTerrain
Render the Terrain in wireframe-mode
public bool WireframeTerrain { get; set; }
Property Value
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
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
booltrue
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>)
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
Entityrepresentation
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
Entityrepresentation
PositionableRenderable