mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 18:42:11 +02:00
Merge pull request #4580 from birarda/master
use non-persistent settings to avoid lobby crash confusion
This commit is contained in:
commit
01dc1b058c
12 changed files with 125 additions and 67 deletions
|
@ -13,8 +13,6 @@
|
|||
set(_TBB_LIBRARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib)
|
||||
file(GLOB_RECURSE _TBB_LIBRARIES "${_TBB_LIBRARY_DIR}/*.dylib")
|
||||
|
||||
message(${_TBB_LIBRARIES})
|
||||
|
||||
# raise an error if we found none
|
||||
if (NOT _TBB_LIBRARIES)
|
||||
message(FATAL_ERROR "Did not find any TBB libraries")
|
||||
|
|
|
@ -14,6 +14,7 @@ Script.load("selectAudioDevice.js");
|
|||
Script.load("controllers/hydra/hydraMove.js");
|
||||
Script.load("headMove.js");
|
||||
Script.load("inspect.js");
|
||||
Script.load("lobby.js");
|
||||
Script.load("notifications.js");
|
||||
Script.load("look.js");
|
||||
Script.load("users.js");
|
||||
|
|
|
@ -45,8 +45,6 @@ var panelsCenterShift = Vec3.subtract(panelsCenter, orbCenter);
|
|||
|
||||
var ORB_SHIFT = { x: 0, y: -1.4, z: -0.8};
|
||||
|
||||
var HELMET_ATTACHMENT_URL = HIFI_PUBLIC_BUCKET + "models/attachments/IronManMaskOnly.fbx"
|
||||
|
||||
var LOBBY_PANEL_WALL_URL = HIFI_PUBLIC_BUCKET + "models/sets/Lobby/PanelWallForInterface.fbx";
|
||||
var LOBBY_BLANK_PANEL_TEXTURE_URL = HIFI_PUBLIC_BUCKET + "models/sets/Lobby/Texture.jpg";
|
||||
var LOBBY_SHELL_URL = HIFI_PUBLIC_BUCKET + "models/sets/Lobby/LobbyShellForInterface.fbx";
|
||||
|
@ -136,9 +134,6 @@ function drawLobby() {
|
|||
panelWall = Overlays.addOverlay("model", panelWallProps);
|
||||
orbShell = Overlays.addOverlay("model", orbShellProps);
|
||||
descriptionText = Overlays.addOverlay("text3d", descriptionTextProps);
|
||||
|
||||
// add an attachment on this avatar so other people see them in the lobby
|
||||
MyAvatar.attach(HELMET_ATTACHMENT_URL, "Neck", {x: 0, y: 0, z: 0}, Quat.fromPitchYawRollDegrees(0, 0, 0), 1.15);
|
||||
|
||||
if (droneSound.downloaded) {
|
||||
// start the drone sound
|
||||
|
@ -237,6 +232,8 @@ function playRandomMuzak() {
|
|||
}
|
||||
|
||||
function cleanupLobby() {
|
||||
toggleEnvironmentRendering(true);
|
||||
|
||||
// for each of the 21 placeholder textures, set them back to default so the cached model doesn't have changed textures
|
||||
var panelTexturesReset = {};
|
||||
panelTexturesReset["textures"] = {};
|
||||
|
@ -254,15 +251,18 @@ function cleanupLobby() {
|
|||
panelWall = false;
|
||||
orbShell = false;
|
||||
|
||||
currentDrone.stop();
|
||||
currentMuzakInjector.stop();
|
||||
if (currentDrone) {
|
||||
currentDrone.stop();
|
||||
currentDrone = null
|
||||
}
|
||||
|
||||
currentMuzakInjector = null;
|
||||
if (currentMuzakInjector) {
|
||||
currentMuzakInjector.stop();
|
||||
currentMuzakInjector = null;
|
||||
}
|
||||
|
||||
places = {};
|
||||
toggleEnvironmentRendering(true);
|
||||
|
||||
MyAvatar.detachOne(HELMET_ATTACHMENT_URL);
|
||||
}
|
||||
|
||||
function actionStartEvent(event) {
|
||||
|
@ -311,10 +311,8 @@ function maybeCleanupLobby() {
|
|||
}
|
||||
|
||||
function toggleEnvironmentRendering(shouldRender) {
|
||||
Menu.setIsOptionChecked("Voxels", shouldRender);
|
||||
Menu.setIsOptionChecked("Entities", shouldRender);
|
||||
Menu.setIsOptionChecked("Metavoxels", shouldRender);
|
||||
Menu.setIsOptionChecked("Avatars", shouldRender);
|
||||
Scene.shouldRenderAvatars = shouldRender;
|
||||
Scene.shouldRenderEntities = shouldRender;
|
||||
}
|
||||
|
||||
function handleLookAt(pickRay) {
|
||||
|
|
|
@ -11,13 +11,21 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
var createdRenderMenu = false;
|
||||
|
||||
var ENTITIES_MENU = "Developer > Entities";
|
||||
var COLLISION_UPDATES_TO_SERVER = "Don't send collision updates to server";
|
||||
|
||||
var RENDER_MENU = "Developer > Render";
|
||||
var ENTITIES_ITEM = "Entities";
|
||||
var AVATARS_ITEM = "Avatars";
|
||||
|
||||
function setupMenus() {
|
||||
if (!Menu.menuExists("Developer")) {
|
||||
Menu.addMenu("Developer");
|
||||
}
|
||||
if (!Menu.menuExists("Developer > Entities")) {
|
||||
Menu.addMenu("Developer > Entities");
|
||||
if (!Menu.menuExists(ENTITIES_MENU)) {
|
||||
Menu.addMenu(ENTITIES_MENU);
|
||||
|
||||
// NOTE: these menu items aren't currently working. I've temporarily removed them. Will add them back once we
|
||||
// rewire these to work
|
||||
|
@ -31,27 +39,55 @@ function setupMenus() {
|
|||
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Don't Do Precision Picking", isCheckable: true, isChecked: false });
|
||||
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Disable Light Entities", isCheckable: true, isChecked: false });
|
||||
*/
|
||||
Menu.addMenuItem({ menuName: "Developer > Entities", menuItemName: "Don't send collision updates to server", isCheckable: true, isChecked: false });
|
||||
Menu.addMenuItem({ menuName: ENTITIES_MENU, menuItemName: COLLISION_UPDATES_TO_SERVER, isCheckable: true, isChecked: false });
|
||||
}
|
||||
|
||||
if (!Menu.menuExists(RENDER_MENU)) {
|
||||
Menu.addMenu(RENDER_MENU);
|
||||
createdRenderMenu = true;
|
||||
}
|
||||
|
||||
if (!Menu.menuItemExists(RENDER_MENU, ENTITIES_ITEM)) {
|
||||
Menu.addMenuItem({ menuName: RENDER_MENU, menuItemName: ENTITIES_ITEM, isCheckable: true, isChecked: Scene.shouldRenderEntities })
|
||||
}
|
||||
|
||||
if (!Menu.menuItemExists(RENDER_MENU, AVATARS_ITEM)) {
|
||||
Menu.addMenuItem({ menuName: RENDER_MENU, menuItemName: AVATARS_ITEM, isCheckable: true, isChecked: Scene.shouldRenderAvatars })
|
||||
}
|
||||
}
|
||||
|
||||
Menu.menuItemEvent.connect(function (menuItem) {
|
||||
print("menuItemEvent() in JS... menuItem=" + menuItem);
|
||||
|
||||
if (menuItem == "Don't send collision updates to server") {
|
||||
var dontSendUpdates = Menu.isOptionChecked("Don't send collision updates to server");
|
||||
if (menuItem == COLLISION_UPDATES_TO_SERVER) {
|
||||
var dontSendUpdates = Menu.isOptionChecked(COLLISION_UPDATES_TO_SERVER);
|
||||
print(" dontSendUpdates... checked=" + dontSendUpdates);
|
||||
Entities.setSendPhysicsUpdates(!dontSendUpdates);
|
||||
} else if (menuItem == ENTITIES_ITEM) {
|
||||
Scene.shouldRenderEntities = Menu.isOptionChecked(ENTITIES_ITEM);
|
||||
} else if (menuItem == AVATARS_ITEM) {
|
||||
Scene.shouldRenderAvatars = Menu.isOptionChecked(AVATARS_ITEM);
|
||||
}
|
||||
});
|
||||
|
||||
setupMenus();
|
||||
Scene.shouldRenderAvatarsChanged.connect(function(shouldRenderAvatars) {
|
||||
Menu.setIsOptionChecked(AVATARS_ITEM, shouldRenderAvatars)
|
||||
});
|
||||
|
||||
// register our scriptEnding callback
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
Scene.shouldRenderEntitiesChanged.connect(function(shouldRenderEntities) {
|
||||
Menu.setIsOptionChecked(ENTITIES_ITEM, shouldRenderEntities)
|
||||
});
|
||||
|
||||
function scriptEnding() {
|
||||
Menu.removeMenu("Developer > Entities");
|
||||
Menu.removeMenu(ENTITIES_MENU);
|
||||
|
||||
if (createdRenderMenu) {
|
||||
Menu.removeMenu(RENDER_MENU);
|
||||
} else {
|
||||
Menu.removeMenuItem(RENDER_MENU, ENTITIES_ITEM);
|
||||
Menu.removeMenuItem(RENDER_MENU, AVATARS_ITEM);
|
||||
}
|
||||
}
|
||||
|
||||
setupMenus();
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
|
|
|
@ -2259,7 +2259,7 @@ void Application::update(float deltaTime) {
|
|||
if (queryIsDue || viewIsDifferentEnough) {
|
||||
_lastQueriedTime = now;
|
||||
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) {
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||
queryOctree(NodeType::EntityServer, PacketTypeEntityQuery, _entityServerJurisdictions);
|
||||
}
|
||||
_lastQueriedViewFrustum = _viewFrustum;
|
||||
|
@ -2972,7 +2972,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs
|
|||
DependencyManager::get<GeometryCache>()->renderSphere(originSphereRadius, 15, 15, glm::vec4(1.0f, 0.0f, 0.0f, 1.0f));
|
||||
|
||||
// render models...
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) {
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||
PerformanceTimer perfTimer("entities");
|
||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||
"Application::displaySide() ... entities...");
|
||||
|
@ -2993,17 +2993,15 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs
|
|||
DependencyManager::get<AmbientOcclusionEffect>()->render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool mirrorMode = (theCamera.getMode() == CAMERA_MODE_MIRROR);
|
||||
|
||||
{
|
||||
PerformanceTimer perfTimer("avatars");
|
||||
DependencyManager::get<AvatarManager>()->renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE,
|
||||
false, selfAvatarOnly);
|
||||
false, selfAvatarOnly);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
|
||||
auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
|
||||
|
|
|
@ -268,8 +268,6 @@ Menu::Menu() {
|
|||
|
||||
QMenu* renderOptionsMenu = developerMenu->addMenu("Render");
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere, Qt::SHIFT | Qt::Key_A, true);
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Avatars, 0, true);
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Entities, 0, true);
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AmbientOcclusion);
|
||||
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::DontFadeOnOctreeServerChanges);
|
||||
|
||||
|
|
|
@ -119,7 +119,6 @@ namespace MenuOption {
|
|||
const QString AudioSourceInject = "Generated Audio";
|
||||
const QString AudioSourcePinkNoise = "Pink Noise";
|
||||
const QString AudioSourceSine440 = "Sine 440hz";
|
||||
const QString Avatars = "Avatars";
|
||||
const QString BandwidthDetails = "Bandwidth Details";
|
||||
const QString BlueSpeechSphere = "Blue Sphere While Speaking";
|
||||
const QString BookmarkLocation = "Bookmark Location";
|
||||
|
@ -156,7 +155,6 @@ namespace MenuOption {
|
|||
const QString EnableCharacterController = "Enable avatar collisions";
|
||||
const QString EnableGlowEffect = "Enable Glow Effect (Warning: Poor Oculus Performance)";
|
||||
const QString EnableVRMode = "Enable VR Mode";
|
||||
const QString Entities = "Entities";
|
||||
const QString ExpandMyAvatarSimulateTiming = "Expand /myAvatar/simulation";
|
||||
const QString ExpandMyAvatarTiming = "Expand /myAvatar";
|
||||
const QString ExpandOtherAvatarTiming = "Expand /otherAvatar";
|
||||
|
|
|
@ -364,9 +364,7 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode, bool
|
|||
: GLOW_FROM_AVERAGE_LOUDNESS;
|
||||
|
||||
// render body
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Avatars)) {
|
||||
renderBody(frustum, renderMode, postLighting, glowLevel);
|
||||
}
|
||||
renderBody(frustum, renderMode, postLighting, glowLevel);
|
||||
|
||||
if (!postLighting && renderMode != SHADOW_RENDER_MODE) {
|
||||
// add local lights
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "AvatarManager.h"
|
||||
#include "Menu.h"
|
||||
#include "MyAvatar.h"
|
||||
#include "SceneScriptingInterface.h"
|
||||
|
||||
// 70 times per second - target is 60hz, but this helps account for any small deviations
|
||||
// in the update loop
|
||||
|
@ -122,15 +123,17 @@ void AvatarManager::renderAvatars(Avatar::RenderMode renderMode, bool postLighti
|
|||
glm::vec3 cameraPosition = Application::getInstance()->getCamera()->getPosition();
|
||||
|
||||
if (!selfAvatarOnly) {
|
||||
foreach (const AvatarSharedPointer& avatarPointer, _avatarHash) {
|
||||
Avatar* avatar = static_cast<Avatar*>(avatarPointer.data());
|
||||
if (!avatar->isInitialized()) {
|
||||
continue;
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderAvatars()) {
|
||||
foreach (const AvatarSharedPointer& avatarPointer, _avatarHash) {
|
||||
Avatar* avatar = static_cast<Avatar*>(avatarPointer.data());
|
||||
if (!avatar->isInitialized()) {
|
||||
continue;
|
||||
}
|
||||
avatar->render(cameraPosition, renderMode, postLighting);
|
||||
avatar->setDisplayingLookatVectors(renderLookAtVectors);
|
||||
}
|
||||
avatar->render(cameraPosition, renderMode, postLighting);
|
||||
avatar->setDisplayingLookatVectors(renderLookAtVectors);
|
||||
renderAvatarFades(cameraPosition, renderMode);
|
||||
}
|
||||
renderAvatarFades(cameraPosition, renderMode);
|
||||
} else {
|
||||
// just render myAvatar
|
||||
_myAvatar->render(cameraPosition, renderMode, postLighting);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "Application.h"
|
||||
#include "Menu.h"
|
||||
#include "OctreePacketProcessor.h"
|
||||
#include "SceneScriptingInterface.h"
|
||||
|
||||
void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode, const QByteArray& packet) {
|
||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||
|
@ -81,13 +82,13 @@ void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode,
|
|||
|
||||
switch(voxelPacketType) {
|
||||
case PacketTypeEntityErase: {
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) {
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||
app->_entities.processEraseMessage(mutablePacket, sendingNode);
|
||||
}
|
||||
} break;
|
||||
|
||||
case PacketTypeEntityData: {
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) {
|
||||
if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
|
||||
app->_entities.processDatagram(mutablePacket, sendingNode);
|
||||
}
|
||||
} break;
|
||||
|
|
|
@ -20,48 +20,62 @@ void SceneScriptingInterface::setStageLocation(float longitude, float latitude,
|
|||
_skyStage->setOriginLocation(longitude, latitude, altitude);
|
||||
}
|
||||
|
||||
float SceneScriptingInterface::getStageLocationLongitude() const {
|
||||
return _skyStage->getOriginLongitude();
|
||||
}
|
||||
float SceneScriptingInterface::getStageLocationLatitude() const {
|
||||
return _skyStage->getOriginLatitude();
|
||||
}
|
||||
float SceneScriptingInterface::getStageLocationAltitude() const {
|
||||
return _skyStage->getOriginSurfaceAltitude();
|
||||
float SceneScriptingInterface::getStageLocationLongitude() const {
|
||||
return _skyStage->getOriginLongitude();
|
||||
}
|
||||
float SceneScriptingInterface::getStageLocationLatitude() const {
|
||||
return _skyStage->getOriginLatitude();
|
||||
}
|
||||
float SceneScriptingInterface::getStageLocationAltitude() const {
|
||||
return _skyStage->getOriginSurfaceAltitude();
|
||||
}
|
||||
|
||||
void SceneScriptingInterface::setStageDayTime(float hour) {
|
||||
_skyStage->setDayTime(hour);
|
||||
}
|
||||
|
||||
float SceneScriptingInterface::getStageDayTime() const {
|
||||
return _skyStage->getDayTime();
|
||||
float SceneScriptingInterface::getStageDayTime() const {
|
||||
return _skyStage->getDayTime();
|
||||
}
|
||||
|
||||
void SceneScriptingInterface::setStageYearTime(int day) {
|
||||
_skyStage->setYearTime(day);
|
||||
}
|
||||
|
||||
int SceneScriptingInterface::getStageYearTime() const {
|
||||
return _skyStage->getYearTime();
|
||||
int SceneScriptingInterface::getStageYearTime() const {
|
||||
return _skyStage->getYearTime();
|
||||
}
|
||||
|
||||
void SceneScriptingInterface::setSunColor(const glm::vec3& color) {
|
||||
_skyStage->setSunColor(color);
|
||||
}
|
||||
|
||||
const glm::vec3& SceneScriptingInterface::getSunColor() const {
|
||||
return _skyStage->getSunColor();
|
||||
const glm::vec3& SceneScriptingInterface::getSunColor() const {
|
||||
return _skyStage->getSunColor();
|
||||
}
|
||||
|
||||
void SceneScriptingInterface::setSunIntensity(float intensity) {
|
||||
_skyStage->setSunIntensity(intensity);
|
||||
}
|
||||
|
||||
float SceneScriptingInterface::getSunIntensity() const {
|
||||
return _skyStage->getSunIntensity();
|
||||
float SceneScriptingInterface::getSunIntensity() const {
|
||||
return _skyStage->getSunIntensity();
|
||||
}
|
||||
|
||||
model::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const {
|
||||
return _skyStage;
|
||||
}
|
||||
|
||||
void SceneScriptingInterface::setShouldRenderAvatars(bool shouldRenderAvatars) {
|
||||
if (shouldRenderAvatars != _shouldRenderAvatars) {
|
||||
_shouldRenderAvatars = shouldRenderAvatars;
|
||||
emit shouldRenderAvatarsChanged(_shouldRenderAvatars);
|
||||
}
|
||||
}
|
||||
|
||||
void SceneScriptingInterface::setShouldRenderEntities(bool shouldRenderEntities) {
|
||||
if (shouldRenderEntities != _shouldRenderEntities) {
|
||||
_shouldRenderEntities = shouldRenderEntities;
|
||||
emit shouldRenderEntitiesChanged(_shouldRenderEntities);
|
||||
}
|
||||
}
|
|
@ -21,13 +21,16 @@
|
|||
class SceneScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
||||
Q_PROPERTY(bool shouldRenderAvatars READ shouldRenderAvatars WRITE setShouldRenderAvatars)
|
||||
Q_PROPERTY(bool shouldRenderEntities READ shouldRenderEntities WRITE setShouldRenderEntities)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void setStageOrientation(const glm::quat& orientation);
|
||||
|
||||
Q_INVOKABLE void setStageLocation(float longitude, float latitude, float altitude);
|
||||
Q_INVOKABLE float getStageLocationLongitude() const;
|
||||
Q_INVOKABLE float getStageLocationLatitude() const;
|
||||
Q_INVOKABLE float getStageLocationLongitude() const;
|
||||
Q_INVOKABLE float getStageLocationLatitude() const;
|
||||
Q_INVOKABLE float getStageLocationAltitude() const;
|
||||
|
||||
Q_INVOKABLE void setStageDayTime(float hour);
|
||||
|
@ -41,12 +44,24 @@ public:
|
|||
Q_INVOKABLE float getSunIntensity() const;
|
||||
|
||||
model::SunSkyStagePointer getSkyStage() const;
|
||||
|
||||
|
||||
Q_INVOKABLE void setShouldRenderAvatars(bool shouldRenderAvatars);
|
||||
Q_INVOKABLE bool shouldRenderAvatars() const { return _shouldRenderAvatars; }
|
||||
|
||||
Q_INVOKABLE void setShouldRenderEntities(bool shouldRenderEntities);
|
||||
Q_INVOKABLE bool shouldRenderEntities() const { return _shouldRenderEntities; }
|
||||
|
||||
signals:
|
||||
void shouldRenderAvatarsChanged(bool shouldRenderAvatars);
|
||||
void shouldRenderEntitiesChanged(bool shouldRenderEntities);
|
||||
protected:
|
||||
SceneScriptingInterface() {};
|
||||
~SceneScriptingInterface() {};
|
||||
|
||||
model::SunSkyStagePointer _skyStage = model::SunSkyStagePointer(new model::SunSkyStage());
|
||||
|
||||
bool _shouldRenderAvatars = true;
|
||||
bool _shouldRenderEntities = true;
|
||||
};
|
||||
|
||||
#endif // hifi_SceneScriptingInterface_h
|
||||
|
|
Loading…
Reference in a new issue