fix memory issues in btSparseSDF.h
(hash function on structure with uninitialized padding, and Reset not called in destructor) expose sparseSdfVoxelSize in PyBullet.setPhysicsEngineParameter don't call deformable wireframe drawing in the wrong thread/place (it can cause crashes)
This commit is contained in:
@@ -382,6 +382,8 @@ void btDeformableMultiBodyDynamicsWorld::reinitialize(btScalar timeStep)
|
||||
void btDeformableMultiBodyDynamicsWorld::debugDrawWorld()
|
||||
{
|
||||
|
||||
btMultiBodyDynamicsWorld::debugDrawWorld();
|
||||
|
||||
for (int i = 0; i < getSoftBodyArray().size(); i++)
|
||||
{
|
||||
btSoftBody* psb = (btSoftBody*)getSoftBodyArray()[i];
|
||||
@@ -391,7 +393,7 @@ void btDeformableMultiBodyDynamicsWorld::debugDrawWorld()
|
||||
}
|
||||
}
|
||||
|
||||
btMultiBodyDynamicsWorld::debugDrawWorld();
|
||||
|
||||
}
|
||||
|
||||
void btDeformableMultiBodyDynamicsWorld::applyRigidBodyGravity(btScalar timeStep)
|
||||
|
||||
@@ -77,6 +77,10 @@ struct btSparseSdf
|
||||
int nprobes;
|
||||
int nqueries;
|
||||
|
||||
~btSparseSdf()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
//
|
||||
// Methods
|
||||
//
|
||||
@@ -330,15 +334,18 @@ struct btSparseSdf
|
||||
{
|
||||
struct btS
|
||||
{
|
||||
int x, y, z;
|
||||
int x, y, z, w;
|
||||
void* p;
|
||||
};
|
||||
|
||||
btS myset;
|
||||
//memset may be needed in case of additional (uninitialized) padding!
|
||||
//memset(myset, 0, sizeof(btS));
|
||||
|
||||
myset.x = x;
|
||||
myset.y = y;
|
||||
myset.z = z;
|
||||
myset.w = 0;
|
||||
myset.p = (void*)shape;
|
||||
const void* ptr = &myset;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user