History

merge andrew/thermonuclear into andrew/inertia

Andrew Meadows committed 11 years ago

Commit 5acaaa92 parents 1c569dc d84f57f61 files · +1762 −574Browse files

Showing the changes to interface/src/Application.cpp (1 of 61 files). Show all

Unified · Split

interface/src/Application.cpp+23−7
@@ -445,6 +445,7 @@ void Application::aboutToQuit() { · 444 unmodified lines
445445 }
446446
447447 Application::~Application() {
448+ _entities.getTree()->setSimulation(NULL);
448449 qInstallMessageHandler(NULL);
449450
450451 saveSettings();
@@ -1972,7 +1973,9 @@ void Application::init() { · 1521 unmodified lines
19721973 _entities.init();
19731974 _entities.setViewFrustum(getViewFrustum());
19741975
1975− _entityCollisionSystem.init(&_entityEditSender, _entities.getTree(), _voxels.getTree(), &_audio, &_avatarManager);
1976+ EntityTree* entityTree = _entities.getTree();
1977+ _entityCollisionSystem.init(&_entityEditSender, entityTree, _voxels.getTree(), &_audio, &_avatarManager);
1978+ entityTree->setSimulation(&_entityCollisionSystem);
19761979
19771980 // connect the _entityCollisionSystem to our script engine's EntityScriptingInterface
19781981 connect(&_entityCollisionSystem, &EntityCollisionSystem::entityCollisionWithVoxel,
@@ -2335,11 +2338,12 @@ void Application::update(float deltaTime) { · 356 unmodified lines
23352338
23362339 if (!_aboutToQuit) {
23372340 PerformanceTimer perfTimer("entities");
2341+ // NOTE: the _entities.update() call below will wait for lock
2342+ // and will simulate entity motion (the EntityTree has been given an EntitySimulation).
23382343 _entities.update(); // update the models...
2339− {
2340− PerformanceTimer perfTimer("collisions");
2341− _entityCollisionSystem.update(); // collide the entities...
2342− }
2344+ // The _entityCollisionSystem.updateCollisions() call below merely tries for lock,
2345+ // and on failure it skips collision detection.
2346+ _entityCollisionSystem.updateCollisions(); // collide the entities...
23432347 }
23442348
23452349 {
@@ -2852,7 +2856,12 @@ void Application::updateShadowMap() { · 506 unmodified lines
28522856 // render JS/scriptable overlays
28532857 {
28542858 PerformanceTimer perfTimer("3dOverlays");
2855− _overlays.render3D(RenderArgs::SHADOW_RENDER_MODE);
2859+ _overlays.render3D(false, RenderArgs::SHADOW_RENDER_MODE);
2860+ }
2861+
2862+ {
2863+ PerformanceTimer perfTimer("3dOverlaysFront");
2864+ _overlays.render3D(true, RenderArgs::SHADOW_RENDER_MODE);
28562865 }
28572866
28582867 glDisable(GL_POLYGON_OFFSET_FILL);
@@ -3067,7 +3076,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly, RenderAr · 208 unmodified lines
30673076 // render JS/scriptable overlays
30683077 {
30693078 PerformanceTimer perfTimer("3dOverlays");
3070− _overlays.render3D();
3079+ _overlays.render3D(false);
30713080 }
30723081
30733082 // render the ambient occlusion effect if enabled
@@ -3151,6 +3160,13 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly, RenderAr · 77 unmodified lines
31513160 if (Menu::getInstance()->isOptionChecked(MenuOption::Wireframe)) {
31523161 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
31533162 }
3163+
3164+ // Render 3D overlays that should be drawn in front
3165+ {
3166+ PerformanceTimer perfTimer("3dOverlaysFront");
3167+ glClear(GL_DEPTH_BUFFER_BIT);
3168+ _overlays.render3D(true);
3169+ }
31543170 }
31553171
31563172 void Application::updateUntranslatedViewMatrix(const glm::vec3& viewMatrixTranslation) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t