C# Class FootballSimulation.PointMass

A 2-dimensional point mass approximation.
Inheritance: IPointMass
Show file Open project: PurdueSIGAI/Soccer Class Usage Examples

Public Methods

Method Description
PointMass ( float mass, float radius, float maxForce, float maxSpeed, Vector2 position, Vector2 velocity ) : System

Initializes a new instance of the PointMass class with the specified initial values for the position and velocity.

ToString ( ) : string

Returns a string representation of the point mass.

Private Methods

Method Description
GetFriction ( float frictionCoefficient ) : Vector2
Reset ( Vector2 position ) : void
ResolveCollision ( Vector2 normal ) : void
Simulate ( float time ) : void

Method Details

PointMass() public method

Initializes a new instance of the PointMass class with the specified initial values for the position and velocity.
public PointMass ( float mass, float radius, float maxForce, float maxSpeed, Vector2 position, Vector2 velocity ) : System
mass float The mass.
radius float The radius used for collision checking.
maxForce float The maximum force.
maxSpeed float The maximum speed.
position Vector2 The position.
velocity Vector2 The velocity.
return System

ToString() public method

Returns a string representation of the point mass.
public ToString ( ) : string
return string