mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:49:33 +02:00
various particle crash and deadlock fixes
This commit is contained in:
parent
0285fe51e8
commit
fd47602945
4 changed files with 4 additions and 7 deletions
|
@ -33,10 +33,7 @@ void ParticleTreeRenderer::init() {
|
||||||
void ParticleTreeRenderer::update() {
|
void ParticleTreeRenderer::update() {
|
||||||
if (_tree) {
|
if (_tree) {
|
||||||
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
|
ParticleTree* tree = static_cast<ParticleTree*>(_tree);
|
||||||
if (tree->tryLockForWrite()) {
|
tree->update();
|
||||||
tree->update();
|
|
||||||
tree->unlock();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -739,7 +739,7 @@ void OctreeElement::setChildAtIndex(int childIndex, OctreeElement* child) {
|
||||||
_externalChildrenMemoryUsage += NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
|
_externalChildrenMemoryUsage += NUMBER_OF_CHILDREN * sizeof(OctreeElement*);
|
||||||
|
|
||||||
} else if (previousChildCount == 2 && newChildCount == 1) {
|
} else if (previousChildCount == 2 && newChildCount == 1) {
|
||||||
assert(child); // we are removing a child, so this must be true!
|
assert(!child); // we are removing a child, so this must be true!
|
||||||
OctreeElement* previousFirstChild = _children.external[firstIndex];
|
OctreeElement* previousFirstChild = _children.external[firstIndex];
|
||||||
OctreeElement* previousSecondChild = _children.external[secondIndex];
|
OctreeElement* previousSecondChild = _children.external[secondIndex];
|
||||||
delete[] _children.external;
|
delete[] _children.external;
|
||||||
|
|
|
@ -487,7 +487,9 @@ void ParticleTree::update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// prune the tree...
|
// prune the tree...
|
||||||
|
lockForWrite();
|
||||||
recurseTreeWithOperation(pruneOperation, NULL);
|
recurseTreeWithOperation(pruneOperation, NULL);
|
||||||
|
unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,12 +30,10 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
/// inbound slots for external collision systems
|
/// inbound slots for external collision systems
|
||||||
void forwardParticleCollisionWithVoxel(const ParticleID& particleID, const VoxelDetail& voxel) {
|
void forwardParticleCollisionWithVoxel(const ParticleID& particleID, const VoxelDetail& voxel) {
|
||||||
qDebug() << "forwardParticleCollisionWithVoxel()";
|
|
||||||
emit particleCollisionWithVoxel(particleID, voxel);
|
emit particleCollisionWithVoxel(particleID, voxel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void forwardParticleCollisionWithParticle(const ParticleID& idA, const ParticleID& idB) {
|
void forwardParticleCollisionWithParticle(const ParticleID& idA, const ParticleID& idB) {
|
||||||
qDebug() << "forwardParticleCollisionWithParticle()";
|
|
||||||
emit particleCollisionWithParticle(idA, idB);
|
emit particleCollisionWithParticle(idA, idB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue