@ -916,34 +916,34 @@ void Octree<T, use_pairs, AL>::move(OctreeElementID p_id, const AABB &p_aabb) {
|
||||
|
||||
pass++;
|
||||
|
||||
for (typename List<typename Element::OctantOwner, AL>::Element *E = owners.front(); E;) {
|
||||
for (typename List<typename Element::OctantOwner, AL>::Element *F = owners.front(); F;) {
|
||||
|
||||
Octant *o = E->get().octant;
|
||||
typename List<typename Element::OctantOwner, AL>::Element *N = E->next();
|
||||
Octant *o = F->get().octant;
|
||||
typename List<typename Element::OctantOwner, AL>::Element *N = F->next();
|
||||
|
||||
/*
|
||||
if (!use_pairs)
|
||||
o->elements.erase( E->get().E );
|
||||
o->elements.erase( F->get().E );
|
||||
*/
|
||||
|
||||
if (use_pairs && e.pairable)
|
||||
o->pairable_elements.erase(E->get().E);
|
||||
o->pairable_elements.erase(F->get().E);
|
||||
else
|
||||
o->elements.erase(E->get().E);
|
||||
o->elements.erase(F->get().E);
|
||||
|
||||
if (_remove_element_from_octant(&e, o, common_parent->parent)) {
|
||||
|
||||
owners.erase(E);
|
||||
owners.erase(F);
|
||||
}
|
||||
|
||||
E = N;
|
||||
F = N;
|
||||
}
|
||||
|
||||
if (use_pairs) {
|
||||
//unpair child elements in anything that survived
|
||||
for (typename List<typename Element::OctantOwner, AL>::Element *E = owners.front(); E; E = E->next()) {
|
||||
for (typename List<typename Element::OctantOwner, AL>::Element *F = owners.front(); F; F = F->next()) {
|
||||
|
||||
Octant *o = E->get().octant;
|
||||
Octant *o = F->get().octant;
|
||||
|
||||
// erase children pairs, unref ONCE
|
||||
pass++;
|
||||
|
||||
Reference in New Issue
Block a user