Frame of Reference Game API  1.0.3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
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:
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 ()
 

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 Attributes

virtual double MaxCameraRadius => 2250
 The value for StrategyCamera.MaxRadius. More...
 
bool Lighting = true
 Use lighting in this presentation? More...
 

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, set]
 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...
 

Detailed Description

Handles the visual representation of World content in the OmegaEngine

Constructor & Destructor Documentation

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

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.
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.
override void FrameOfReference.Presentation.Presenter.Dispose ( bool  disposing)
inlineprotected

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

Parameters
disposingtrue if called manually and not by the garbage collector.
void FrameOfReference.Presentation.Presenter.RebuildTerrain ( )
inline

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

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 
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 
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?
void FrameOfReference.Presentation.Presenter.UpdateLighting ( )
inlineprotected

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

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

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

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

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

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

bool FrameOfReference.Presentation.Presenter.Lighting = true
protected

Use lighting in this presentation?

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

The value for StrategyCamera.MaxRadius.

Property Documentation

bool FrameOfReference.Presentation.Presenter.BoundingBoxEntities
getset

Visualize the bounding boxes of all entities

bool FrameOfReference.Presentation.Presenter.BoundingSphereEntities
getset

Visualize the bounding spheres of all entities

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 FrameOfReference.Presentation.Presenter.Terrain
getset

The OmegaEngine representation of World.Universe.Terrain

bool FrameOfReference.Presentation.Presenter.WireframeEntities
getset

Render all entities in wireframe-mode

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: