delete moving entities that travel outside of domain

This commit is contained in:
ZappoMan 2014-08-28 21:34:12 -07:00
parent 2bcad6ab2b
commit ad9ce2edd3
3 changed files with 26 additions and 17 deletions

View file

@ -2835,7 +2835,6 @@ function handeMenuEvent(menuItem) {
}
array.push({ button: "Cancel" });
var propertyName = Window.form("Edit Properties", array);
if (Window.form("Edit Properties", array)) {
var index = 0;
if (properties.type == "Model") {

View file

@ -769,6 +769,15 @@ void EntityTree::updateMovingEntities(quint64 now, QSet<EntityItemID>& entitiesT
thisEntity->update(now);
AACube newCube = thisEntity->getAACube();
// check to see if this movement has sent the entity outside of the domain.
AACube domainBounds(glm::vec3(0.0f,0.0f,0.0f), 1.0f);
if (!domainBounds.touches(newCube)) {
if (wantDebug) {
qDebug() << "The entity " << thisEntity->getEntityItemID() << " moved outside of the domain. Delete it.";
}
entitiesToDelete << thisEntity->getEntityItemID();
entitiesBecomingStatic << thisEntity;
} else {
if (wantDebug) {
qDebug() << "EntityTree::update() thisEntity=" << thisEntity;
qDebug() << " oldCube=" << oldCube;
@ -788,6 +797,7 @@ void EntityTree::updateMovingEntities(quint64 now, QSet<EntityItemID>& entitiesT
}
}
}
}
recurseTreeWithOperator(&moveOperator);
// change state for any entities that were moving but are now either static, mortal, or changing

View file

@ -1,6 +1,5 @@
// REQUIRED:
3) if velocity sends a model out of the domain - delete it
4) Test file save load for case where two siblings have more than MTU amount of data. I wonder if the fact that file save
doesn't include the extra exists bits will break something.
@ -248,6 +247,7 @@
// SOLVED -- 42) Crash in delete model - deleting the geometry...
// SOLVED -- 43) Moving models don't always move.. I think this relates to the render optimization...
// need to make sure we re-simulate when a model is moving...
// SOLVED -- 44) if velocity sends a model out of the domain - delete it