C# Class SGDE.Physics.PhysicsBaby

General physical properties.
Datei anzeigen Open project: sgdc/sgdc-old Class Usage Examples

Public Methods

Method Description
AddBounce ( CollisionUnit unit, CollisionUnit other ) : void

Add a bounce between two CollisionUnits based on the velocity.

AddCollisionUnit ( CollisionUnit unit ) : void

Add a CollisionUnit to associate with this PhysicsBaby.

AddForce ( Vector2 force ) : void

Add a force.

AddVelocity ( Vector2 velocity ) : void

Add velocity to the PhysicsBaby's velocity.

GetForces ( ) : Vector2

Get the total, additional, forces.

GetVelocity ( ) : Vector2

Get the current total velocity.

IsStatic ( ) : bool

Get if the PhysicsBaby is static (doesn't move).

PhysicsBaby ( System.Entity owner ) : System

Instantiate a new PhysicsBaby for a specific Entity.

SetForces ( Vector2 forces ) : void

Set the total, additional, forces.

SetStatic ( bool beStatic ) : void

Set if the PhysicsBaby is static (doesn't move).

SetVelocity ( Vector2 velocity ) : void

Set the total velocity.

Update ( GameTime gameTime ) : void

Update the position and velocity of the PhysicsBaby.

Method Details

AddBounce() public method

Add a bounce between two CollisionUnits based on the velocity.
public AddBounce ( CollisionUnit unit, CollisionUnit other ) : void
unit SGDE.Physics.Collision.CollisionUnit The main collision unit involved in the "bounce".
other SGDE.Physics.Collision.CollisionUnit The secondary collision unit involved in the "bounce".
return void

AddCollisionUnit() public method

Add a CollisionUnit to associate with this PhysicsBaby.
public AddCollisionUnit ( CollisionUnit unit ) : void
unit SGDE.Physics.Collision.CollisionUnit The CollisionUnit to add.
return void

AddForce() public method

Add a force.
public AddForce ( Vector2 force ) : void
force Vector2 The delta force to add.
return void

AddVelocity() public method

Add velocity to the PhysicsBaby's velocity.
public AddVelocity ( Vector2 velocity ) : void
velocity Vector2 The delta velocity to add to the current velocity.
return void

GetForces() public method

Get the total, additional, forces.
public GetForces ( ) : Vector2
return Vector2

GetVelocity() public method

Get the current total velocity.
public GetVelocity ( ) : Vector2
return Vector2

IsStatic() public method

Get if the PhysicsBaby is static (doesn't move).
public IsStatic ( ) : bool
return bool

PhysicsBaby() public method

Instantiate a new PhysicsBaby for a specific Entity.
public PhysicsBaby ( System.Entity owner ) : System
owner System.Entity The Entity that "owns" this PhysicsBaby.
return System

SetForces() public method

Set the total, additional, forces.
public SetForces ( Vector2 forces ) : void
forces Vector2 Total additional forces.
return void

SetStatic() public method

Set if the PhysicsBaby is static (doesn't move).
public SetStatic ( bool beStatic ) : void
beStatic bool true if the PhysicsBaby is static, false if otherwise.
return void

SetVelocity() public method

Set the total velocity.
public SetVelocity ( Vector2 velocity ) : void
velocity Vector2 The velocity for the PhysicsBaby.
return void

Update() public method

Update the position and velocity of the PhysicsBaby.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The current GameTime.
return void