mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-16 21:48:44 +02:00
connect menu options to avatar render features
This commit is contained in:
parent
823f3a73c6
commit
00b05ed137
6 changed files with 36 additions and 46 deletions
|
@ -504,11 +504,14 @@ Menu::Menu() {
|
|||
#endif
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AvatarReceiveStats, 0, false,
|
||||
avatarManager.data(), SLOT(setShouldShowReceiveStats(bool)));
|
||||
avatar.get(), SLOT(setShowReceiveStats(bool)));
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowBoundingCollisionShapes, 0, false,
|
||||
avatar.get(), SLOT(setShowCollisionShapes(bool)));
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowMyLookAtVectors, 0, false,
|
||||
avatar.get(), SLOT(setShowMyLookAtVectors(bool)));
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ShowOtherLookAtVectors, 0, false,
|
||||
avatar.get(), SLOT(setShowOtherLookAtVectors(bool)));
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderBoundingCollisionShapes);
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderMyLookAtVectors, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::RenderOtherLookAtVectors, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::FixGaze, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::AnimDebugDrawDefaultPose, 0, false,
|
||||
avatar.get(), SLOT(setEnableDebugDrawDefaultPose(bool)));
|
||||
|
|
|
@ -146,9 +146,6 @@ namespace MenuOption {
|
|||
const QString Quit = "Quit";
|
||||
const QString ReloadAllScripts = "Reload All Scripts";
|
||||
const QString ReloadContent = "Reload Content (Clears all caches)";
|
||||
const QString RenderBoundingCollisionShapes = "Show Bounding Collision Shapes";
|
||||
const QString RenderMyLookAtVectors = "Show My Eye Vectors";
|
||||
const QString RenderOtherLookAtVectors = "Show Other Eye Vectors";
|
||||
const QString RenderMaxTextureMemory = "Maximum Texture Memory";
|
||||
const QString RenderMaxTextureAutomatic = "Automatic Texture Memory";
|
||||
const QString RenderMaxTexture4MB = "4 MB";
|
||||
|
@ -174,8 +171,11 @@ namespace MenuOption {
|
|||
const QString SendWrongDSConnectVersion = "Send wrong DS connect version";
|
||||
const QString SendWrongProtocolVersion = "Send wrong protocol version";
|
||||
const QString SetHomeLocation = "Set Home Location";
|
||||
const QString ShowDSConnectTable = "Show Domain Connection Timing";
|
||||
const QString ShowBordersEntityNodes = "Show Entity Nodes";
|
||||
const QString ShowBoundingCollisionShapes = "Show Bounding Collision Shapes";
|
||||
const QString ShowDSConnectTable = "Show Domain Connection Timing";
|
||||
const QString ShowMyLookAtVectors = "Show My Eye Vectors";
|
||||
const QString ShowOtherLookAtVectors = "Show Other Eye Vectors";
|
||||
const QString ShowRealtimeEntityStats = "Show Realtime Entity Stats";
|
||||
const QString StandingHMDSensorMode = "Standing HMD Sensor Mode";
|
||||
const QString SimulateEyeTracking = "Simulate";
|
||||
|
|
|
@ -71,28 +71,27 @@ namespace render {
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool showReceiveStats = false;
|
||||
static bool showReceiveStats = false;
|
||||
void Avatar::setShowReceiveStats(bool receiveStats) {
|
||||
showReceiveStats = receiveStats;
|
||||
}
|
||||
|
||||
// static
|
||||
bool renderMyLookAtVectors = false;
|
||||
bool renderOtherLookAtVectors = false;
|
||||
void Avatar::setShowLookAtVectors(bool showMine, bool showOthers) {
|
||||
renderMyLookAtVectors = showMine;
|
||||
renderOtherLookAtVectors = showOthers;
|
||||
static bool showMyLookAtVectors = false;
|
||||
void Avatar::setShowMyLookAtVectors(bool showMine) {
|
||||
showMyLookAtVectors = showMine;
|
||||
}
|
||||
|
||||
// static
|
||||
bool renderCollisionShapes = false;
|
||||
void Avatar::setRenderCollisionShapes(bool render) {
|
||||
renderCollisionShapes = render;
|
||||
static bool showOtherLookAtVectors = false;
|
||||
void Avatar::setShowOtherLookAtVectors(bool showOthers) {
|
||||
showOtherLookAtVectors = showOthers;
|
||||
}
|
||||
|
||||
// static
|
||||
bool showNamesAboveHeads = false;
|
||||
static bool showCollisionShapes = false;
|
||||
void Avatar::setShowCollisionShapes(bool render) {
|
||||
showCollisionShapes = render;
|
||||
}
|
||||
|
||||
static bool showNamesAboveHeads = false;
|
||||
void Avatar::setShowNamesAboveHeads(bool show) {
|
||||
showNamesAboveHeads = show;
|
||||
}
|
||||
|
@ -553,14 +552,7 @@ void Avatar::updateRenderItem(render::Transaction& transaction) {
|
|||
|
||||
void Avatar::postUpdate(float deltaTime) {
|
||||
|
||||
bool renderLookAtVectors;
|
||||
if (isMyAvatar()) {
|
||||
renderLookAtVectors = renderMyLookAtVectors;
|
||||
} else {
|
||||
renderLookAtVectors = renderOtherLookAtVectors;
|
||||
}
|
||||
|
||||
if (renderLookAtVectors) {
|
||||
if (isMyAvatar() ? showMyLookAtVectors : showOtherLookAtVectors) {
|
||||
const float EYE_RAY_LENGTH = 10.0;
|
||||
const glm::vec4 BLUE(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
const glm::vec4 RED(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
@ -653,17 +645,18 @@ void Avatar::render(RenderArgs* renderArgs) {
|
|||
return;
|
||||
}
|
||||
|
||||
glm::vec3 toTarget = frustum.getPosition() - getPosition();
|
||||
float distanceToTarget = glm::length(toTarget);
|
||||
|
||||
fixupModelsInScene(renderArgs->_scene);
|
||||
|
||||
if (renderCollisionShapes && shouldRenderHead(renderArgs) && _skeletonModel->isRenderable()) {
|
||||
if (showCollisionShapes && shouldRenderHead(renderArgs) && _skeletonModel->isRenderable()) {
|
||||
PROFILE_RANGE_BATCH(batch, __FUNCTION__":skeletonBoundingCollisionShapes");
|
||||
const float BOUNDING_SHAPE_ALPHA = 0.7f;
|
||||
_skeletonModel->renderBoundingCollisionShapes(*renderArgs->_batch, getUniformScale(), BOUNDING_SHAPE_ALPHA);
|
||||
}
|
||||
|
||||
#if 0 /// -------------- REMOVED FOR NOW --------------
|
||||
// removed CPU calculations as per removal of menu option
|
||||
glm::vec3 toTarget = frustum.getPosition() - getPosition();
|
||||
float distanceToTarget = glm::length(toTarget);
|
||||
const float DISPLAYNAME_DISTANCE = 20.0f;
|
||||
setShowDisplayName(distanceToTarget < DISPLAYNAME_DISTANCE);
|
||||
if (!isMyAvatar() || renderArgs->_cameraMode != (int8_t)CAMERA_MODE_FIRST_PERSON) {
|
||||
|
@ -673,6 +666,7 @@ void Avatar::render(RenderArgs* renderArgs) {
|
|||
renderDisplayName(batch, frustum, textPosition);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
glm::quat Avatar::computeRotationFromBodyToWorldUp(float proportion) const {
|
||||
|
|
|
@ -68,11 +68,6 @@ class Avatar : public AvatarData {
|
|||
Q_PROPERTY(glm::vec3 skeletonOffset READ getSkeletonOffset WRITE setSkeletonOffset)
|
||||
|
||||
public:
|
||||
static void setShowReceiveStats(bool receiveStats);
|
||||
static void setShowLookAtVectors(bool showMine, bool showOthers);
|
||||
static void setRenderCollisionShapes(bool render);
|
||||
static void setShowNamesAboveHeads(bool show);
|
||||
|
||||
explicit Avatar(QThread* thread, RigPointer rig = nullptr);
|
||||
~Avatar();
|
||||
|
||||
|
@ -256,6 +251,11 @@ public:
|
|||
bool isInPhysicsSimulation() const { return _physicsCallback != nullptr; }
|
||||
|
||||
public slots:
|
||||
void setShowReceiveStats(bool receiveStats);
|
||||
void setShowMyLookAtVectors(bool showMine);
|
||||
void setShowOtherLookAtVectors(bool showOthers);
|
||||
void setShowCollisionShapes(bool render);
|
||||
void setShowNamesAboveHeads(bool show);
|
||||
|
||||
// FIXME - these should be migrated to use Pose data instead
|
||||
// thread safe, will return last valid palm from cache
|
||||
|
|
|
@ -147,12 +147,6 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
ViewFrustum cameraView;
|
||||
qApp->copyDisplayViewFrustum(cameraView);
|
||||
|
||||
// HACK: update Avatar namespace settings
|
||||
Avatar::setShowLookAtVectors(
|
||||
Menu::getInstance()->isOptionChecked(MenuOption::RenderMyLookAtVectors),
|
||||
Menu::getInstance()->isOptionChecked(MenuOption::RenderOtherLookAtVectors));
|
||||
Avatar::setRenderCollisionShapes(Menu::getInstance()->isOptionChecked(MenuOption::RenderBoundingCollisionShapes));
|
||||
|
||||
std::priority_queue<AvatarPriority> sortedAvatars;
|
||||
AvatarData::sortAvatars(avatarList, cameraView, sortedAvatars,
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ public:
|
|||
float getMyAvatarSendRate() const { return _myAvatarSendRate.rate(); }
|
||||
|
||||
public slots:
|
||||
void setShouldShowReceiveStats(bool shouldShowReceiveStats) const { Avatar::setShowReceiveStats(shouldShowReceiveStats); }
|
||||
void updateAvatarRenderStatus(bool shouldRenderAvatars);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue