Merge pull request #1492 from stojce/19466

Code Review for Job #19466
This commit is contained in:
Philip Rosedale 2014-01-10 11:19:43 -08:00
commit f0460bac5f
5 changed files with 20 additions and 3 deletions

View file

@ -824,6 +824,10 @@ void Menu::editPreferences() {
leanScale->setValue(applicationInstance->getAvatar()->getLeanScale());
form->addRow("Lean Scale:", leanScale);
QDoubleSpinBox* avatarScale = new QDoubleSpinBox();
avatarScale->setValue(applicationInstance->getAvatar()->getScale());
form->addRow("Avatar Scale:", avatarScale);
QSpinBox* audioJitterBufferSamples = new QSpinBox();
audioJitterBufferSamples->setMaximum(10000);
audioJitterBufferSamples->setMinimum(-10000);
@ -887,6 +891,7 @@ void Menu::editPreferences() {
_maxVoxelPacketsPerSecond = maxVoxelsPPS->value();
applicationInstance->getAvatar()->setLeanScale(leanScale->value());
applicationInstance->getAvatar()->setNewScale(avatarScale->value());
_audioJitterBufferSamples = audioJitterBufferSamples->value();

View file

@ -24,8 +24,6 @@
#include "devices/SerialInterface.h"
#include "devices/Transmitter.h"
static const float MAX_SCALE = 1000.f;
static const float MIN_SCALE = .005f;
static const float SCALING_RATIO = .05f;
static const float SMOOTHING_RATIO = .05f; // 0 < ratio < 1
static const float RESCALING_TOLERANCE = .02f;

View file

@ -15,6 +15,7 @@
#include <QPushButton>
#include <QCheckBox>
#include <QSyntaxHighlighter>
#include <pthread.h>
#include "AbstractLoggerInterface.h"

View file

@ -295,3 +295,13 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
return sourceBuffer - startPosition;
}
void AvatarData::setNewScale(float newScale) {
if (newScale > MAX_SCALE) {
newScale = MAX_SCALE;
} else if (newScale < MIN_SCALE) {
newScale = MIN_SCALE;
}
_newScale = newScale;
qDebug() << "Changed scale to " << _newScale << "\n";
}

View file

@ -32,6 +32,9 @@ const int HAND_STATE_START_BIT = 2; // 3rd and 4th bits
const int IS_FACESHIFT_CONNECTED = 4; // 5th bit
const int IS_CHAT_CIRCLING_ENABLED = 5;
static const float MAX_SCALE = 1000.f;
static const float MIN_SCALE = .005f;
const float MAX_AUDIO_LOUDNESS = 1000.0; // close enough for mouth animation
enum KeyState
@ -80,7 +83,7 @@ public:
// Scale
float getNewScale() const { return _newScale; }
void setNewScale(float newScale) { _newScale = newScale; }
void setNewScale(float);
// Hand State
void setHandState(char s) { _handState = s; }