Ejemplo n.º 1
0
void EntityTreeRenderer::clear() {
    leaveAllEntities();
    foreach (const EntityItemID& entityID, _entityScripts.keys()) {
        checkAndCallUnload(entityID);
    }
    OctreeRenderer::clear();
    _entityScripts.clear();
}
Ejemplo n.º 2
0
void EntityTreeRenderer::clear() {
    leaveAllEntities();
    _entitiesScriptEngine->unloadAllEntityScripts();

    auto scene = _viewState->getMain3DScene();
    render::PendingChanges pendingChanges;
    foreach(auto entity, _entitiesInScene) {
        entity->removeFromScene(entity, scene, pendingChanges);
    }
Ejemplo n.º 3
0
void EntityTreeRenderer::clear() {
    leaveAllEntities();

    if (_entitiesScriptEngine) {
        // Unload and stop the engine here (instead of in its deleter) to
        // avoid marshalling unload signals back to this thread
        _entitiesScriptEngine->unloadAllEntityScripts();
        _entitiesScriptEngine->stop();
    }

    if (_wantScripts && !_shuttingDown) {
        resetEntitiesScriptEngine();
    }

    auto scene = _viewState->getMain3DScene();
    render::PendingChanges pendingChanges;
    foreach(auto entity, _entitiesInScene) {
        entity->removeFromScene(entity, scene, pendingChanges);
    }
Ejemplo n.º 4
0
void EntityTreeRenderer::clear() {
    leaveAllEntities();

    // unload and stop the engine
    if (_entitiesScriptEngine) {
        // do this here (instead of in deleter) to avoid marshalling unload signals back to this thread
        _entitiesScriptEngine->unloadAllEntityScripts();
        _entitiesScriptEngine->stop();
    }

    // reset the engine
    if (_wantScripts && !_shuttingDown) {
        resetEntitiesScriptEngine();
    }

    // remove all entities from the scene
    auto scene = _viewState->getMain3DScene();
    if (scene) {
        render::PendingChanges pendingChanges;
        foreach(auto entity, _entitiesInScene) {
            entity->removeFromScene(entity, scene, pendingChanges);
        }
        scene->enqueuePendingChanges(pendingChanges);
    } else {