C# 클래스 Box2DX.Dynamics.World

The world class manages all physics entities, dynamic simulation, and asynchronous queries.
상속: IDisposable
파일 보기 프로젝트 열기: danielpcox/Crisis-at-Swiss-Station 1 사용 예제들

공개 메소드들

메소드 설명
AddController ( Controllers def ) : Controller
CreateBody ( BodyDef def ) : Body

Create a rigid body given a definition. No reference to the definition is retained. @warning This function is locked during callbacks.

CreateJoint ( JointDef def ) : Joint

Create a joint to constrain bodies together. No reference to the definition is retained. This may cause the connected bodies to cease colliding. @warning This function is locked during callbacks.

DestroyBody ( Body b ) : void

Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during callbacks. @warning This automatically deletes all associated shapes and joints. @warning This function is locked during callbacks.

DestroyJoint ( Joint j ) : void

Destroy a joint. This may cause the connected bodies to begin colliding. @warning This function is locked during callbacks.

Dispose ( ) : void

Destruct the world. All physics entities are destroyed.

GetBodyCount ( ) : int

Get the number of bodies.

GetBodyList ( ) : Body

Get the world body list. With the returned body, use Body.GetNext to get the next body in the world list. A null body indicates the end of the list.

GetContactCount ( ) : int

Get the number of contacts (each may have 0 or more contact points).

GetGroundBody ( ) : Body

The world provides a single static ground body with no collision shapes. You can use this to simplify the creation of joints and static shapes.

GetJointCount ( ) : int

Get the number joints.

GetJointList ( ) : Joint

Get the world joint list. With the returned joint, use Joint.GetNext to get the next joint in the world list. A null joint indicates the end of the list.

GetPairCount ( ) : int

Get the number of broad-phase pairs.

GetProxyCount ( ) : int

Get the number of broad-phase proxies.

InRange ( AABB aabb ) : bool
Query ( AABB aabb, Shape shapes, int maxCount ) : int
Raycast ( Segment segment, Shape shapes, int maxCount, bool solidShapes, object userData ) : int

Query the world for all shapes that intersect a given segment. You provide a shap pointer buffer of specified size. The number of shapes found is returned, and the buffer is filled in order of intersection.

RaycastOne ( Segment segment, float &lambda, Vec2 &normal, bool solidShapes, object userData ) : Shape

Performs a raycast as with Raycast, finding the first intersecting shape.

Refilter ( Shape shape ) : void

Re-filter a shape. This re-runs contact filtering on a shape.

RemoveController ( Controllers controller ) : void
SetBoundaryListener ( BoundaryListener listener ) : void

Register a broad-phase boundary listener.

SetContactFilter ( ContactFilter filter ) : void

Register a contact filter to provide specific control over collision. Otherwise the default filter is used (b2_defaultFilter).

SetContactListener ( ContactListener listener ) : void

Register a contact event listener

SetContinuousPhysics ( bool flag ) : void

Enable/disable continuous physics. For testing.

SetDebugDraw ( DebugDraw debugDraw ) : void

Register a routine for debug drawing. The debug draw functions are called inside the World.Step method, so make sure your renderer is ready to consume draw commands when you call Step().

SetDestructionListener ( DestructionListener listener ) : void

Register a destruction listener.

SetWarmStarting ( bool flag ) : void

Enable/disable warm starting. For testing.

Step ( float dt, int velocityIterations, int positionIteration ) : void

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

Validate ( ) : void

Perform validation of internal data structures.

World ( AABB worldAABB, Vec2 gravity, bool doSleep ) : System

Construct a world object.

비공개 메소드들

메소드 설명
DrawDebugData ( ) : void
DrawJoint ( Joint joint ) : void
DrawShape ( Shape shape, XForm xf, Color color, bool core ) : void
RaycastSortKey ( object data ) : float
Solve ( TimeStep step ) : void
SolveTOI ( TimeStep step ) : void

메소드 상세

AddController() 공개 메소드

public AddController ( Controllers def ) : Controller
def Controllers
리턴 Box2DX.Dynamics.Controllers.Controller

CreateBody() 공개 메소드

Create a rigid body given a definition. No reference to the definition is retained. @warning This function is locked during callbacks.
public CreateBody ( BodyDef def ) : Body
def BodyDef
리턴 Body

CreateJoint() 공개 메소드

Create a joint to constrain bodies together. No reference to the definition is retained. This may cause the connected bodies to cease colliding. @warning This function is locked during callbacks.
public CreateJoint ( JointDef def ) : Joint
def JointDef
리턴 Joint

DestroyBody() 공개 메소드

Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during callbacks. @warning This automatically deletes all associated shapes and joints. @warning This function is locked during callbacks.
public DestroyBody ( Body b ) : void
b Body
리턴 void

DestroyJoint() 공개 메소드

Destroy a joint. This may cause the connected bodies to begin colliding. @warning This function is locked during callbacks.
public DestroyJoint ( Joint j ) : void
j Joint
리턴 void

Dispose() 공개 메소드

Destruct the world. All physics entities are destroyed.
public Dispose ( ) : void
리턴 void

