C# Класс SGDE.Physics.PhysicsBaby

General physical properties.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

AddBounce() публичный Метод

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".
Результат void

AddCollisionUnit() публичный Метод

Add a CollisionUnit to associate with this PhysicsBaby.
public AddCollisionUnit ( CollisionUnit unit ) : void
unit SGDE.Physics.Collision.CollisionUnit The CollisionUnit to add.
Результат void

AddForce() публичный Метод

Add a force.
public AddForce ( Vector2 force ) : void
force Vector2 The delta force to add.
Результат void

AddVelocity() публичный Метод

Add velocity to the PhysicsBaby's velocity.
public AddVelocity ( Vector2 velocity ) : void
velocity Vector2 The delta velocity to add to the current velocity.
Результат void

GetForces() публичный Метод

Get the total, additional, forces.
public GetForces ( ) : Vector2
Результат Vector2

GetVelocity() публичный Метод

Get the current total velocity.
public GetVelocity ( ) : Vector2
Результат Vector2

IsStatic() публичный Метод

Get if the PhysicsBaby is static (doesn't move).
public IsStatic ( ) : bool
Результат bool

PhysicsBaby() публичный Метод

Instantiate a new PhysicsBaby for a specific Entity.
public PhysicsBaby ( System.Entity owner ) : System
owner System.Entity The Entity that "owns" this PhysicsBaby.
Результат System

SetForces() публичный Метод

Set the total, additional, forces.
public SetForces ( Vector2 forces ) : void
forces Vector2 Total additional forces.
Результат void

SetStatic() публичный Метод

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.
Результат void

SetVelocity() публичный Метод

Set the total velocity.
public SetVelocity ( Vector2 velocity ) : void
velocity Vector2 The velocity for the PhysicsBaby.
Результат void

Update() публичный Метод

Update the position and velocity of the PhysicsBaby.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The current GameTime.
Результат void