mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Remove OctreeElement's UpdateHooks
This commit is contained in:
parent
5ff482071e
commit
cd2e610e17
2 changed files with 0 additions and 37 deletions
|
@ -115,7 +115,6 @@ OctreeElement::~OctreeElement() {
|
|||
|
||||
void OctreeElement::markWithChangedTime() {
|
||||
_lastChanged = usecTimestampNow();
|
||||
notifyUpdateHooks(); // if the node has changed, notify our hooks
|
||||
}
|
||||
|
||||
// This method is called by Octree when the subtree below this node
|
||||
|
@ -551,28 +550,6 @@ void OctreeElement::notifyDeleteHooks() {
|
|||
_deleteHooksNotified = true;
|
||||
}
|
||||
|
||||
std::vector<OctreeElementUpdateHook*> OctreeElement::_updateHooks;
|
||||
|
||||
void OctreeElement::addUpdateHook(OctreeElementUpdateHook* hook) {
|
||||
_updateHooks.push_back(hook);
|
||||
}
|
||||
|
||||
void OctreeElement::removeUpdateHook(OctreeElementUpdateHook* hook) {
|
||||
for (unsigned int i = 0; i < _updateHooks.size(); i++) {
|
||||
if (_updateHooks[i] == hook) {
|
||||
_updateHooks.erase(_updateHooks.begin() + i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OctreeElement::notifyUpdateHooks() {
|
||||
for (unsigned int i = 0; i < _updateHooks.size(); i++) {
|
||||
_updateHooks[i]->elementUpdated(shared_from_this());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool OctreeElement::findSpherePenetration(const glm::vec3& center, float radius,
|
||||
glm::vec3& penetration, void** penetratedObject) const {
|
||||
// center and radius are in meters, so we have to scale the _cube into world-frame
|
||||
|
|
|
@ -48,13 +48,6 @@ public:
|
|||
virtual void elementDeleted(OctreeElementPointer element) = 0;
|
||||
};
|
||||
|
||||
// Callers who want update hook callbacks should implement this class
|
||||
class OctreeElementUpdateHook {
|
||||
public:
|
||||
virtual void elementUpdated(OctreeElementPointer element) = 0;
|
||||
};
|
||||
|
||||
|
||||
class OctreeElement: public std::enable_shared_from_this<OctreeElement> {
|
||||
|
||||
protected:
|
||||
|
@ -184,9 +177,6 @@ public:
|
|||
static void addDeleteHook(OctreeElementDeleteHook* hook);
|
||||
static void removeDeleteHook(OctreeElementDeleteHook* hook);
|
||||
|
||||
static void addUpdateHook(OctreeElementUpdateHook* hook);
|
||||
static void removeUpdateHook(OctreeElementUpdateHook* hook);
|
||||
|
||||
static void resetPopulationStatistics();
|
||||
static unsigned long getNodeCount() { return _voxelNodeCount; }
|
||||
static unsigned long getInternalNodeCount() { return _voxelNodeCount - _voxelNodeLeafCount; }
|
||||
|
@ -245,7 +235,6 @@ protected:
|
|||
|
||||
void calculateAACube();
|
||||
void notifyDeleteHooks();
|
||||
void notifyUpdateHooks();
|
||||
|
||||
AACube _cube; /// Client and server, axis aligned box for bounds of this voxel, 48 bytes
|
||||
|
||||
|
@ -292,9 +281,6 @@ protected:
|
|||
static QReadWriteLock _deleteHooksLock;
|
||||
static std::vector<OctreeElementDeleteHook*> _deleteHooks;
|
||||
|
||||
//static QReadWriteLock _updateHooksLock;
|
||||
static std::vector<OctreeElementUpdateHook*> _updateHooks;
|
||||
|
||||
static AtomicUIntStat _voxelNodeCount;
|
||||
static AtomicUIntStat _voxelNodeLeafCount;
|
||||
|
||||
|
|
Loading…
Reference in a new issue