C# 클래스 Project290.Physics.Dynamics.World

The world class manages all physics entities, dynamic simulation, and asynchronous queries.
파일 보기 프로젝트 열기: scastle/Solitude 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
BodyAdded BodyDelegate
BodyRemoved BodyDelegate
Enabled bool
FixtureAdded FixtureDelegate
FixtureRemoved FixtureDelegate
Gravity Vector2
Island Island
JointAdded JointDelegate
JointRemoved JointDelegate

공개 메소드들

메소드 설명
AddBody ( Body body ) : void

Create a rigid body.

AddBreakableBody ( BreakableBody breakableBody ) : void
AddController ( Controller controller ) : void
AddJoint ( Joint joint ) : void

Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding.

ClearForces ( ) : void

Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps. By default, forces will be automatically cleared, so you don't need to call this function.

ProcessChanges ( ) : void

All adds and removes are cached by the World duing a World step. To process the changes before the world updates again, call this method.

QueryAABB ( bool>.Func callback, AABB &aabb ) : void

Query the world for all fixtures that potentially overlap the provided AABB.

RayCast ( RayCastCallback callback, Vector2 point1, Vector2 point2 ) : void

Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point.

RemoveBody ( Body body ) : void

Destroy a rigid body. Warning: This automatically deletes all associated shapes and joints.

RemoveBreakableBody ( BreakableBody breakableBody ) : void
RemoveController ( Controller controller ) : void
RemoveJoint ( Joint joint ) : void

Destroy a joint. This may cause the connected bodies to begin colliding.

Step ( float dt ) : void

Take a time step. This performs collision detection, integration, and consraint solution.

TestPoint ( Vector2 point ) : Fixture
TestPointAll ( Vector2 point ) : List

Returns a list of fixtures that are at the specified point.

World ( Vector2 gravity ) : System

Initializes a new instance of the World class.

비공개 메소드들

메소드 설명
ProcessAddedBodies ( ) : void
ProcessAddedJoints ( ) : void
ProcessRemovedBodies ( ) : void
ProcessRemovedJoints ( ) : void
QueryAABBCallbackWrapper ( int proxyId ) : bool
RayCastCallbackWrapper ( RayCastInput &input, int proxyId ) : float
Solve ( TimeStep &step ) : void
SolveTOI ( TimeStep &step ) : void

Find TOI contacts and solve them.

메소드 상세

AddBody() 공개 메소드

Create a rigid body.
public AddBody ( Body body ) : void
body Body
리턴 void

AddBreakableBody() 공개 메소드

public AddBreakableBody ( BreakableBody breakableBody ) : void
breakableBody BreakableBody
리턴 void

AddController() 공개 메소드

public AddController ( Controller controller ) : void
controller Project290.Physics.Controllers.Controller
리턴 void

AddJoint() 공개 메소드

Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding.
public AddJoint ( Joint joint ) : void
joint Project290.Physics.Dynamics.Joints.Joint The joint.
리턴 void

ClearForces() 공개 메소드

Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps. By default, forces will be automatically cleared, so you don't need to call this function.
public ClearForces ( ) : void
리턴 void

ProcessChanges() 공개 메소드

All adds and removes are cached by the World duing a World step. To process the changes before the world updates again, call this method.
public ProcessChanges ( ) : void
리턴 void

QueryAABB() 공개 메소드

Query the world for all fixtures that potentially overlap the provided AABB.
public QueryAABB ( bool>.Func callback, AABB &aabb ) : void
callback bool>.Func A user implemented callback class.
aabb Project290.Physics.Collision.AABB The aabb query box.
리턴 void

RayCast() 공개 메소드

Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point.
public RayCast ( RayCastCallback callback, Vector2 point1, Vector2 point2 ) : void
callback RayCastCallback A user implemented callback class.
point1 Vector2 The ray starting point.
point2 Vector2 The ray ending point.
리턴 void

RemoveBody() 공개 메소드

Destroy a rigid body. Warning: This automatically deletes all associated shapes and joints.
public RemoveBody ( Body body ) : void
body Body The body.
리턴 void

RemoveBreakableBody() 공개 메소드

public RemoveBreakableBody ( BreakableBody breakableBody ) : void
breakableBody BreakableBody
리턴 void

RemoveController() 공개 메소드

public RemoveController ( Controller controller ) : void
controller Project290.Physics.Controllers.Controller
리턴 void

RemoveJoint() 공개 메소드

Destroy a joint. This may cause the connected bodies to begin colliding.
public RemoveJoint ( Joint joint ) : void
joint Project290.Physics.Dynamics.Joints.Joint The joint.
리턴 void

Step() 공개 메소드

Take a time step. This performs collision detection, integration, and consraint solution.
public Step ( float dt ) : void
dt float The amount of time to simulate, this should not vary.
리턴 void

TestPoint() 공개 메소드

public TestPoint ( Vector2 point ) : Fixture
point Vector2
리턴 Fixture

TestPointAll() 공개 메소드

Returns a list of fixtures that are at the specified point.
public TestPointAll ( Vector2 point ) : List
point Vector2 The point.
리턴 List

World() 공개 메소드

Initializes a new instance of the World class.
public World ( Vector2 gravity ) : System
gravity Vector2 The gravity.
리턴 System

프로퍼티 상세

BodyAdded 공개적으로 프로퍼티

Fires whenever a body has been added
public BodyDelegate BodyAdded
리턴 BodyDelegate

BodyRemoved 공개적으로 프로퍼티

Fires whenever a body has been removed
public BodyDelegate BodyRemoved
리턴 BodyDelegate

Enabled 공개적으로 프로퍼티

If false, the whole simulation stops. It still processes added and removed geometries.
public bool Enabled
리턴 bool

FixtureAdded 공개적으로 프로퍼티

Fires whenever a fixture has been added
public FixtureDelegate FixtureAdded
리턴 FixtureDelegate

FixtureRemoved 공개적으로 프로퍼티

Fires whenever a fixture has been removed
public FixtureDelegate FixtureRemoved
리턴 FixtureDelegate

Gravity 공개적으로 프로퍼티

Change the global gravity vector.
public Vector2 Gravity
리턴 Vector2

Island 공개적으로 프로퍼티

public Island,Project290.Physics.Dynamics Island
리턴 Island

JointAdded 공개적으로 프로퍼티

Fires whenever a joint has been added
public JointDelegate JointAdded
리턴 JointDelegate

JointRemoved 공개적으로 프로퍼티

Fires whenever a joint has been removed
public JointDelegate JointRemoved
리턴 JointDelegate