GetBodyCount() 공개 메소드

Get the number of bodies.
public GetBodyCount ( ) : int
리턴 int

GetBodyList() 공개 메소드

Get the world body list. With the returned body, use Body.GetNext to get the next body in the world list. A null body indicates the end of the list.
public GetBodyList ( ) : Body
리턴 Body

GetContactCount() 공개 메소드

Get the number of contacts (each may have 0 or more contact points).
public GetContactCount ( ) : int
리턴 int

GetGroundBody() 공개 메소드

The world provides a single static ground body with no collision shapes. You can use this to simplify the creation of joints and static shapes.
public GetGroundBody ( ) : Body
리턴 Body

GetJointCount() 공개 메소드

Get the number joints.
public GetJointCount ( ) : int
리턴 int

GetJointList() 공개 메소드

Get the world joint list. With the returned joint, use Joint.GetNext to get the next joint in the world list. A null joint indicates the end of the list.
public GetJointList ( ) : Joint
리턴 Joint

GetPairCount() 공개 메소드

Get the number of broad-phase pairs.
public GetPairCount ( ) : int
리턴 int

GetProxyCount() 공개 메소드

Get the number of broad-phase proxies.
public GetProxyCount ( ) : int
리턴 int

InRange() 공개 메소드

public InRange ( AABB aabb ) : bool
aabb Box2DX.Collision.AABB
리턴 bool

Query() 공개 메소드

public Query ( AABB aabb, Shape shapes, int maxCount ) : int
aabb Box2DX.Collision.AABB
shapes Box2DX.Collision.Shape
maxCount int
리턴 int

Raycast() 공개 메소드

Query the world for all shapes that intersect a given segment. You provide a shap pointer buffer of specified size. The number of shapes found is returned, and the buffer is filled in order of intersection.
public Raycast ( Segment segment, Shape shapes, int maxCount, bool solidShapes, object userData ) : int
segment Segment Defines the begin and end point of the ray cast, from p1 to p2. /// Use Segment.Extend to create (semi-)infinite rays.
shapes Shape A user allocated shape pointer array of size maxCount (or greater).
maxCount int The capacity of the shapes array.
solidShapes bool Determines if shapes that the ray starts in are counted as hits.
userData object Passed through the worlds contact filter, with method RayCollide. This can be used to filter valid shapes.
리턴 int

RaycastOne() 공개 메소드

Performs a raycast as with Raycast, finding the first intersecting shape.
public RaycastOne ( Segment segment, float &lambda, Vec2 &normal, bool solidShapes, object userData ) : Shape
segment Segment Defines the begin and end point of the ray cast, from p1 to p2. /// Use Segment.Extend to create (semi-)infinite rays.
lambda float Returns the hit fraction. You can use this to compute the contact point /// p = (1 - lambda) * segment.p1 + lambda * segment.p2.
normal Vec2 Returns the normal at the contact point. If there is no intersection, the normal is not set.
solidShapes bool Determines if shapes that the ray starts in are counted as hits.
userData object
리턴 Shape

Refilter() 공개 메소드

Re-filter a shape. This re-runs contact filtering on a shape.
public Refilter ( Shape shape ) : void
shape Shape
리턴 void

RemoveController() 공개 메소드

public RemoveController ( Controllers controller ) : void
controller Controllers
리턴 void

SetBoundaryListener() 공개 메소드

Register a broad-phase boundary listener.
public SetBoundaryListener ( BoundaryListener listener ) : void
listener BoundaryListener
리턴 void

SetContactFilter() 공개 메소드

Register a contact filter to provide specific control over collision. Otherwise the default filter is used (b2_defaultFilter).
public SetContactFilter ( ContactFilter filter ) : void
filter ContactFilter
리턴 void

SetContactListener() 공개 메소드

Register a contact event listener
public SetContactListener ( ContactListener listener ) : void
listener ContactListener
리턴 void

SetContinuousPhysics() 공개 메소드

Enable/disable continuous physics. For testing.
public SetContinuousPhysics ( bool flag ) : void
flag bool
리턴 void

SetDebugDraw() 공개 메소드

Register a routine for debug drawing. The debug draw functions are called inside the World.Step method, so make sure your renderer is ready to consume draw commands when you call Step().
public SetDebugDraw ( DebugDraw debugDraw ) : void
debugDraw DebugDraw
리턴 void

SetDestructionListener() 공개 메소드

Register a destruction listener.
public SetDestructionListener ( DestructionListener listener ) : void
listener DestructionListener
리턴 void

SetWarmStarting() 공개 메소드

Enable/disable warm starting. For testing.
public SetWarmStarting ( bool flag ) : void
flag bool
리턴 void

Step() 공개 메소드

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

Validate() 공개 메소드

Perform validation of internal data structures.
public Validate ( ) : void
리턴 void

World() 공개 메소드

Construct a world object.
public World ( AABB worldAABB, Vec2 gravity, bool doSleep ) : System
worldAABB AABB A bounding box that completely encompasses all your shapes.
gravity Vec2 The world gravity vector.
doSleep bool Improve performance by not simulating inactive bodies.
리턴 System