Пример #1
0
void OctreeQueryNode::dumpOutOfView() {
    // if shutting down, return immediately
    if (_isShuttingDown) {
        return;
    }
    
    int stillInView = 0;
    int outOfView = 0;
    OctreeElementBag tempBag;
    while (!nodeBag.isEmpty()) {
        OctreeElement* node = nodeBag.extract();
        if (node->isInView(_currentViewFrustum)) {
            tempBag.insert(node);
            stillInView++;
        } else {
            outOfView++;
        }
    }
    if (stillInView > 0) {
        while (!tempBag.isEmpty()) {
            OctreeElement* node = tempBag.extract();
            if (node->isInView(_currentViewFrustum)) {
                nodeBag.insert(node);
            }
        }
    }
}
Пример #2
0
void OctreeQueryNode::dumpOutOfView() {
    // if shutting down, return immediately
    if (_isShuttingDown) {
        return;
    }

    int stillInView = 0;
    int outOfView = 0;
    OctreeElementBag tempBag;
    ViewFrustum viewCopy;
    copyCurrentViewFrustum(viewCopy);
    while (OctreeElementPointer elementToCheck = elementBag.extract()) {
        if (elementToCheck->isInView(viewCopy)) {
            tempBag.insert(elementToCheck);
            stillInView++;
        } else {
            outOfView++;
        }
    }
    if (stillInView > 0) {
        while (OctreeElementPointer elementToKeepInBag = tempBag.extract()) {
            if (elementToKeepInBag->isInView(viewCopy)) {
                elementBag.insert(elementToKeepInBag);
            }
        }
    }
}