C# Class SharpNeat.DomainsExtra.Box2D.Box2dDomainView

Afficher le fichier Open project: colgreen/sharpneat

Protected Properties

Свойство Type Description
_box IBlackBox
_simWorld SimulationWorld

Méthodes publiques

Méthode Description
Box2dDomainView ( IBlackBox>.IGenomeDecoder genomeDecoder ) : System

Construct with the provided IGenomeDecoder, this is used to decode genome(s) into IBlackBox controllers.

RefreshView ( object genome ) : void

Refresh/update the view with the provided genome.

Méthodes protégées

Méthode Description
CreateSimulationWorld ( ) : SimulationWorld

Create a Box2D simulation world.

InvokeController ( ) : void

Invoke any required control logic in the Box2D world.

OnHandleDestroyed ( EventArgs e ) : void

Event handler to clean-up on window closure.

TestStopCondition ( ) : bool

Test if the Box2D world has arrived at a stop condition.

Private Methods

Méthode Description
ConvertScreenToWorld ( float x, float y ) : Vec2

Convert screen coordinates to box2d world coords.

InitDebugDraw ( ) : void

Initialise debug drawing object (interface between Box2D world and openGL rendering).

RunTrial ( ) : void

Run one simulation.

SetView ( ) : void

Set the extents of the viewport and the box2D world. The extents of the two coordinate systems are set to preserve the correct aspect ratio when rendering the Box2d world. This is done simply be always rendering the full height of the box2D world and varying the horizontal extents to maintain the aspect ratio as the viewport is resized.

SimulationThread ( ) : void

Run simulations until thread is terminated.

btnReset_Click ( object sender, EventArgs e ) : void
openGlControl_MouseDown ( object sender, MouseEventArgs e ) : void
openGlControl_MouseMove ( object sender, MouseEventArgs e ) : void
openGlControl_MouseUp ( object sender, MouseEventArgs e ) : void
openGlControl_Resize ( object sender, EventArgs e ) : void

Method Details

Box2dDomainView() public méthode

Construct with the provided IGenomeDecoder, this is used to decode genome(s) into IBlackBox controllers.
public Box2dDomainView ( IBlackBox>.IGenomeDecoder genomeDecoder ) : System
genomeDecoder IBlackBox>.IGenomeDecoder
Résultat System

CreateSimulationWorld() protected abstract méthode

Create a Box2D simulation world.
protected abstract CreateSimulationWorld ( ) : SimulationWorld
Résultat SimulationWorld

InvokeController() protected abstract méthode

Invoke any required control logic in the Box2D world.
protected abstract InvokeController ( ) : void
Résultat void

OnHandleDestroyed() protected méthode

Event handler to clean-up on window closure.
protected OnHandleDestroyed ( EventArgs e ) : void
e EventArgs
Résultat void

RefreshView() public méthode

Refresh/update the view with the provided genome.
public RefreshView ( object genome ) : void
genome object
Résultat void

TestStopCondition() protected méthode

Test if the Box2D world has arrived at a stop condition.
protected TestStopCondition ( ) : bool
Résultat bool

Property Details

_box protected_oe property

The black box controller used by the simulation thread.
protected IBlackBox _box
Résultat IBlackBox

_simWorld protected_oe property

The Box2D world.
protected SimulationWorld,SharpNeat.DomainsExtra.Box2D _simWorld
Résultat SimulationWorld