Home | Trees | Indices | Help |
|
---|
|
The world class manages all physics entities, dynamic simulation, and asynchronous queries. The world also contains efficient memory management facilities.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
thisown The membership flag |
|||
gravity GetGravity(self) -> b2Vec2 |
|||
jointList Get a list of the joints in this world |
|||
bodyList Get a list of the bodies in this world |
|||
groundBody GetGroundBody(self) -> b2Body |
|||
worldAABB GetWorldAABB(self) -> b2AABB |
|||
doSleep CanSleep(self) -> bool |
|||
controllerList Get a list of the controllers in this world |
|
__init__(self, b2AABB worldAABB, b2Vec2 gravity, bool doSleep) -> b2World Construct a world object. Parameters: ----------- worldAABB: a bounding box that completely encompasses all your shapes. gravity: the world gravity vector. doSleep: improve performance by not simulating inactive bodies.
|
delete_b2World(b2World self) Destruct the world. All physics entities are destroyed and all heap memory is released. |
|
b2World_SetDestructionListener(b2World self, b2DestructionListener listener) Register a destruction listener. |
b2World_SetBoundaryListener(b2World self, b2BoundaryListener listener) Register a broad-phase boundary listener. |
b2World_SetContactFilter(b2World self, b2ContactFilter filter) Register a contact filter to provide specific control over collision. Otherwise the default filter is used (b2_defaultFilter). |
b2World_SetContactListener(b2World self, b2ContactListener listener) Register a contact event listener. |
b2World_SetDebugDraw(b2World self, b2DebugDraw debugDraw) Register a routine for debug drawing. The debug draw functions are called inside the b2World::Stepmethod, so make sure your renderer is ready to consume draw commands when you call Step(). |
b2World_CreateController(b2World self, b2ControllerDef _def) -> b2Controller Add a controller to the world. |
b2World_DestroyController(b2World self, b2Controller controller) Removes a controller from the world. |
b2World_GetGroundBody(b2World self) -> b2Body 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. |
b2World_Step(b2World self, float32 timeStep, int32 velocityIterations, int32 positionIterations) Take a time step. This performs collision detection, integration, and constraint solution. Parameters: ----------- timeStep: the amount of time to simulate, this should not vary. velocityIterations: for the velocity constraint solver. positionIterations: for the position constraint solver. |
b2World_InRange(b2World self, b2AABB aabb) -> bool Check if the AABB is within the broadphase limits. |
b2World__GetBodyList(b2World self) -> b2Body Get the world body list. With the returned body, use b2Body::GetNextto get the next body in the world list. A NULL body indicates the end of the list. the head of the world body list. |
b2World__GetJointList(b2World self) -> b2Joint Get the world joint list. With the returned joint, use b2Joint::GetNextto get the next joint in the world list. A NULL joint indicates the end of the list. the head of the world joint list. |
b2World__GetControllerList(b2World self) -> b2Controller Get the world controller list. With the returned controller, use b2Controller::GetNextto get the next controller in the world list. A NULL controller indicates the end of the list. the head of the world controller list. |
b2World_Refilter(b2World self, b2Shape shape) Re-filter a shape. This re-runs contact filtering on a shape. |
b2World_SetWarmStarting(b2World self, bool flag) Enable/disable warm starting. For testing. |
b2World_SetContinuousPhysics(b2World self, bool flag) Enable/disable continuous physics. For testing. |
b2World_Validate(b2World self) Perform validation of internal data structures. |
b2World_GetProxyCount(b2World self) -> int32 Get the number of broad-phase proxies. |
b2World_GetPairCount(b2World self) -> int32 Get the number of broad-phase pairs. |
b2World_GetBodyCount(b2World self) -> int32 Get the number of bodies. |
b2World_GetJointCount(b2World self) -> int32 Get the number of joints. |
b2World_GetContactCount(b2World self) -> int32 Get the number of contacts (each may have 0 or more contact points). |
b2World_GetControllerCount(b2World self) -> int32 Get the number of controllers. |
b2World_SetGravity(b2World self, b2Vec2 gravity) Change the global gravity vector. |
b2World_GetGravity(b2World self) -> b2Vec2 Get the global gravity vector. |
b2World_GetWorldAABB(b2World self) -> b2AABB Get the world's AABB. |
b2World_CanSleep(b2World self) -> bool Whether or not bodies can sleep. |
b2World_CreateBody(b2World self, b2BodyDef defn) -> b2Body Create a rigid body given a definition. No reference to the definition is retained. WARNING: This function is locked during callbacks. |
b2World_CreateJoint(b2World self, b2JointDef defn) -> b2Joint 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. |
b2World_DestroyBody(b2World self, b2Body body) 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. This function is locked during callbacks. |
b2World_DestroyJoint(b2World self, b2Joint joint) Destroy a joint. This may cause the connected bodies to begin colliding. WARNING: This function is locked during callbacks. |
Raycast(b2Segment segment, b2Shape shapes, int32 maxCount, bool solidShapes, void $ignore) -> int32 b2World_Raycast(b2World self, b2Segment segment, int32 maxCount, bool solidShapes, PyObject $ignore) -> PyObject Query the world for all shapes that intersect a given segment. You provide a shape pointer buffer of specified size. The number of shapes found is returned, and the buffer is filled in order of intersection Parameters: ----------- segment: defines the begin and end point of the ray cast, from p1 to p2. Use b2Segment.Extend to create (semi-)infinite rays shapes: a user allocated shape pointer array of size maxCount (or greater). maxCount: the capacity of the shapes array solidShapes: determines if shapes that the ray starts in are counted as hits. userData: passed through the worlds contact filter, with method RayCollide. This can be used to filter valid shapes the number of shapes found |
RaycastOne(b2Segment segment, float32 _lambda, b2Vec2 normal, bool solidShapes, void $ignore) -> b2Shape b2World_RaycastOne(b2World self, b2Segment segment, bool solidShapes, PyObject $ignore) -> PyObject Performs a raycast as with Raycast, finding the first intersecting shape. Parameters: ----------- segment: defines the begin and end point of the ray cast, from p1 to p2. Use b2Segment.Extend to create (semi-)infinite rays lambda: returns the hit fraction. You can use this to compute the contact point p = (1 - lambda) * segment.p1 + lambda * segment.p2. normal: returns the normal at the contact point. If there is no intersection, the normal is not set. solidShapes: determines if shapes that the ray starts in are counted as hits. the colliding shape shape, or null if not found |
Query(b2AABB aabb, b2Shape shapes, int32 maxCount) -> int32 b2World_Query(b2World self, b2AABB aabb, uint32 maxCount) -> PyObject Query the world for all shapes that potentially overlap the provided AABB. You provide a shape pointer buffer of specified size. The number of shapes found is returned. Parameters: ----------- aabb: the query box. shapes: a user allocated shape pointer array of size maxCount (or greater). maxCount: the capacity of the shapes array. the number of shapes found in aabb. |
|
thisownThe membership flag |
gravityGetGravity(self) -> b2Vec2 Get the global gravity vector. |
jointListGet a list of the joints in this world
|
bodyListGet a list of the bodies in this world
|
groundBodyGetGroundBody(self) -> b2Body 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. |
worldAABBGetWorldAABB(self) -> b2AABB Get the world's AABB. |
doSleepCanSleep(self) -> bool Whether or not bodies can sleep. |
controllerListGet a list of the controllers in this world
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Feb 24 18:39:59 2009 | http://epydoc.sourceforge.net |