mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 05:30:10 +02:00
Merge pull request #15651 from AndrewMeadows/fix-crash-bugz414
BUGZ-414: crash fix and don't add local entities to physics simulation
This commit is contained in:
commit
fda9aa00da
3 changed files with 4 additions and 2 deletions
|
@ -744,7 +744,7 @@ bool RenderableModelEntityItem::shouldBePhysical() const {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return !isDead() && shapeType != SHAPE_TYPE_NONE && QUrl(_modelURL).isValid();
|
||||
return !isDead() && shapeType != SHAPE_TYPE_NONE && !isLocalEntity() && QUrl(_modelURL).isValid();
|
||||
}
|
||||
|
||||
int RenderableModelEntityItem::getJointParent(int index) const {
|
||||
|
|
|
@ -324,7 +324,7 @@ public:
|
|||
bool getDynamic() const;
|
||||
void setDynamic(bool value);
|
||||
|
||||
virtual bool shouldBePhysical() const { return !isDead() && getShapeType() != SHAPE_TYPE_NONE; }
|
||||
virtual bool shouldBePhysical() const { return !isDead() && getShapeType() != SHAPE_TYPE_NONE && !isLocalEntity(); }
|
||||
bool isVisuallyReady() const { return _visuallyReady; }
|
||||
|
||||
bool getLocked() const;
|
||||
|
|
|
@ -460,6 +460,8 @@ void PhysicalEntitySimulation::buildPhysicsTransaction(PhysicsEngine::Transactio
|
|||
void PhysicalEntitySimulation::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction) {
|
||||
// things on objectsToRemove are ready for delete
|
||||
for (auto object : transaction.objectsToRemove) {
|
||||
EntityMotionState* entityState = static_cast<EntityMotionState*>(object);
|
||||
removeOwnershipData(entityState);
|
||||
_physicalObjects.remove(object);
|
||||
delete object;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue