C# Class SharpNeat.DomainsExtra.Box2D.SimulationWorld

Abstract class for Box2D simulations/worlds within SharpNEAT.
显示文件 Open project: colgreen/sharpneat Class Usage Examples

Protected Properties

Property Type Description
_simParams SimulationParameters
_world World

Public Methods

Method Description
InitSimulationWorld ( ) : void

Primary initialisation method. Override this method to do sub-class specific initialisation.

MouseDown ( Vec2 p ) : void

Mouse interaction event.

MouseMove ( Vec2 p ) : void

Mouse interaction event.

MouseUp ( ) : void

Mouse interaction event.

SetDebugDraw ( DebugDraw debugDraw ) : void

Sets a drawing routine. Methods on the provided object are called-back to perform drawing on each update.

SimulationWorld ( ) : Box2DX.Collision

Construct new SimulationWorld.

Step ( ) : void

Perform one simulation timestep; move the simulation forward by the timestep increment duration.

Protected Methods

Method Description
CreateContactListener ( ) : ContactListener

Create contact listener.

InitSimulationWorld ( SimulationParameters simParams ) : void

Initialise world with the specified SimulationParameters.

PopulateWorld ( ) : void

Add objects to the Box2d world.

Private Methods

Method Description
CreateBox2DWorld ( ) : World

Create an empty Box2D world.

DrawMouseJoint ( ) : void

Draw the mouse joint (user interaction via mouse events). This method can be removed to remove the dependency on OpenGL.

Method Details

CreateContactListener() protected method

Create contact listener.
protected CreateContactListener ( ) : ContactListener
return Box2DX.Dynamics.ContactListener

InitSimulationWorld() public method

Primary initialisation method. Override this method to do sub-class specific initialisation.
public InitSimulationWorld ( ) : void
return void

InitSimulationWorld() protected method

Initialise world with the specified SimulationParameters.
protected InitSimulationWorld ( SimulationParameters simParams ) : void
simParams SimulationParameters
return void

MouseDown() public method

Mouse interaction event.
public MouseDown ( Vec2 p ) : void
p Vec2
return void

MouseMove() public method

Mouse interaction event.
public MouseMove ( Vec2 p ) : void
p Vec2
return void

MouseUp() public method

Mouse interaction event.
public MouseUp ( ) : void
return void

PopulateWorld() protected abstract method

Add objects to the Box2d world.
protected abstract PopulateWorld ( ) : void
return void

SetDebugDraw() public method

Sets a drawing routine. Methods on the provided object are called-back to perform drawing on each update.
public SetDebugDraw ( DebugDraw debugDraw ) : void
debugDraw DebugDraw
return void

SimulationWorld() public method

Construct new SimulationWorld.
public SimulationWorld ( ) : Box2DX.Collision
return Box2DX.Collision

Step() public method

Perform one simulation timestep; move the simulation forward by the timestep increment duration.
public Step ( ) : void
return void

Property Details

_simParams protected_oe property

High level simulation parameters.
protected SimulationParameters _simParams
return SimulationParameters

_world protected_oe property

The Box2D world.
protected World _world
return World