remove scale from Camera class since it was only used by avatar and was causing problems with no obvious benefit

This commit is contained in:
ZappoMan 2015-04-28 16:34:33 -07:00
parent aec0bd1693
commit 664d126465
3 changed files with 3 additions and 9 deletions

View file

@ -55,7 +55,6 @@ Camera::Camera() :
_farClip(DEFAULT_FAR_CLIP), // default _farClip(DEFAULT_FAR_CLIP), // default
_hmdPosition(), _hmdPosition(),
_hmdRotation(), _hmdRotation(),
_scale(1.0f),
_isKeepLookingAt(false), _isKeepLookingAt(false),
_lookingAt(0.0f, 0.0f, 0.0f) _lookingAt(0.0f, 0.0f, 0.0f)
{ {
@ -94,8 +93,8 @@ void Camera::setHmdRotation(const glm::quat& hmdRotation) {
} }
float Camera::getFarClip() const { float Camera::getFarClip() const {
return (_scale * _farClip < std::numeric_limits<int16_t>::max()) return (_farClip < std::numeric_limits<int16_t>::max())
? _scale * _farClip ? _farClip
: std::numeric_limits<int16_t>::max() - 1; : std::numeric_limits<int16_t>::max() - 1;
} }

View file

@ -54,7 +54,6 @@ public:
void setFarClip(float f); void setFarClip(float f);
void setEyeOffsetPosition(const glm::vec3& p) { _eyeOffsetPosition = p; } void setEyeOffsetPosition(const glm::vec3& p) { _eyeOffsetPosition = p; }
void setEyeOffsetOrientation(const glm::quat& o) { _eyeOffsetOrientation = o; } void setEyeOffsetOrientation(const glm::quat& o) { _eyeOffsetOrientation = o; }
void setScale(const float s) { _scale = s; }
glm::quat getRotation() const { return _rotation * _hmdRotation; } glm::quat getRotation() const { return _rotation * _hmdRotation; }
const glm::vec3& getHmdPosition() const { return _hmdPosition; } const glm::vec3& getHmdPosition() const { return _hmdPosition; }
@ -63,11 +62,10 @@ public:
CameraMode getMode() const { return _mode; } CameraMode getMode() const { return _mode; }
float getFieldOfView() const { return _fieldOfView; } float getFieldOfView() const { return _fieldOfView; }
float getAspectRatio() const { return _aspectRatio; } float getAspectRatio() const { return _aspectRatio; }
float getNearClip() const { return _scale * _nearClip; } float getNearClip() const { return _nearClip; }
float getFarClip() const; float getFarClip() const;
const glm::vec3& getEyeOffsetPosition() const { return _eyeOffsetPosition; } const glm::vec3& getEyeOffsetPosition() const { return _eyeOffsetPosition; }
const glm::quat& getEyeOffsetOrientation() const { return _eyeOffsetOrientation; } const glm::quat& getEyeOffsetOrientation() const { return _eyeOffsetOrientation; }
float getScale() const { return _scale; }
public slots: public slots:
QString getModeString() const; QString getModeString() const;
void setModeString(const QString& mode); void setModeString(const QString& mode);
@ -107,7 +105,6 @@ private:
glm::quat _rotation; glm::quat _rotation;
glm::vec3 _hmdPosition; glm::vec3 _hmdPosition;
glm::quat _hmdRotation; glm::quat _hmdRotation;
float _scale;
bool _isKeepLookingAt; bool _isKeepLookingAt;
glm::vec3 _lookingAt; glm::vec3 _lookingAt;
}; };

View file

@ -672,8 +672,6 @@ void MyAvatar::loadData() {
_leanScale = loadSetting(settings, "leanScale", 0.05f); _leanScale = loadSetting(settings, "leanScale", 0.05f);
_targetScale = loadSetting(settings, "scale", 1.0f); _targetScale = loadSetting(settings, "scale", 1.0f);
setScale(_scale); setScale(_scale);
Application::getInstance()->getCamera()->setScale(_scale);
// The old preferences only stored the face and skeleton URLs, we didn't track if the user wanted to use 1 or 2 urls // The old preferences only stored the face and skeleton URLs, we didn't track if the user wanted to use 1 or 2 urls
// for their avatar, So we need to attempt to detect this old case and set our new preferences accordingly. If // for their avatar, So we need to attempt to detect this old case and set our new preferences accordingly. If