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
파일 보기 프로젝트 열기: SpagAachen/Ballz 1 사용 예제들

공개 메소드들

메소드 설명
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