added notes on experimental new replacement for addOrUpdateEntity()

This commit is contained in:
ZappoMan 2014-07-30 07:19:59 -07:00
parent 76ae4c9721
commit dd3d4be73b
2 changed files with 30 additions and 0 deletions

View file

@ -331,6 +331,33 @@ bool UpdateEntityOperator::PreRecursion(OctreeElement* element) {
// If this element is the best fit for the new entity properties, then add/or update it
if (entityTreeElement->bestFitBounds(_newEntityCube)) {
/*********
//
//
// LOOK AT THIS NEXT... this is crashing... the old code was working.... but this is not...
//
//
//
// if we are the existing containing element, then we can just do the update of the entity properties
if (entityTreeElement == _containingElement) {
assert(!_removeOld); // We shouldn't be in a remove old case and also be the new best fit
// set the entity properties and mark our element as changed.
_existingEntity->setProperties(_properties);
entityTreeElement->markWithChangedTime();
} else {
// otherwise, this is an add case.
entityTreeElement->addEntityItem(_existingEntity);
_existingEntity->setProperties(_properties); // still need to update the properties!
entityTreeElement->markWithChangedTime();
_tree->setContainingElement(_entityItemID, entityTreeElement);
}
*************/
if (entityTreeElement->addOrUpdateEntity(_existingEntity, _properties)) {
//qDebug() << "UpdateEntityOperator::PreRecursion()... entity was updated!";

View file

@ -401,6 +401,9 @@ bool EntityTreeElement::findSpherePenetration(const glm::vec3& center, float rad
// TODO... how do we handle older/newer with this interface?
// Look at getting rid of this, and moving this logic to Entity Tree
// AND/OR remove the O(n) lookup for the entity since we know it should already exist in this
// element list.
bool EntityTreeElement::addOrUpdateEntity(EntityItem* entity, const EntityItemProperties& properties) {
const bool wantDebug = false;
if (wantDebug) {