mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into 19508
This commit is contained in:
commit
112c8946d6
6 changed files with 25 additions and 7 deletions
|
@ -2557,6 +2557,12 @@ void Application::displayOverlay() {
|
|||
}
|
||||
|
||||
bool isClipping = ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME));
|
||||
|
||||
if ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)) {
|
||||
const float MAX_MAGNITUDE = 0.7f;
|
||||
float magnitude = MAX_MAGNITUDE * (1 - _audio.getTimeSinceLastClip() / CLIPPING_INDICATOR_TIME);
|
||||
renderCollisionOverlay(_glWidget->width(), _glWidget->height(), magnitude, 1.0f);
|
||||
}
|
||||
|
||||
_audio.renderToolBox(MIRROR_VIEW_LEFT_PADDING + AUDIO_METER_GAP,
|
||||
audioMeterY,
|
||||
|
|
|
@ -708,7 +708,12 @@ bool Menu::isOptionChecked(const QString& menuOption) {
|
|||
}
|
||||
|
||||
void Menu::triggerOption(const QString& menuOption) {
|
||||
_actionHash.value(menuOption)->trigger();
|
||||
QAction* action = _actionHash.value(menuOption);
|
||||
if (action) {
|
||||
action->trigger();
|
||||
} else {
|
||||
qDebug() << "NULL Action for menuOption '" << menuOption << "'";
|
||||
}
|
||||
}
|
||||
|
||||
QAction* Menu::getActionForOption(const QString& menuOption) {
|
||||
|
|
|
@ -307,13 +307,13 @@ bool ModelUploader::addTextures(const QString& texdir, const QString fbxFile) {
|
|||
foreach (FBXMesh mesh, geometry.meshes) {
|
||||
foreach (FBXMeshPart part, mesh.parts) {
|
||||
if (!part.diffuseFilename.isEmpty()) {
|
||||
if (!addPart(QFileInfo(fbxFile).path() + "/" + part.diffuseFilename,
|
||||
if (!addPart(texdir + "/" + part.diffuseFilename,
|
||||
QString("texture%1").arg(++_texturesCount))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!part.normalFilename.isEmpty()) {
|
||||
if (!addPart(QFileInfo(fbxFile).path() + "/" + part.normalFilename,
|
||||
if (!addPart(texdir + "/" + part.normalFilename,
|
||||
QString("texture%1").arg(++_texturesCount))) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -351,10 +351,10 @@ void drawvec3(int x, int y, float scale, float radians, float thick, int mono, g
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
void renderCollisionOverlay(int width, int height, float magnitude) {
|
||||
void renderCollisionOverlay(int width, int height, float magnitude, float red, float blue, float green) {
|
||||
const float MIN_VISIBLE_COLLISION = 0.01f;
|
||||
if (magnitude > MIN_VISIBLE_COLLISION) {
|
||||
glColor4f(0, 0, 0, magnitude);
|
||||
glColor4f(red, blue, green, magnitude);
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2f(0, 0);
|
||||
glVertex2d(width, 0);
|
||||
|
|
|
@ -62,7 +62,7 @@ float extractUniformScale(const glm::vec3& scale);
|
|||
|
||||
double diffclock(timeval *clock1,timeval *clock2);
|
||||
|
||||
void renderCollisionOverlay(int width, int height, float magnitude);
|
||||
void renderCollisionOverlay(int width, int height, float magnitude, float red = 0, float blue = 0, float green = 0);
|
||||
|
||||
void renderOrientationDirections( glm::vec3 position, const glm::quat& orientation, float size );
|
||||
|
||||
|
|
|
@ -210,7 +210,14 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode) {
|
|||
{
|
||||
// glow when moving far away
|
||||
const float GLOW_DISTANCE = 20.0f;
|
||||
Glower glower(_moving && distanceToTarget > GLOW_DISTANCE && renderMode == NORMAL_RENDER_MODE ? 1.0f : 0.0f);
|
||||
const float GLOW_MAX_LOUDNESS = 2500.0f;
|
||||
const float MAX_GLOW = 0.5f;
|
||||
const float GLOW_FROM_AVERAGE_LOUDNESS = ((this == Application::getInstance()->getAvatar())
|
||||
? 0.0f
|
||||
: MAX_GLOW * getHeadData()->getAudioLoudness() / GLOW_MAX_LOUDNESS);
|
||||
Glower glower(_moving && distanceToTarget > GLOW_DISTANCE && renderMode == NORMAL_RENDER_MODE
|
||||
? 1.0f
|
||||
: GLOW_FROM_AVERAGE_LOUDNESS);
|
||||
|
||||
// render body
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Avatars)) {
|
||||
|
|
Loading…
Reference in a new issue