mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
commit
d084e58f48
14 changed files with 27 additions and 32 deletions
|
@ -176,7 +176,7 @@ bool AudioMixerSlave::prepareMix(const SharedNodePointer& listener) {
|
|||
auto nodeID = node->getUUID();
|
||||
|
||||
// compute the node's max relative volume
|
||||
float nodeVolume;
|
||||
float nodeVolume = 0.0f;
|
||||
for (auto& streamPair : nodeData->getAudioStreams()) {
|
||||
auto nodeStream = streamPair.second;
|
||||
|
||||
|
@ -193,10 +193,8 @@ bool AudioMixerSlave::prepareMix(const SharedNodePointer& listener) {
|
|||
}
|
||||
|
||||
// max-heapify the nodes by relative volume
|
||||
throttledNodes.push_back(std::make_pair(nodeVolume, node));
|
||||
if (!throttledNodes.empty()) {
|
||||
std::push_heap(throttledNodes.begin(), throttledNodes.end());
|
||||
}
|
||||
throttledNodes.push_back({ nodeVolume, node });
|
||||
std::push_heap(throttledNodes.begin(), throttledNodes.end());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -121,13 +121,13 @@ void AvatarBookmarks::addBookmark() {
|
|||
const QVariant& avatarScale = myAvatar->getAvatarScale();
|
||||
|
||||
// If Avatar attachments ever change, this is where to update them, when saving remember to also append to AVATAR_BOOKMARK_VERSION
|
||||
QVariantMap *bookmark = new QVariantMap;
|
||||
bookmark->insert(ENTRY_VERSION, AVATAR_BOOKMARK_VERSION);
|
||||
bookmark->insert(ENTRY_AVATAR_URL, avatarUrl);
|
||||
bookmark->insert(ENTRY_AVATAR_SCALE, avatarScale);
|
||||
bookmark->insert(ENTRY_AVATAR_ATTACHMENTS, myAvatar->getAttachmentsVariant());
|
||||
QVariantMap bookmark;
|
||||
bookmark.insert(ENTRY_VERSION, AVATAR_BOOKMARK_VERSION);
|
||||
bookmark.insert(ENTRY_AVATAR_URL, avatarUrl);
|
||||
bookmark.insert(ENTRY_AVATAR_SCALE, avatarScale);
|
||||
bookmark.insert(ENTRY_AVATAR_ATTACHMENTS, myAvatar->getAttachmentsVariant());
|
||||
|
||||
Bookmarks::addBookmarkToFile(bookmarkName, *bookmark);
|
||||
Bookmarks::addBookmarkToFile(bookmarkName, bookmark);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -144,13 +144,13 @@ void AvatarEntitiesBookmarks::addBookmark() {
|
|||
const QString& avatarUrl = myAvatar->getSkeletonModelURL().toString();
|
||||
const QVariant& avatarScale = myAvatar->getAvatarScale();
|
||||
|
||||
QVariantMap *bookmark = new QVariantMap;
|
||||
bookmark->insert(ENTRY_VERSION, AVATAR_ENTITIES_BOOKMARK_VERSION);
|
||||
bookmark->insert(ENTRY_AVATAR_URL, avatarUrl);
|
||||
bookmark->insert(ENTRY_AVATAR_SCALE, avatarScale);
|
||||
bookmark->insert(ENTRY_AVATAR_ENTITIES, myAvatar->getAvatarEntitiesVariant());
|
||||
QVariantMap bookmark;
|
||||
bookmark.insert(ENTRY_VERSION, AVATAR_ENTITIES_BOOKMARK_VERSION);
|
||||
bookmark.insert(ENTRY_AVATAR_URL, avatarUrl);
|
||||
bookmark.insert(ENTRY_AVATAR_SCALE, avatarScale);
|
||||
bookmark.insert(ENTRY_AVATAR_ENTITIES, myAvatar->getAvatarEntitiesVariant());
|
||||
|
||||
Bookmarks::addBookmarkToFile(bookmarkName, *bookmark);
|
||||
Bookmarks::addBookmarkToFile(bookmarkName, bookmark);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1244,7 +1244,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab
|
|||
int handJointIndex = _animSkeleton->nameToJointIndex("LeftHand");
|
||||
int armJointIndex = _animSkeleton->nameToJointIndex("LeftArm");
|
||||
int elbowJointIndex = _animSkeleton->nameToJointIndex("LeftForeArm");
|
||||
if (!leftArmEnabled && elbowJointIndex >= 0 && armJointIndex >= 0 && elbowJointIndex >= 0) {
|
||||
if (!leftArmEnabled && handJointIndex >= 0 && armJointIndex >= 0 && elbowJointIndex >= 0) {
|
||||
glm::vec3 poleVector = calculateElbowPoleVector(handJointIndex, elbowJointIndex, armJointIndex, hipsIndex, true);
|
||||
|
||||
// smooth toward desired pole vector from previous pole vector... to reduce jitter
|
||||
|
@ -1291,7 +1291,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab
|
|||
int handJointIndex = _animSkeleton->nameToJointIndex("RightHand");
|
||||
int armJointIndex = _animSkeleton->nameToJointIndex("RightArm");
|
||||
int elbowJointIndex = _animSkeleton->nameToJointIndex("RightForeArm");
|
||||
if (!rightArmEnabled && elbowJointIndex >= 0 && armJointIndex >= 0 && elbowJointIndex >= 0) {
|
||||
if (!rightArmEnabled && handJointIndex >= 0 && armJointIndex >= 0 && elbowJointIndex >= 0) {
|
||||
glm::vec3 poleVector = calculateElbowPoleVector(handJointIndex, elbowJointIndex, armJointIndex, hipsIndex, false);
|
||||
|
||||
// smooth toward desired pole vector from previous pole vector... to reduce jitter
|
||||
|
|
|
@ -666,7 +666,7 @@ bool AddressManager::handleViewpoint(const QString& viewpointString, bool should
|
|||
}
|
||||
|
||||
emit locationChangeRequired(newPosition, orientationChanged,
|
||||
LookupTrigger::VisitUserFromPAL ? cancelOutRollAndPitch(newOrientation): newOrientation,
|
||||
trigger == LookupTrigger::VisitUserFromPAL ? cancelOutRollAndPitch(newOrientation): newOrientation,
|
||||
shouldFace
|
||||
);
|
||||
|
||||
|
|
|
@ -989,7 +989,7 @@ void NodeList::setAvatarGain(const QUuid& nodeID, float gain) {
|
|||
}
|
||||
|
||||
sendPacket(std::move(setAvatarGainPacket), *audioMixer);
|
||||
QWriteLocker{ &_avatarGainMapLock };
|
||||
QWriteLocker lock{ &_avatarGainMapLock };
|
||||
_avatarGainMap[nodeID] = gain;
|
||||
|
||||
} else {
|
||||
|
@ -1001,7 +1001,7 @@ void NodeList::setAvatarGain(const QUuid& nodeID, float gain) {
|
|||
}
|
||||
|
||||
float NodeList::getAvatarGain(const QUuid& nodeID) {
|
||||
QReadLocker{ &_avatarGainMapLock };
|
||||
QReadLocker lock{ &_avatarGainMapLock };
|
||||
auto it = _avatarGainMap.find(nodeID);
|
||||
if (it != _avatarGainMap.cend()) {
|
||||
return it->second;
|
||||
|
|
|
@ -214,9 +214,10 @@ const DisplayPluginList& PluginManager::getDisplayPlugins() {
|
|||
}
|
||||
|
||||
void PluginManager::disableDisplayPlugin(const QString& name) {
|
||||
std::remove_if(_displayPlugins.begin(), _displayPlugins.end(), [&](const DisplayPluginPointer& plugin){
|
||||
auto it = std::remove_if(_displayPlugins.begin(), _displayPlugins.end(), [&](const DisplayPluginPointer& plugin){
|
||||
return plugin->getName() == name;
|
||||
});
|
||||
_displayPlugins.erase(it, _displayPlugins.end());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -187,14 +187,14 @@ void Deck::processFrames() {
|
|||
|
||||
void Deck::removeClip(const ClipConstPointer& clip) {
|
||||
Locker lock(_mutex);
|
||||
std::remove_if(_clips.begin(), _clips.end(), [&](const Clip::ConstPointer& testClip)->bool {
|
||||
_clips.remove_if([&](const Clip::ConstPointer& testClip)->bool {
|
||||
return (clip == testClip);
|
||||
});
|
||||
}
|
||||
|
||||
void Deck::removeClip(const QString& clipName) {
|
||||
Locker lock(_mutex);
|
||||
std::remove_if(_clips.begin(), _clips.end(), [&](const Clip::ConstPointer& clip)->bool {
|
||||
_clips.remove_if([&](const Clip::ConstPointer& clip)->bool {
|
||||
return (clip->getName() == clipName);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -749,8 +749,6 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) {
|
|||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
{
|
||||
PROFILE_RANGE(render, "Process Default Skybox");
|
||||
auto textureCache = DependencyManager::get<TextureCache>();
|
||||
|
||||
QFileSelector fileSelector;
|
||||
fileSelector.setExtraSelectors(FileUtils::getFileSelectors());
|
||||
auto skyboxUrl = fileSelector.select(PathUtils::resourcesPath() + "images/Default-Sky-9-cubemap.ktx");
|
||||
|
|
|
@ -66,7 +66,7 @@ void qListtoRgbColor(const QVariant& q, rgbColor& returnValue) {
|
|||
|
||||
glm::vec3 qMapToGlmVec3(const QVariant& q) {
|
||||
QVariantMap qMap = q.toMap();
|
||||
if (qMap.contains("x") && qMap.contains("y") && qMap.contains("y")) {
|
||||
if (qMap.contains("x") && qMap.contains("y") && qMap.contains("z")) {
|
||||
return glm::vec3(
|
||||
qMap["x"].toFloat(),
|
||||
qMap["y"].toFloat(),
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
protected:
|
||||
|
||||
bool _isBalanced{ false };
|
||||
TriangleOctreeCell _triangleOctree;
|
||||
std::vector<Triangle> _triangles;
|
||||
TriangleOctreeCell _triangleOctree;
|
||||
AABox _bounds;
|
||||
};
|
||||
|
|
|
@ -37,7 +37,6 @@ static const uvec2 MIN_QML_WINDOW_SIZE { 120, 80 };
|
|||
|
||||
QVariantMap QmlWindowClass::parseArguments(QScriptContext* context) {
|
||||
const auto argumentCount = context->argumentCount();
|
||||
QString title;
|
||||
QVariantMap properties;
|
||||
if (argumentCount > 1) {
|
||||
if (!context->argument(0).isUndefined()) {
|
||||
|
|
|
@ -300,7 +300,6 @@ QAction* Menu::getActionFromName(const QString& menuName, MenuWrapper* menu) {
|
|||
}
|
||||
|
||||
foreach (QAction* menuAction, menuActions) {
|
||||
QString actionText = menuAction->text();
|
||||
if (menuName == menuAction->text()) {
|
||||
return menuAction;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
|
|||
std::array<glm::mat4, 2> handPoses;
|
||||
// Make controller poses available to the presentation thread
|
||||
ovr_for_each_hand([&](ovrHandType hand) {
|
||||
static const auto REQUIRED_HAND_STATUS = ovrStatus_OrientationTracked & ovrStatus_PositionTracked;
|
||||
static const auto REQUIRED_HAND_STATUS = ovrStatus_OrientationTracked | ovrStatus_PositionTracked;
|
||||
if (REQUIRED_HAND_STATUS != (trackingState.HandStatusFlags[hand] & REQUIRED_HAND_STATUS)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue