메소드 | 설명 | |
---|---|---|
AddController ( Controllers def ) : |
||
CreateBody ( |
Create a rigid body given a definition. No reference to the definition is retained. @warning This function is locked during callbacks.
|
|
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.
|
|
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.
|
|
DestroyJoint ( |
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 ( ) : |
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 ( ) : |
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 ( ) : |
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 ( |
||
Query ( |
||
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 ( |
||
DrawShape ( |
||
RaycastSortKey ( object data ) : float | ||
Solve ( TimeStep step ) : void | ||
SolveTOI ( TimeStep step ) : void |
public AddController ( Controllers def ) : |
||
def | Controllers | |
리턴 |
public Query ( |
||
aabb | ||
shapes | ||
maxCount | int | |
리턴 | int |
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 |
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 |
public RemoveController ( Controllers controller ) : void | ||
controller | Controllers | |
리턴 | void |
public SetBoundaryListener ( BoundaryListener listener ) : void | ||
listener | BoundaryListener | |
리턴 | void |
public SetContactFilter ( ContactFilter filter ) : void | ||
filter | ContactFilter | |
리턴 | void |
public SetContactListener ( ContactListener listener ) : void | ||
listener | ContactListener | |
리턴 | void |
public SetDebugDraw ( DebugDraw debugDraw ) : void | ||
debugDraw | DebugDraw | |
리턴 | void |
public SetDestructionListener ( DestructionListener listener ) : void | ||
listener | DestructionListener | |
리턴 | void |
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 |
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 |