C# Class Ballz.GameSession.Physics.PhysicsControl

Physics control is called by BallzGame update to simulate discrete GamePhysics.
In each update step, this component syncs the state of all entities into the physics world, runs a simulation step, and syncs positions and velocities back to the entities.
Inheritance: Microsoft.Xna.Framework.GameComponent
Afficher le fichier Open project: SpagAachen/Ballz Class Usage Examples

Méthodes publiques

Méthode Description
AddRope ( Rope rope ) : void
HandleMessage ( object sender, Message message ) : void
Initialize ( ) : void
IsEmpty ( Vector2 Position ) : bool
LoosenRope ( Rope rope ) : void
PhysicsControl ( Ballz game ) : Ballz.GameSession.World
PhysicsStep ( World worldState, float elapsedSeconds ) : void

Runs a single simulation step in the physics engine and syncs the state of the physics bodies back to the given world.

PreparePhysicsEngine ( World worldState ) : void

Syncs the given world state into the physics world. Creates new physics bodies for entities that don't have one yet.

Raycast ( Vector2 rayStart, Vector2 rayEnd ) : RaycastResult
RemoveBody ( Body body ) : void
RemoveEntity ( Entity e, World worldState ) : void

Removes the physics body of the given entity from the physics world.

RemoveRope ( Rope rope ) : void
ShortenRope ( Rope rope ) : void
Update ( GameTime time ) : void
UpdateTerrainBody ( Terrain terrain ) : void

Removes the old terrain physics bodies and replaces them with new ones, generated from the given terrain.

Method Details

AddRope() public méthode

public AddRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Résultat void

HandleMessage() public méthode

public HandleMessage ( object sender, Message message ) : void
sender object
message Ballz.Messages.Message
Résultat void

Initialize() public méthode

public Initialize ( ) : void
Résultat void

IsEmpty() public méthode

public IsEmpty ( Vector2 Position ) : bool
Position Vector2
Résultat bool

LoosenRope() public méthode

public LoosenRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Résultat void

PhysicsControl() public méthode

public PhysicsControl ( Ballz game ) : Ballz.GameSession.World
game Ballz
Résultat Ballz.GameSession.World

PhysicsStep() public méthode

Runs a single simulation step in the physics engine and syncs the state of the physics bodies back to the given world.
public PhysicsStep ( World worldState, float elapsedSeconds ) : void
worldState World
elapsedSeconds float
Résultat void

PreparePhysicsEngine() public méthode

Syncs the given world state into the physics world. Creates new physics bodies for entities that don't have one yet.
public PreparePhysicsEngine ( World worldState ) : void
worldState World
Résultat void

Raycast() public méthode

public Raycast ( Vector2 rayStart, Vector2 rayEnd ) : RaycastResult
rayStart Vector2
rayEnd Vector2
Résultat RaycastResult

RemoveBody() public méthode

public RemoveBody ( Body body ) : void
body FarseerPhysics.Dynamics.Body
Résultat void

RemoveEntity() public méthode

Removes the physics body of the given entity from the physics world.
public RemoveEntity ( Entity e, World worldState ) : void
e Entity
worldState World
Résultat void

RemoveRope() public méthode

public RemoveRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Résultat void

ShortenRope() public méthode

public ShortenRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Résultat void

Update() public méthode

public Update ( GameTime time ) : void
time GameTime
Résultat void

UpdateTerrainBody() public méthode

Removes the old terrain physics bodies and replaces them with new ones, generated from the given terrain.
public UpdateTerrainBody ( Terrain terrain ) : void
terrain Ballz.GameSession.World.Terrain
Résultat void