C# Класс 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.
Наследование: Microsoft.Xna.Framework.GameComponent
Показать файл Открыть проект Примеры использования класса

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

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

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

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

public AddRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Результат void

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

public HandleMessage ( object sender, Message message ) : void
sender object
message Ballz.Messages.Message
Результат void

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

public Initialize ( ) : void
Результат void

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

public IsEmpty ( Vector2 Position ) : bool
Position Vector2
Результат bool

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

public LoosenRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Результат void

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

public PhysicsControl ( Ballz game ) : Ballz.GameSession.World
game Ballz
Результат Ballz.GameSession.World

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

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

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

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

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

public Raycast ( Vector2 rayStart, Vector2 rayEnd ) : RaycastResult
rayStart Vector2
rayEnd Vector2
Результат RaycastResult

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

public RemoveBody ( Body body ) : void
body FarseerPhysics.Dynamics.Body
Результат void

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

Removes the physics body of the given entity from the physics world.
public RemoveEntity ( Entity e, World worldState ) : void
e Entity
worldState World
Результат void

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

public RemoveRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Результат void

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

public ShortenRope ( Rope rope ) : void
rope Ballz.GameSession.World.Rope
Результат void

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

public Update ( GameTime time ) : void
time GameTime
Результат void

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

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