Frame of Reference Game API  1.0.3
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
FrameOfReference.Presentation.Presenter Class Reference

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

Inheritance diagram for FrameOfReference.Presentation.Presenter:
AlphaFramework.Presentation.PresenterBase< Universe, Vector2 > FrameOfReference.Presentation.BenchmarkPresenter FrameOfReference.Presentation.InteractivePresenter FrameOfReference.Presentation.MenuPresenter FrameOfReference.Presentation.EditorPresenter FrameOfReference.Presentation.InGamePresenter

Public Member Functions

override void Initialize ()
 
void RebuildTerrain ()
 Rebuilds the terrain from World.Universe.Terrain to reflect any modifications performed. More...
 
override void DimDown ()
 
override void DimUp ()
 
- Public Member Functions inherited from AlphaFramework.Presentation.PresenterBase< Universe, Vector2 >
virtual void HookIn ()
 
virtual void HookOut ()
 
void Dispose ()
 

Protected Member Functions

 Presenter (Engine engine, Universe universe)
 Creates a new presenter. More...
 
override void Dispose (bool disposing)
 To be called by IDisposable.Dispose and the object destructor. More...
 
Camera CreateCamera (CameraState< Vector2 > state=null)
 Creates a new camera based on a state usually loaded from the Universe. More...
 
virtual double CameraController (DoubleVector3 coordinates)
 Ensures the camera does not go under or outside the Terrain. More...
 
void SwitchMusicTheme (string theme, bool immediate=false)
 Switches the theme of the music played More...
 
delegate PositionableRenderable RenderCompononentToEngine< TComponent > (Entity entity, TComponent component)
 A callback for mapping a Render component to an Engine representation. More...
 
void RegisterRenderComponent< TComponent > (RenderCompononentToEngine< TComponent > create)
 Registers a callback for converting a Render component to an Engine representation. More...
 
void UpdateRepresentation (Positionable< Vector2 > element, IPositionable representation)
 Applies the position of a Model element to a View representation. More...
 
void UpdateRepresentation (Entity element, PositionableRenderable representation)
 Applies the position and rotation of a Model element to a View representation. More...
 
void UpdateRepresentation (Entity element, PointLight representation)
 Applies the position and rotation of a Model element to a View representation. More...
 
override void RegisterRenderablesSync ()
 
void UpdateLighting ()
 Updates _lightSun and _lightMoon based on the light phase in PresenterBase<TUniverse,TCoordinates>.Universe. More...
 
- Protected Member Functions inherited from AlphaFramework.Presentation.PresenterBase< Universe, Vector2 >
 PresenterBase (Engine engine, TUniverse universe)
 

Protected Attributes

virtual double MaxCameraRadius => 2250
 The value for StrategyCamera.MaxRadius. More...
 
bool Lighting = true
 Use lighting in this presentation? More...
 
- Protected Attributes inherited from AlphaFramework.Presentation.PresenterBase< Universe, Vector2 >
readonly ModelViewSync< Positionable< TCoordinates >, PositionableRenderable > RenderablesSync
 
readonly ModelViewSync< Positionable< TCoordinates >, LightSource > LightsSync
 
readonly Engine Engine
 
readonly Scene Scene
 

Properties

bool WireframeTerrain [get, set]
 Render the OmegaEngine.Graphics.Renderables.Terrain in wireframe-mode More...
 
bool WireframeEntities [get, set]
 Render all entities in wireframe-mode More...
 
bool BoundingSphereEntities [get, set]
 Visualize the bounding spheres of all entities More...
 
bool BoundingBoxEntities [get, set]
 Visualize the bounding boxes of all entities More...
 
Terrain Terrain [get]
 The OmegaEngine representation of World.Universe.Terrain More...
 
CameraState< Vector2 > CameraState [get]
 Retreives the current state of the Camera for storage in the Universe. More...
 
- Properties inherited from AlphaFramework.Presentation.PresenterBase< Universe, Vector2 >
View View
 
TUniverse Universe
 
bool Initialized
 
bool Disposed
 

Detailed Description

Handles the visual representation of World content in the OmegaEngine

Constructor & Destructor Documentation

◆ Presenter()

FrameOfReference.Presentation.Presenter.Presenter ( Engine  engine,
Universe  universe 
)
inlineprotected

Creates a new presenter.

Parameters
engineThe engine to use for rendering.
universeThe game world to present.

