12 #ifndef hifi_MovingEntitiesOperator_h
13 #define hifi_MovingEntitiesOperator_h
17 #include "EntityItem.h"
19 class EntityToMoveDetails {
21 EntityItemPointer entity;
25 EntityTreeElementPointer oldContainingElement;
26 AACube oldContainingElementCube;
31 inline uint qHash(
const EntityToMoveDetails& a, uint seed) {
32 return qHash(a.entity->getEntityItemID(), seed);
35 inline bool operator==(
const EntityToMoveDetails& a,
const EntityToMoveDetails& b) {
36 return a.entity->getEntityItemID() == b.entity->getEntityItemID();
41 MovingEntitiesOperator();
42 ~MovingEntitiesOperator();
44 void addEntityToMoveList(EntityItemPointer entity,
const AACube& newCube);
45 virtual bool preRecursion(
const OctreeElementPointer& element)
override;
46 virtual bool postRecursion(
const OctreeElementPointer& element)
override;
47 virtual OctreeElementPointer possiblyCreateChildAt(
const OctreeElementPointer& element,
int childIndex)
override;
48 bool hasMovingEntities()
const {
return _entitiesToMove.size() > 0; }
51 bool shouldRecurseSubTree(
const OctreeElementPointer& element);
53 QSet<EntityToMoveDetails> _entitiesToMove;
54 int _foundOldCount { 0 };
55 int _foundNewCount { 0 };
56 int _lookingCount { 0 };
57 bool _wantDebug {
false };
derive from this class to use the Octree::recurseTreeWithOperator() method
Definition: Octree.h:43