mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
clear environment data on domain server switch
This commit is contained in:
parent
67e5a6409e
commit
04a2dd3b86
3 changed files with 11 additions and 1 deletions
|
@ -1148,15 +1148,19 @@ void Application::editPreferences() {
|
|||
|
||||
// check if the domain server hostname is new
|
||||
if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, sizeof(&newHostname)) != 0) {
|
||||
// if so we need to clear the nodelist and delete the local voxels
|
||||
// if so we need to clear the nodelist and delete the existing voxel and environment data
|
||||
Node *voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
|
||||
|
||||
if (voxelServer) {
|
||||
voxelServer->lock();
|
||||
}
|
||||
|
||||
// kill the local voxels
|
||||
_voxels.killLocalVoxels();
|
||||
|
||||
// reset the environment to default
|
||||
_environment.resetToDefault();
|
||||
|
||||
if (voxelServer) {
|
||||
voxelServer->unlock();
|
||||
}
|
||||
|
|
|
@ -47,6 +47,11 @@ void Environment::init() {
|
|||
_data[getZeroAddress()][0];
|
||||
}
|
||||
|
||||
void Environment::resetToDefault() {
|
||||
_data.clear();
|
||||
_data[getZeroAddress()][0];
|
||||
}
|
||||
|
||||
void Environment::renderAtmospheres(Camera& camera) {
|
||||
// get the lock for the duration of the call
|
||||
QMutexLocker locker(&_mutex);
|
||||
|
|
|
@ -24,6 +24,7 @@ class Environment {
|
|||
public:
|
||||
|
||||
void init();
|
||||
void resetToDefault();
|
||||
void renderAtmospheres(Camera& camera);
|
||||
|
||||
glm::vec3 getGravity (const glm::vec3& position);
|
||||
|
|
Loading…
Reference in a new issue