Member Function Documentation

◆ CameraController()

virtual double FrameOfReference.Presentation.Presenter.CameraController ( DoubleVector3  coordinates)
inlineprotectedvirtual

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

Returns
The minimum height the camera must have.

◆ CreateCamera()

Camera FrameOfReference.Presentation.Presenter.CreateCamera ( CameraState< Vector2 >  state = null)
inlineprotected

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

Parameters
stateThe state to place the new camera in; null for default (looking at the center of the terrain).
Returns
The newly created Camera.

◆ Dispose()

override void FrameOfReference.Presentation.Presenter.Dispose ( bool  disposing)
inlineprotectedvirtual

To be called by IDisposable.Dispose and the object destructor.

Parameters
disposingtrue if called manually and not by the garbage collector.

Reimplemented from AlphaFramework.Presentation.PresenterBase< Universe, Vector2 >.

◆ RebuildTerrain()

void FrameOfReference.Presentation.Presenter.RebuildTerrain ( )
inline

Rebuilds the terrain from World.Universe.Terrain to reflect any modifications performed.

◆ RegisterRenderComponent< TComponent >()

void FrameOfReference.Presentation.Presenter.RegisterRenderComponent< TComponent > ( RenderCompononentToEngine< TComponent >  create)
inlineprotected

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

Template Parameters
TComponentThe specific type of Render component to handle.
Parameters
createThe callback for mapping a Render component to an Engine representation.
Type Constraints
TComponent :Render 

◆ RenderCompononentToEngine< TComponent >()

delegate PositionableRenderable FrameOfReference.Presentation.Presenter.RenderCompononentToEngine< TComponent > ( Entity  entity,
TComponent  component 
)
protected

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

Template Parameters
TComponentThe specific type of Render component to handle.
Parameters
entityThe entity containing the Render component.
componentThe Render component to visualize using the Engine.
Returns
The generated Engine representation.
Type Constraints
TComponent :Render 

◆ SwitchMusicTheme()

void FrameOfReference.Presentation.Presenter.SwitchMusicTheme ( string  theme,
bool  immediate = false 
)
inlineprotected

Switches the theme of the music played

Parameters
themeThe new music theme
immediateShall the current song be stopped and the new theme activated immediately?

◆ UpdateLighting()

void FrameOfReference.Presentation.Presenter.UpdateLighting ( )
inlineprotected

Updates _lightSun and _lightMoon based on the light phase in PresenterBase<TUniverse,TCoordinates>.Universe.

◆ UpdateRepresentation() [1/3]

void FrameOfReference.Presentation.Presenter.UpdateRepresentation ( Positionable< Vector2 >  element,
IPositionable  representation 
)
inlineprotected

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

◆ UpdateRepresentation() [2/3]

void FrameOfReference.Presentation.Presenter.UpdateRepresentation ( Entity  element,
PositionableRenderable  representation 
)
inlineprotected

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

◆ UpdateRepresentation() [3/3]

void FrameOfReference.Presentation.Presenter.UpdateRepresentation ( Entity  element,
PointLight  representation 
)
inlineprotected

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

Member Data Documentation

◆ Lighting

bool FrameOfReference.Presentation.Presenter.Lighting = true
protected

Use lighting in this presentation?

◆ MaxCameraRadius

virtual double FrameOfReference.Presentation.Presenter.MaxCameraRadius => 2250
protected

The value for StrategyCamera.MaxRadius.

Property Documentation

◆ BoundingBoxEntities

bool FrameOfReference.Presentation.Presenter.BoundingBoxEntities
getset

Visualize the bounding boxes of all entities

◆ BoundingSphereEntities

bool FrameOfReference.Presentation.Presenter.BoundingSphereEntities
getset

Visualize the bounding spheres of all entities

◆ CameraState

CameraState<Vector2> FrameOfReference.Presentation.Presenter.CameraState
get

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

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

◆ Terrain

Terrain FrameOfReference.Presentation.Presenter.Terrain
get

The OmegaEngine representation of World.Universe.Terrain

◆ WireframeEntities

bool FrameOfReference.Presentation.Presenter.WireframeEntities
getset

Render all entities in wireframe-mode

◆ WireframeTerrain

bool FrameOfReference.Presentation.Presenter.WireframeTerrain
getset

Render the OmegaEngine.Graphics.Renderables.Terrain in wireframe-mode


The documentation for this class was generated from the following files: