resolve conflicts on merge with upstream/master

This commit is contained in:
Stephen Birarda 2015-04-29 10:45:25 -07:00
commit 85919972e3
18 changed files with 57 additions and 34 deletions

View file

@ -2,8 +2,8 @@
* [cmake](http://www.cmake.org/cmake/resources/software.html) ~> 2.8.12.2
* [Qt](http://www.qt.io/download-open-source) ~> 5.4.1
* [OpenSSL](https://www.openssl.org/related/binaries.html) ~> 1.0.1g
* IMPORTANT: OpenSSL 1.0.1g is critical to avoid a security vulnerability.
* [OpenSSL](https://www.openssl.org/related/binaries.html) ~> 1.0.1m
* IMPORTANT: Using the recommended version of OpenSSL is critical to avoid security vulnerabilities.
* [VHACD](https://github.com/virneo/v-hacd)(clone this repository)(Optional)
####CMake External Project Dependencies

View file

@ -71,7 +71,7 @@ Your system may already have several versions of the OpenSSL DLL's (ssleay32.dll
To prevent these problems, install OpenSSL yourself. Download the following binary packages [from this website](http://slproweb.com/products/Win32OpenSSL.html):
* Visual C++ 2008 Redistributables
* Win32 OpenSSL v1.0.1L
* Win32 OpenSSL v1.0.1m
Install OpenSSL into the Windows system directory, to make sure that Qt uses the version that you've just installed, and not some other version.

View file

@ -13,6 +13,7 @@
var createdRenderMenu = false;
var createdGeneratedAudioMenu = false;
var createdStereoInputMenuItem = false;
var DEVELOPER_MENU = "Developer";
@ -28,6 +29,7 @@ var AUDIO_SOURCE_INJECT = "Generated Audio";
var AUDIO_SOURCE_MENU = AUDIO_MENU + " > Generated Audio Source";
var AUDIO_SOURCE_PINK_NOISE = "Pink Noise";
var AUDIO_SOURCE_SINE_440 = "Sine 440hz";
var AUDIO_STEREO_INPUT = "Stereo Input";
function setupMenus() {
@ -78,6 +80,10 @@ function setupMenus() {
Audio.selectPinkNoise();
createdGeneratedAudioMenu = true;
}
if (!Menu.menuItemExists(AUDIO_MENU, AUDIO_STEREO_INPUT)) {
Menu.addMenuItem({ menuName: AUDIO_MENU, menuItemName: AUDIO_STEREO_INPUT, isCheckable: true, isChecked: false });
createdStereoInputMenuItem = true;
}
}
Menu.menuItemEvent.connect(function (menuItem) {
@ -99,6 +105,8 @@ Menu.menuItemEvent.connect(function (menuItem) {
} else if (menuItem == AUDIO_SOURCE_SINE_440 && !createdGeneratedAudioMenu) {
Audio.selectSine440();
Menu.setIsOptionChecked(AUDIO_SOURCE_PINK_NOISE, false);
} else if (menuItem == AUDIO_STEREO_INPUT) {
Audio.setStereoInput(Menu.isOptionChecked(AUDIO_STEREO_INPUT))
}
});
@ -125,6 +133,10 @@ function scriptEnding() {
Menu.removeMenuItem(AUDIO_MENU, AUDIO_SOURCE_INJECT);
Menu.removeMenu(AUDIO_SOURCE_MENU);
}
if (createdStereoInputMenuItem) {
Menu.removeMenuItem(AUDIO_MENU, AUDIO_STEREO_INPUT);
}
}
setupMenus();

View file

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

View file

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

View file

@ -485,8 +485,6 @@ Menu::Menu() {
audioIO.data(), SLOT(toggleServerEcho()));
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoLocalAudio, 0, false,
audioIO.data(), SLOT(toggleLocalEcho()));
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::StereoAudio, 0, false,
audioIO.data(), SLOT(toggleStereoInput()));
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::MuteAudio,
Qt::CTRL | Qt::Key_M,
false,

View file

@ -268,7 +268,6 @@ namespace MenuOption {
const QString ShiftHipsForIdleAnimations = "Shift hips for idle animations";
const QString Stars = "Stars";
const QString Stats = "Stats";
const QString StereoAudio = "Stereo Audio (disables spatial sound)";
const QString StopAllScripts = "Stop All Scripts";
const QString SuppressShortTimings = "Suppress Timings Less than 10ms";
const QString TestPing = "Test Ping";

View file

@ -166,7 +166,6 @@ void MyAvatar::simulate(float deltaTime) {
if (_scale != _targetScale) {
float scale = (1.0f - SMOOTHING_RATIO) * _scale + SMOOTHING_RATIO * _targetScale;
setScale(scale);
Application::getInstance()->getCamera()->setScale(scale);
}
{
@ -673,8 +672,6 @@ void MyAvatar::loadData() {
_leanScale = loadSetting(settings, "leanScale", 0.05f);
_targetScale = loadSetting(settings, "scale", 1.0f);
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
// for their avatar, So we need to attempt to detect this old case and set our new preferences accordingly. If

View file

@ -108,8 +108,6 @@ public:
bool isMuted() { return _muted; }
void setIsStereoInput(bool isStereoInput);
const AudioIOStats& getStats() const { return _stats; }
float getInputRingBufferMsecsAvailable() const;
@ -146,14 +144,14 @@ public slots:
virtual void enableAudioSourceInject(bool enable);
virtual void selectAudioSourcePinkNoise();
virtual void selectAudioSourceSine440();
virtual void setIsStereoInput(bool stereo);
void toggleAudioNoiseReduction() { _isNoiseGateEnabled = !_isNoiseGateEnabled; }
void toggleLocalEcho() { _shouldEchoLocally = !_shouldEchoLocally; }
void toggleServerEcho() { _shouldEchoToServer = !_shouldEchoToServer; }
void toggleStereoInput() { setIsStereoInput(!_isStereoInput); }
void processReceivedSamples(const QByteArray& inputBuffer, QByteArray& outputBuffer);
void sendMuteEnvironmentPacket();

View file

@ -31,6 +31,8 @@ public slots:
virtual void enableAudioSourceInject(bool enable) = 0;
virtual void selectAudioSourcePinkNoise() = 0;
virtual void selectAudioSourceSine440() = 0;
virtual void setIsStereoInput(bool stereo) = 0;
};
Q_DECLARE_METATYPE(AbstractAudioInterface*)

View file

@ -396,7 +396,7 @@ protected:
AABox _localAABox;
SimpleMovingAverage _averageBytesReceived {};
SimpleMovingAverage _averageBytesReceived;
private:
// privatize the copy constructor and assignment operator so they cannot be called

View file

@ -11,6 +11,7 @@
#include <NodeList.h>
#include <PacketHeaders.h>
#include <SharedUtil.h>
#include "AvatarLogging.h"
#include "AvatarHashMap.h"
@ -25,7 +26,7 @@ AvatarHash::iterator AvatarHashMap::erase(const AvatarHash::iterator& iterator)
return _avatarHash.erase(iterator);
}
const qint64 AVATAR_SILENCE_THRESHOLD_USECS = 5 * 1000 * 1000;
const qint64 AVATAR_SILENCE_THRESHOLD_USECS = 5 * USECS_PER_SECOND;
bool AvatarHashMap::shouldKillAvatar(const AvatarSharedPointer& sharedAvatar) {
return (sharedAvatar->getOwningAvatarMixer() == NULL
@ -55,6 +56,17 @@ bool AvatarHashMap::containsAvatarWithDisplayName(const QString& displayName) {
return !avatarWithDisplayName(displayName).isNull();
}
bool AvatarHashMap::isAvatarInRange(const glm::vec3& position, const float range) {
foreach(const AvatarSharedPointer& sharedAvatar, _avatarHash) {
glm::vec3 avatarPosition = sharedAvatar->getPosition();
float distance = glm::distance(avatarPosition, position);
if (distance < range) {
return true;
}
}
return false;
}
AvatarWeakPointer AvatarHashMap::avatarWithDisplayName(const QString& displayName) {
foreach(const AvatarSharedPointer& sharedAvatar, _avatarHash) {
if (sharedAvatar->getDisplayName() == displayName) {

View file

@ -20,6 +20,7 @@
#include <Node.h>
#include "AvatarData.h"
#include <glm/glm.hpp>
typedef QSharedPointer<AvatarData> AvatarSharedPointer;
typedef QWeakPointer<AvatarData> AvatarWeakPointer;
@ -36,6 +37,7 @@ public:
public slots:
void processAvatarMixerDatagram(const QByteArray& datagram, const QWeakPointer<Node>& mixerWeakPointer);
bool containsAvatarWithDisplayName(const QString& displayName);
bool isAvatarInRange(const glm::vec3 & position, const float range);
AvatarWeakPointer avatarWithDisplayName(const QString& displayname);
private slots:

View file

@ -41,8 +41,8 @@ protected:
DynamicCharacterController::DynamicCharacterController(AvatarData* avatarData) {
_halfHeight = 1.0f;
_shape = NULL;
_rigidBody = NULL;
_shape = nullptr;
_rigidBody = nullptr;
assert(avatarData);
_avatarData = avatarData;
@ -262,7 +262,7 @@ void DynamicCharacterController::setDynamicsWorld(btDynamicsWorld* world) {
_dynamicsWorld->removeRigidBody(_rigidBody);
_dynamicsWorld->removeAction(this);
}
_dynamicsWorld = NULL;
_dynamicsWorld = nullptr;
}
if (world && _rigidBody) {
_dynamicsWorld = world;
@ -292,9 +292,9 @@ void DynamicCharacterController::updateShapeIfNecessary() {
_pendingFlags &= ~ PENDING_FLAG_UPDATE_SHAPE;
// delete shape and RigidBody
delete _rigidBody;
_rigidBody = NULL;
_rigidBody = nullptr;
delete _shape;
_shape = NULL;
_shape = nullptr;
// compute new dimensions from avatar's bounding box
float x = _boxScale.x;
@ -314,7 +314,7 @@ void DynamicCharacterController::updateShapeIfNecessary() {
// create new body
float mass = 1.0f;
btVector3 inertia(1.0f, 1.0f, 1.0f);
_rigidBody = new btRigidBody(mass, NULL, _shape, inertia);
_rigidBody = new btRigidBody(mass, nullptr, _shape, inertia);
_rigidBody->setSleepingThresholds(0.0f, 0.0f);
_rigidBody->setAngularFactor(0.0f);
_rigidBody->setWorldTransform(btTransform(glmToBullet(_avatarData->getOrientation()),

View file

@ -30,7 +30,7 @@ protected:
glm::vec3 _shapeLocalOffset;
glm::vec3 _boxScale; // used to compute capsule shape
AvatarData* _avatarData = NULL;
AvatarData* _avatarData = nullptr;
bool _enabled;
bool _isOnGround;
@ -41,7 +41,7 @@ protected:
quint64 _jumpToHoverStart;
uint32_t _pendingFlags;
btDynamicsWorld* _dynamicsWorld = NULL;
btDynamicsWorld* _dynamicsWorld = nullptr;
btScalar _jumpSpeed;
@ -78,7 +78,8 @@ public:
bool needsRemoval() const;
bool needsAddition() const;
void setEnabled(bool enabled);
bool isEnabled() const { return _enabled; }
bool isEnabled() const { return _enabled && _dynamicsWorld; }
void setDynamicsWorld(btDynamicsWorld* world);
void setLocalBoundingBox(const glm::vec3& corner, const glm::vec3& scale);

View file

@ -89,4 +89,8 @@ void AudioScriptingInterface::selectSine440() {
}
}
void AudioScriptingInterface::setStereoInput(bool stereo) {
if (_localAudioInterface) {
_localAudioInterface->setIsStereoInput(stereo);
}
}

View file

@ -32,6 +32,8 @@ protected:
Q_INVOKABLE void injectGeneratedNoise(bool inject);
Q_INVOKABLE void selectPinkNoise();
Q_INVOKABLE void selectSine440();
Q_INVOKABLE void setStereoInput(bool stereo);
signals:
void mutedByMixer();

View file

@ -25,7 +25,7 @@ public:
int getSampleCount() const { return _numSamples; };
float getAverage() const { return _average; };
float getEventDeltaAverage() const; // returned in microseconds
float getEventDeltaAverage() const; // returned in seconds
float getAverageSampleValuePerSecond() const { return _average * (1.0f / getEventDeltaAverage()); }
uint64_t getUsecsSinceLastEvent() const;