C# Class Project290.Physics.Controllers.AbstractForceController

Inheritance: Controller
Show file Open project: scastle/Solitude

Public Properties

Property Type Description
DecayCurve Microsoft.Xna.Framework.Curve
ForceType ForceTypes
StrengthCurve Microsoft.Xna.Framework.Curve

Protected Properties

Property Type Description
Randomize System.Random

Public Methods

Method Description
AbstractForceController ( ) : System

Constructor

AbstractForceController ( TimingModes mode ) : System

Overloaded Contstructor with supplying Timing Mode

ApplyForce ( float dt, float strength ) : void

Apply the force supplying strength (wich is modified in Update() according to the TimingMode

Trigger ( ) : void

Triggers the trigger modes (Trigger and Curve)

Update ( float dt ) : void

Inherited from Controller Depending on the TimingMode perform timing logic and call ApplyForce()

Protected Methods

Method Description
GetDecayMultiplier ( Body body ) : float

Calculate the Decay for a given body. Meant to ease force development and stick to the DRY principle and provide unified and predictable decay math.

Method Details

AbstractForceController() public method

Constructor
public AbstractForceController ( ) : System
return System

AbstractForceController() public method

Overloaded Contstructor with supplying Timing Mode
public AbstractForceController ( TimingModes mode ) : System
mode TimingModes
return System

ApplyForce() public abstract method

Apply the force supplying strength (wich is modified in Update() according to the TimingMode
public abstract ApplyForce ( float dt, float strength ) : void
dt float
strength float The strength
return void

GetDecayMultiplier() protected method

Calculate the Decay for a given body. Meant to ease force development and stick to the DRY principle and provide unified and predictable decay math.
protected GetDecayMultiplier ( Body body ) : float
body Project290.Physics.Dynamics.Body The body to calculate decay for
return float

Trigger() public method

Triggers the trigger modes (Trigger and Curve)
public Trigger ( ) : void
return void

Update() public method

Inherited from Controller Depending on the TimingMode perform timing logic and call ApplyForce()
public Update ( float dt ) : void
dt float
return void

Property Details

DecayCurve public property

Curve to be used for Decay in Curve mode
public Curve,Microsoft.Xna.Framework DecayCurve
return Microsoft.Xna.Framework.Curve

ForceType public property

The Forcetype of the instance
public ForceTypes ForceType
return ForceTypes

Randomize protected property

Provided for reuse to provide Variation functionality in inheriting classes
protected Random,System Randomize
return System.Random

StrengthCurve public property

Curve used by Curve Mode as an animated multiplier for the force strength. Only positions between 0 and 1 are considered as that range is stretched to have ImpulseLength.
public Curve,Microsoft.Xna.Framework StrengthCurve
return Microsoft.Xna.Framework.Curve