mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Use Box2D's callbacks for destruction of physics objects and wait until the end of the timestep before destroying them.
Merge of box2d-id2 from love-experiments
This commit is contained in:
@@ -78,6 +78,12 @@ namespace box2d
|
||||
|
||||
virtual ~Joint();
|
||||
|
||||
/**
|
||||
* Returns true if the joint is active in a Box2D world.
|
||||
**/
|
||||
bool isValid() const;
|
||||
|
||||
|
||||
/**
|
||||
* Gets the type of joint.
|
||||
**/
|
||||
@@ -103,25 +109,27 @@ namespace box2d
|
||||
|
||||
bool getCollideConnected() const;
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Joints require pointers to a Box2D joint objects at
|
||||
* different polymorphic levels, which is why these function
|
||||
* were created.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Destroys the joint. This function was created just to
|
||||
* get some cinsistency.
|
||||
**/
|
||||
void destroyJoint(bool implicit = false);
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Creates a Joint, and ensures that the parent class
|
||||
* gets a copy of the pointer.
|
||||
**/
|
||||
b2Joint * createJoint(b2JointDef * def);
|
||||
|
||||
/**
|
||||
* Destroys the joint. This function was created just to
|
||||
* get some cinsistency.
|
||||
**/
|
||||
void destroyJoint(b2Joint * joint);
|
||||
|
||||
};
|
||||
|
||||
} // box2d
|
||||
|
||||
Reference in New Issue
Block a user