C# Class SGDE.Physics.PhysicsBaby

General physical properties.
Afficher le fichier Open project: sgdc/sgdc-old Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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".
Résultat void

AddCollisionUnit() public méthode

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

AddForce() public méthode

Add a force.
public AddForce ( Vector2 force ) : void
force Vector2 The delta force to add.
Résultat void

AddVelocity() public méthode

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

GetForces() public méthode

Get the total, additional, forces.
public GetForces ( ) : Vector2
Résultat Vector2

GetVelocity() public méthode

Get the current total velocity.
public GetVelocity ( ) : Vector2
Résultat Vector2

IsStatic() public méthode

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

PhysicsBaby() public méthode

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

SetForces() public méthode

Set the total, additional, forces.
public SetForces ( Vector2 forces ) : void
forces Vector2 Total additional forces.
Résultat void

SetStatic() public méthode

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.
Résultat void

SetVelocity() public méthode

Set the total velocity.
public SetVelocity ( Vector2 velocity ) : void
velocity Vector2 The velocity for the PhysicsBaby.
Résultat void

Update() public méthode

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