Merge branch 'master' of https://github.com/highfidelity/hifi into phrc

This commit is contained in:
Stephen Birarda 2015-09-14 11:21:37 -07:00
commit 302fd923b8
23 changed files with 179 additions and 175 deletions

View file

@ -173,36 +173,46 @@ void AssetServer::sendStatsPacket() {
auto endTimeMs = std::chrono::duration_cast<std::chrono::milliseconds>(stat.second.endTime);
QDateTime date = QDateTime::fromMSecsSinceEpoch(endTimeMs.count());
static const float USEC_PER_SEC = 1000000.0f;
static const float MEGABITS_PER_BYTE = 8.0f / 1000000.0f; // Bytes => Mbits
float elapsed = (float)(stat.second.endTime - stat.second.startTime).count() / USEC_PER_SEC; // sec
float megabitsPerSecPerByte = MEGABITS_PER_BYTE / elapsed; // Bytes => Mb/s
QJsonObject connectionStats;
connectionStats["lastHeard"] = date.toString();
connectionStats["estimatedBandwith"] = stat.second.estimatedBandwith;
connectionStats["rtt"] = stat.second.rtt;
connectionStats["congestionWindowSize"] = stat.second.congestionWindowSize;
connectionStats["packetSendPeriod"] = stat.second.packetSendPeriod;
nodeStats["connection"] = connectionStats;
connectionStats["1. Last Heard"] = date.toString();
connectionStats["2. Est. Max (P/s)"] = stat.second.estimatedBandwith;
connectionStats["3. RTT (ms)"] = stat.second.rtt;
connectionStats["4. CW (P)"] = stat.second.congestionWindowSize;
connectionStats["5. Period (us)"] = stat.second.packetSendPeriod;
connectionStats["6. Up (Mb/s)"] = stat.second.sentBytes * megabitsPerSecPerByte;
connectionStats["7. Down (Mb/s)"] = stat.second.receivedBytes * megabitsPerSecPerByte;
nodeStats["Connection Stats"] = connectionStats;
QJsonObject sendingStats;
sendingStats["sendRate"] = stat.second.sendRate;
sendingStats["sentPackets"] = stat.second.sentPackets;
sendingStats["receivedACK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedACK];
sendingStats["processedACK"] = stat.second.events[udt::ConnectionStats::Stats::ProcessedACK];
sendingStats["receivedLightACK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedLightACK];
sendingStats["receivedNAK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedNAK];
sendingStats["receivedTimeoutNAK"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedTimeoutNAK];
sendingStats["sentACK2"] = stat.second.events[udt::ConnectionStats::Stats::SentACK2];
sendingStats["retransmission"] = stat.second.events[udt::ConnectionStats::Stats::Retransmission];
nodeStats["sending"] = sendingStats;
using Events = udt::ConnectionStats::Stats::Event;
const auto& events = stat.second.events;
QJsonObject receivingStats;
receivingStats["receiveRate"] = stat.second.receiveRate;
receivingStats["receivedPackets"] = stat.second.receivedPackets;
receivingStats["SentACK"] = stat.second.events[udt::ConnectionStats::Stats::SentACK];
receivingStats["SentLightACK"] = stat.second.events[udt::ConnectionStats::Stats::SentLightACK];
receivingStats["SentNAK"] = stat.second.events[udt::ConnectionStats::Stats::SentNAK];
receivingStats["SentTimeoutNAK"] = stat.second.events[udt::ConnectionStats::Stats::SentTimeoutNAK];
receivingStats["ReceivedACK2"] = stat.second.events[udt::ConnectionStats::Stats::ReceivedACK2];
receivingStats["Duplicate"] = stat.second.events[udt::ConnectionStats::Stats::Duplicate];
nodeStats["receiving"] = receivingStats;
QJsonObject upstreamStats;
upstreamStats["1. Sent (P/s)"] = stat.second.sendRate;
upstreamStats["2. Sent Packets"] = stat.second.sentPackets;
upstreamStats["3. Recvd ACK"] = events[Events::ReceivedACK];
upstreamStats["4. Procd ACK"] = events[Events::ProcessedACK];
upstreamStats["5. Recvd LACK"] = events[Events::ReceivedLightACK];
upstreamStats["6. Recvd NAK"] = events[Events::ReceivedNAK];
upstreamStats["7. Recvd TNAK"] = events[Events::ReceivedTimeoutNAK];
upstreamStats["8. Sent ACK2"] = events[Events::SentACK2];
upstreamStats["9. Retransmitted"] = events[Events::Retransmission];
nodeStats["Upstream Stats"] = upstreamStats;
QJsonObject downstreamStats;
downstreamStats["1. Recvd (P/s)"] = stat.second.receiveRate;
downstreamStats["2. Recvd Packets"] = stat.second.receivedPackets;
downstreamStats["3. Sent ACK"] = events[Events::SentACK];
downstreamStats["4. Sent LACK"] = events[Events::SentLightACK];
downstreamStats["5. Sent NAK"] = events[Events::SentNAK];
downstreamStats["6. Sent TNAK"] = events[Events::SentTimeoutNAK];
downstreamStats["7. Recvd ACK2"] = events[Events::ReceivedACK2];
downstreamStats["8. Duplicates"] = events[Events::Duplicate];
nodeStats["Downstream Stats"] = downstreamStats;
QString uuid;
auto nodelist = DependencyManager::get<NodeList>();

View file

@ -9,11 +9,10 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QJsonArray>
#include <QJsonDocument>
#include "OctreeServer.h"
#include <QJsonObject>
#include <QTimer>
#include <QUuid>
#include <time.h>
@ -26,7 +25,6 @@
#include "../AssignmentClient.h"
#include "OctreeServer.h"
#include "OctreeServerConsts.h"
OctreeServer* OctreeServer::_instance = NULL;
@ -1293,80 +1291,72 @@ QString OctreeServer::getStatusLink() {
void OctreeServer::sendStatsPacket() {
// Stats Array 1
QJsonArray threadsStats;
QJsonObject threadsStats;
quint64 oneSecondAgo = usecTimestampNow() - USECS_PER_SECOND;
threadsStats.push_back(QJsonObject({{"processing", (double)howManyThreadsDidProcess(oneSecondAgo)}}));
threadsStats.push_back(QJsonObject({{"packetDistributor", (double)howManyThreadsDidPacketDistributor(oneSecondAgo)}}));
threadsStats.push_back(QJsonObject({{"handlePacektSend", (double)howManyThreadsDidHandlePacketSend(oneSecondAgo)}}));
threadsStats.push_back(QJsonObject({{"writeDatagram", (double)howManyThreadsDidCallWriteDatagram(oneSecondAgo)}}));
threadsStats["1. processing"] = (double)howManyThreadsDidProcess(oneSecondAgo);
threadsStats["2. packetDistributor"] = (double)howManyThreadsDidPacketDistributor(oneSecondAgo);
threadsStats["3. handlePacektSend"] = (double)howManyThreadsDidHandlePacketSend(oneSecondAgo);
threadsStats["4. writeDatagram"] = (double)howManyThreadsDidCallWriteDatagram(oneSecondAgo);
QJsonArray statsArray1;
statsArray1.push_back(QJsonObject({{"configuration", getConfiguration()}}));
statsArray1.push_back(QJsonObject({{"detailed_stats_url", getStatusLink()}}));
statsArray1.push_back(QJsonObject({{"uptime", getUptime()}}));
statsArray1.push_back(QJsonObject({{"persistFileLoadTime", getFileLoadTime()}}));
statsArray1.push_back(QJsonObject({{"clients", getCurrentClientCount()}}));
statsArray1.push_back(QJsonObject({{"threads", threadsStats}}));
QJsonObject statsArray1;
statsArray1["1. configuration"] = getConfiguration();
statsArray1["2. detailed_stats_url"] = getStatusLink();
statsArray1["3. uptime"] = getUptime();
statsArray1["4. persistFileLoadTime"] = getFileLoadTime();
statsArray1["5. clients"] = getCurrentClientCount();
statsArray1["6. threads"] = threadsStats;
// Octree Stats
QJsonArray octreeStats;
octreeStats.push_back(QJsonObject({{"elementCount", (double)OctreeElement::getNodeCount()}}));
octreeStats.push_back(QJsonObject({{"internalElementCount", (double)OctreeElement::getInternalNodeCount()}}));
octreeStats.push_back(QJsonObject({{"leafElementCount", (double)OctreeElement::getLeafNodeCount()}}));
QJsonObject octreeStats;
octreeStats["1. elementCount"] = (double)OctreeElement::getNodeCount();
octreeStats["2. internalElementCount"] = (double)OctreeElement::getInternalNodeCount();
octreeStats["3. leafElementCount"] = (double)OctreeElement::getLeafNodeCount();
// Stats Object 2
QJsonObject dataObject1;
dataObject1["totalPackets"] = (double)OctreeSendThread::_totalPackets;
dataObject1["totalBytes"] = (double)OctreeSendThread::_totalBytes;
dataObject1["totalBytesWasted"] = (double)OctreeSendThread::_totalWastedBytes;
dataObject1["totalBytesOctalCodes"] = (double)OctreePacketData::getTotalBytesOfOctalCodes();
dataObject1["totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfBitMasks();
dataObject1["totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfColor();
dataObject1["1. totalPackets"] = (double)OctreeSendThread::_totalPackets;
dataObject1["2. totalBytes"] = (double)OctreeSendThread::_totalBytes;
dataObject1["3. totalBytesWasted"] = (double)OctreeSendThread::_totalWastedBytes;
dataObject1["4. totalBytesOctalCodes"] = (double)OctreePacketData::getTotalBytesOfOctalCodes();
dataObject1["5. totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfBitMasks();
dataObject1["6. totalBytesBitMasks"] = (double)OctreePacketData::getTotalBytesOfColor();
QJsonArray timingArray1;
timingArray1.push_back(QJsonObject({{"avgLoopTime", getAverageLoopTime()}}));
timingArray1.push_back(QJsonObject({{"avgInsideTime", getAverageInsideTime()}}));
timingArray1.push_back(QJsonObject({{"avgTreeLockTime", getAverageTreeWaitTime()}}));
timingArray1.push_back(QJsonObject({{"avgEncodeTime", getAverageEncodeTime()}}));
timingArray1.push_back(QJsonObject({{"avgCompressAndWriteTime", getAverageCompressAndWriteTime()}}));
timingArray1.push_back(QJsonObject({{"avgSendTime", getAveragePacketSendingTime()}}));
timingArray1.push_back(QJsonObject({{"nodeWaitTime", getAverageNodeWaitTime()}}));
QJsonObject timingArray1;
timingArray1["1. avgLoopTime"] = getAverageLoopTime();
timingArray1["2. avgInsideTime"] = getAverageInsideTime();
timingArray1["3. avgTreeLockTime"] = getAverageTreeWaitTime();
timingArray1["4. avgEncodeTime"] = getAverageEncodeTime();
timingArray1["5. avgCompressAndWriteTime"] = getAverageCompressAndWriteTime();
timingArray1["6. avgSendTime"] = getAveragePacketSendingTime();
timingArray1["7. nodeWaitTime"] = getAverageNodeWaitTime();
QJsonObject statsObject2;
statsObject2["data"] = dataObject1;
statsObject2["timing"] = timingArray1;
// Stats Object 3
QJsonArray dataArray2;
dataArray2.push_back(QJsonObject({{"packetQueue",
(double)_octreeInboundPacketProcessor->packetsToProcessCount()}}));
dataArray2.push_back(QJsonObject({{"totalPackets",
(double)_octreeInboundPacketProcessor->getTotalPacketsProcessed()}}));
dataArray2.push_back(QJsonObject({{"totalElements",
(double)_octreeInboundPacketProcessor->getTotalElementsProcessed()}}));
QJsonObject dataArray2;
dataArray2["1. packetQueue"] = (double)_octreeInboundPacketProcessor->packetsToProcessCount();
dataArray2["2. totalPackets"] = (double)_octreeInboundPacketProcessor->getTotalPacketsProcessed();
dataArray2["3. totalElements"] = (double)_octreeInboundPacketProcessor->getTotalElementsProcessed();
QJsonArray timingArray2;
timingArray2.push_back(QJsonObject({{"avgTransitTimePerPacket",
(double)_octreeInboundPacketProcessor->getAverageTransitTimePerPacket()}}));
timingArray2.push_back(QJsonObject({{"avgProcessTimePerPacket",
(double)_octreeInboundPacketProcessor->getAverageProcessTimePerPacket()}}));
timingArray2.push_back(QJsonObject({{"avgLockWaitTimePerPacket",
(double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerPacket()}}));
timingArray2.push_back(QJsonObject({{"avgProcessTimePerElement",
(double)_octreeInboundPacketProcessor->getAverageProcessTimePerElement()}}));
timingArray2.push_back(QJsonObject({{"avgLockWaitTimePerElement",
(double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerElement()}}));
QJsonObject timingArray2;
timingArray2["1. avgTransitTimePerPacket"] = (double)_octreeInboundPacketProcessor->getAverageTransitTimePerPacket();
timingArray2["2. avgProcessTimePerPacket"] = (double)_octreeInboundPacketProcessor->getAverageProcessTimePerPacket();
timingArray2["3. avgLockWaitTimePerPacket"] = (double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerPacket();
timingArray2["4. avgProcessTimePerElement"] = (double)_octreeInboundPacketProcessor->getAverageProcessTimePerElement();
timingArray2["5. avgLockWaitTimePerElement"] = (double)_octreeInboundPacketProcessor->getAverageLockWaitTimePerElement();
QJsonObject statsObject3;
statsObject3["data"] = dataArray2;
statsObject3["timing"] = timingArray2;
// Merge everything
QJsonArray jsonArray;
jsonArray.push_back(statsArray1);
jsonArray.push_back(QJsonObject({{"octree", octreeStats}}));
jsonArray.push_back(QJsonObject({{"outbound", statsObject2}}));
jsonArray.push_back(QJsonObject({{"inbound", statsObject3}}));
QJsonObject jsonArray;
jsonArray["1. misc"] = statsArray1;
jsonArray["2. octree"] = octreeStats;
jsonArray["3. outbound"] = statsObject2;
jsonArray["4. inbound"] = statsObject3;
QJsonObject statsObject;
statsObject[QString(getMyServerName()) + "Server"] = jsonArray;

View file

@ -5070,7 +5070,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index)
glm::vec3 direction = glm::inverse(_myAvatar->getOrientation()) * palm->getFingerDirection();
// Get the angles, scaled between (-0.5,0.5)
float xAngle = (atan2(direction.z, direction.x) + M_PI_2);
float xAngle = (atan2f(direction.z, direction.x) + (float)M_PI_2);
float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)M_PI_2));
auto canvasSize = qApp->getCanvasSize();
// Get the pixel range over which the xAngle and yAngle are scaled

View file

@ -26,7 +26,7 @@ static const QString FILENAME_FORMAT = "hifi-log_%1_%2.txt";
static const QString DATETIME_FORMAT = "yyyy-MM-dd_hh.mm.ss";
static const QString LOGS_DIRECTORY = "Logs";
// Max log size is 1 MB
static const uint64_t MAX_LOG_SIZE = 1024 * 1024;
static const qint64 MAX_LOG_SIZE = 1024 * 1024;
// Max log age is 1 hour
static const uint64_t MAX_LOG_AGE_USECS = USECS_PER_SECOND * 3600;

View file

@ -6,7 +6,6 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "OpenGLDisplayPlugin.h"
#include <QOpenGLContext>
#include <QCoreApplication>

View file

@ -21,8 +21,20 @@
#include <oglplus/opt/list_init.hpp>
#include <oglplus/shapes/vector.hpp>
#include <oglplus/opt/list_init.hpp>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdouble-promotion"
#endif
#include <oglplus/shapes/obj_mesh.hpp>
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
#include <PerfStat.h>
#include <plugins/PluginContainer.h>
#include <ViewFrustum.h>

View file

@ -184,7 +184,10 @@ void OculusLegacyDisplayPlugin::activate() {
}
});
ovrBool result = ovrHmd_ConfigureRendering(_hmd, &config.Config, distortionCaps, _eyeFovs, _eyeRenderDescs);
#ifndef QT_NO_DEBUG
ovrBool result =
#endif
ovrHmd_ConfigureRendering(_hmd, &config.Config, distortionCaps, _eyeFovs, _eyeRenderDescs);
Q_ASSERT(result);
#endif
}

View file

@ -547,7 +547,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
}
EntityItemPointer entity;
bool success;
bool doTransmit = false;
_entityTree->withWriteLock([&] {
EntitySimulation* simulation = _entityTree->getSimulation();
entity = _entityTree->findEntityByEntityItemID(entityID);
@ -561,14 +561,14 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
return;
}
success = actor(simulation, entity);
if (success) {
doTransmit = actor(simulation, entity);
if (doTransmit) {
_entityTree->entityChanged(entity);
}
});
// transmit the change
if (success) {
if (doTransmit) {
EntityItemProperties properties;
_entityTree->withReadLock([&] {
properties = entity->getProperties();
@ -580,7 +580,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID,
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
}
return success;
return doTransmit;
}
@ -644,7 +644,7 @@ QVector<QUuid> EntityScriptingInterface::getActionIDs(const QUuid& entityID) {
actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
QList<QUuid> actionIDs = entity->getActionIDs();
result = QVector<QUuid>::fromList(actionIDs);
return true;
return false; // don't send an edit packet
});
return result;
}
@ -653,7 +653,7 @@ QVariantMap EntityScriptingInterface::getActionArguments(const QUuid& entityID,
QVariantMap result;
actionWorker(entityID, [&](EntitySimulation* simulation, EntityItemPointer entity) {
result = entity->getActionArguments(actionID);
return true;
return false; // don't send an edit packet
});
return result;
}

View file

@ -18,7 +18,7 @@
#include "EntitiesLogging.h"
#include "EntityTreeElement.h"
EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement(), _entityItems(NULL) {
EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement() {
init(octalCode);
};

View file

@ -73,34 +73,9 @@ EntityItemPointer ParticleEffectEntityItem::factory(const EntityItemID& entityID
// our non-pure virtual subclass for now...
ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
EntityItem(entityItemID),
_maxParticles(DEFAULT_MAX_PARTICLES),
_lifespan(DEFAULT_LIFESPAN),
_emitRate(DEFAULT_EMIT_RATE),
_emitVelocity(DEFAULT_EMIT_VELOCITY),
_velocitySpread(DEFAULT_VELOCITY_SPREAD),
_emitAcceleration(DEFAULT_EMIT_ACCELERATION),
_accelerationSpread(DEFAULT_ACCELERATION_SPREAD),
_particleRadius(DEFAULT_PARTICLE_RADIUS),
_radiusSpread(DEFAULT_RADIUS_SPREAD),
_radiusStart(DEFAULT_RADIUS_START),
_radiusFinish(DEFAULT_RADIUS_FINISH),
_lastAnimated(usecTimestampNow()),
_animationLoop(),
_animationSettings(),
_textures(DEFAULT_TEXTURES),
_texturesChangedFlag(false),
_shapeType(SHAPE_TYPE_NONE),
_colorSpread(DEFAULT_COLOR_SPREAD),
_colorStart(DEFAULT_COLOR),
_colorFinish(DEFAULT_COLOR),
_isColorStartInitialized(false),
_isColorFinishInitialized(false),
_alpha(DEFAULT_ALPHA),
_alphaSpread(DEFAULT_ALPHA_SPREAD),
_alphaStart(DEFAULT_ALPHA_START),
_alphaFinish(DEFAULT_ALPHA_FINISH),
_isAlphaStartInitialized(false),
_isAlphaFinishInitialized(false),
_particleLifetimes(DEFAULT_MAX_PARTICLES, 0.0f),
_particlePositions(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)),
_particleVelocities(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)),
@ -117,9 +92,6 @@ ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityIte
_alphaStarts(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA),
_alphaMiddles(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA),
_alphaFinishes(DEFAULT_MAX_PARTICLES, DEFAULT_ALPHA),
_timeUntilNextEmit(0.0f),
_particleHeadIndex(0),
_particleTailIndex(0),
_particleMaxBound(glm::vec3(1.0f, 1.0f, 1.0f)),
_particleMinBound(glm::vec3(-1.0f, -1.0f, -1.0f)) {

View file

@ -56,11 +56,11 @@ public:
_color[BLUE_INDEX] = value.blue;
}
bool _isColorStartInitialized;
bool _isColorStartInitialized = false;
void setColorStart(const xColor& colorStart) { _colorStart = colorStart; _isColorStartInitialized = true; }
xColor getColorStart() const { return _isColorStartInitialized ? _colorStart : getXColor(); }
bool _isColorFinishInitialized;
bool _isColorFinishInitialized = false;
void setColorFinish(const xColor& colorFinish) { _colorFinish = colorFinish; _isColorFinishInitialized = true; }
xColor getColorFinish() const { return _isColorFinishInitialized ? _colorFinish : getXColor(); }
@ -73,12 +73,12 @@ public:
float getAlpha() const { return _alpha; }
static const float DEFAULT_ALPHA_START;
bool _isAlphaStartInitialized;
bool _isAlphaStartInitialized = false;
void setAlphaStart(float alphaStart) { _alphaStart = alphaStart; _isAlphaStartInitialized = true; }
float getAlphaStart() const { return _isAlphaStartInitialized ? _alphaStart : _alpha; }
static const float DEFAULT_ALPHA_FINISH;
bool _isAlphaFinishInitialized;
bool _isAlphaFinishInitialized = false;
void setAlphaFinish(float alphaFinish) { _alphaFinish = alphaFinish; _isAlphaFinishInitialized = true; }
float getAlphaFinish() const { return _isAlphaFinishInitialized ? _alphaFinish : _alpha; }
@ -192,29 +192,29 @@ protected:
// the properties of this entity
rgbColor _color;
xColor _colorStart;
xColor _colorFinish;
xColor _colorSpread;
float _alpha;
float _alphaStart;
float _alphaFinish;
float _alphaSpread;
quint32 _maxParticles;
float _lifespan;
float _emitRate;
glm::vec3 _emitVelocity;
glm::vec3 _velocitySpread;
glm::vec3 _emitAcceleration;
glm::vec3 _accelerationSpread;
float _particleRadius;
float _radiusStart;
float _radiusFinish;
float _radiusSpread;
xColor _colorStart = DEFAULT_COLOR;
xColor _colorFinish = DEFAULT_COLOR;
xColor _colorSpread = DEFAULT_COLOR_SPREAD;
float _alpha = DEFAULT_ALPHA;
float _alphaStart = DEFAULT_ALPHA_START;
float _alphaFinish = DEFAULT_ALPHA_FINISH;
float _alphaSpread = DEFAULT_ALPHA_SPREAD;
quint32 _maxParticles = DEFAULT_MAX_PARTICLES;
float _lifespan = DEFAULT_LIFESPAN;
float _emitRate = DEFAULT_EMIT_RATE;
glm::vec3 _emitVelocity = DEFAULT_EMIT_VELOCITY;
glm::vec3 _velocitySpread = DEFAULT_VELOCITY_SPREAD;
glm::vec3 _emitAcceleration = DEFAULT_EMIT_ACCELERATION;
glm::vec3 _accelerationSpread = DEFAULT_ACCELERATION_SPREAD;
float _particleRadius = DEFAULT_PARTICLE_RADIUS;
float _radiusStart = DEFAULT_RADIUS_START;
float _radiusFinish = DEFAULT_RADIUS_FINISH;
float _radiusSpread = DEFAULT_RADIUS_SPREAD;
quint64 _lastAnimated;
AnimationLoop _animationLoop;
QString _animationSettings;
QString _textures;
bool _texturesChangedFlag;
QString _textures = DEFAULT_TEXTURES;
bool _texturesChangedFlag = false;
ShapeType _shapeType = SHAPE_TYPE_NONE;
// all the internals of running the particle sim
@ -235,12 +235,12 @@ protected:
QVector<float> _alphaMiddles;
QVector<float> _alphaFinishes;
float _timeUntilNextEmit;
float _timeUntilNextEmit = 0.0f;
// particle arrays are a ring buffer, use these indices
// to keep track of the living particles.
quint32 _particleHeadIndex;
quint32 _particleTailIndex;
quint32 _particleHeadIndex = 0;
quint32 _particleTailIndex = 0;
// bounding volume
glm::vec3 _particleMaxBound;

View file

@ -1129,6 +1129,8 @@ ExtractedMesh extractMesh(const FBXNode& object, unsigned int& meshIndex) {
if (isMaterialPerPolygon) {
isMultiMaterial = true;
}
// TODO: make excellent use of isMultiMaterial
Q_UNUSED(isMultiMaterial);
// convert the polygons to quads and triangles
int polygonIndex = 0;

View file

@ -33,6 +33,7 @@ HifiSockAddr::HifiSockAddr(const QHostAddress& address, quint16 port) :
}
HifiSockAddr::HifiSockAddr(const HifiSockAddr& otherSockAddr) :
QObject(),
_address(otherSockAddr._address),
_port(otherSockAddr._port)
{

View file

@ -202,8 +202,8 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius
glm::vec3 zRing[NUM_CIRCLE_SLICES + 1];
const float dTheta = (2.0f * (float)M_PI) / NUM_CIRCLE_SLICES;
for (int i = 0; i < NUM_CIRCLE_SLICES + 1; i++) {
float rCosTheta = radius * cos(dTheta * i);
float rSinTheta = radius * sin(dTheta * i);
float rCosTheta = radius * cosf(dTheta * i);
float rSinTheta = radius * sinf(dTheta * i);
xRing[i] = finalPose * glm::vec3(0.0f, rCosTheta, rSinTheta);
yRing[i] = finalPose * glm::vec3(rCosTheta, 0.0f, rSinTheta);
zRing[i] = finalPose * glm::vec3(rCosTheta, rSinTheta, 0.0f);

View file

@ -110,10 +110,10 @@ void Antialiasing::run(const render::SceneContextPointer& sceneContext, const re
QSize framebufferSize = framebufferCache->getFrameBufferSize();
float fbWidth = framebufferSize.width();
float fbHeight = framebufferSize.height();
float sMin = args->_viewport.x / fbWidth;
float sWidth = args->_viewport.z / fbWidth;
float tMin = args->_viewport.y / fbHeight;
float tHeight = args->_viewport.w / fbHeight;
// float sMin = args->_viewport.x / fbWidth;
// float sWidth = args->_viewport.z / fbWidth;
// float tMin = args->_viewport.y / fbHeight;
// float tHeight = args->_viewport.w / fbHeight;
glm::mat4 projMat;
Transform viewMat;
@ -136,14 +136,14 @@ void Antialiasing::run(const render::SceneContextPointer& sceneContext, const re
args->_viewFrustum->computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane);
float depthScale = (farVal - nearVal) / farVal;
float nearScale = -1.0f / nearVal;
float depthTexCoordScaleS = (right - left) * nearScale / sWidth;
float depthTexCoordScaleT = (top - bottom) * nearScale / tHeight;
float depthTexCoordOffsetS = left * nearScale - sMin * depthTexCoordScaleS;
float depthTexCoordOffsetT = bottom * nearScale - tMin * depthTexCoordScaleT;
// float depthScale = (farVal - nearVal) / farVal;
// float nearScale = -1.0f / nearVal;
// float depthTexCoordScaleS = (right - left) * nearScale / sWidth;
// float depthTexCoordScaleT = (top - bottom) * nearScale / tHeight;
// float depthTexCoordOffsetS = left * nearScale - sMin * depthTexCoordScaleS;
// float depthTexCoordOffsetT = bottom * nearScale - tMin * depthTexCoordScaleT;
batch._glUniform2f(_texcoordOffsetLoc, 1.0 / fbWidth, 1.0 / fbHeight);
batch._glUniform2f(_texcoordOffsetLoc, 1.0f / fbWidth, 1.0f / fbHeight);
glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f);
glm::vec2 bottomLeft(-1.0f, -1.0f);

View file

@ -43,7 +43,10 @@ bool GlWindow::makeCurrent() {
qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
});
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
#ifndef QT_NO_DEBUG
QOpenGLContext * currentContext =
#endif
QOpenGLContext::currentContext();
Q_ASSERT(_context == currentContext);
return makeCurrentResult;
}

View file

@ -1745,6 +1745,8 @@ void Model::segregateMeshGroups() {
if (wireframe) {
translucentMesh = hasTangents = hasSpecular = hasLightmap = isSkinned = false;
}
// TODO: make excellent use of translucentMesh
Q_UNUSED(translucentMesh);
// Create the render payloads
int totalParts = mesh.parts.size();

View file

@ -94,8 +94,8 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam
_isListeningToAudioStream(false),
_avatarSound(NULL),
_numAvatarSoundSentBytes(0),
_controllerScriptingInterface(controllerScriptingInterface),
_wantSignals(wantSignals),
_controllerScriptingInterface(controllerScriptingInterface),
_avatarData(NULL),
_scriptName(),
_fileNameString(fileNameString),

View file

@ -156,7 +156,7 @@ protected:
bool _isAgent = false;
QSet<QUrl> _includedURLs;
bool _wantSignals = true;
private:
void stopAllTimers();
void sendAvatarIdentityPacket();

View file

@ -129,7 +129,7 @@ template<typename T> inline size_t ByteCountCoded<T>::decode(const char* encoded
bool inLeadBits = true;
int bitAt = 0;
int expectedBitCount; // unknown at this point
int lastValueBit;
int lastValueBit = 0;
T bitValue = 1;
for(int byte = 0; byte < encodedSize; byte++) {

View file

@ -207,7 +207,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
bool inLeadBits = true;
int bitAt = 0;
int expectedBitCount; // unknown at this point
int lastValueBit;
int lastValueBit = 0;
for (unsigned int byte = 0; byte < size; byte++) {
char originalByte = data[byte];
bytesConsumed++;

View file

@ -108,7 +108,10 @@ void VrMenu::addMenu(QMenu* menu) {
Q_ASSERT(false);
}
QVariant returnedValue;
bool invokeResult = QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
@ -146,8 +149,11 @@ void VrMenu::addAction(QMenu* menu, QAction* action) {
MenuUserData* userData = MenuUserData::forObject(menu);
QObject* menuQml = findMenuObject(userData->uuid.toString());
Q_ASSERT(menuQml);
QVariant returnedValue;
bool invokeResult = QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
QVariant returnedValue;
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
Q_ARG(QVariant, QVariant::fromValue(action->text())));
@ -167,7 +173,10 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
}
QObject* menu = beforeQml->parent();
QVariant returnedValue;
bool invokeResult = QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
#ifndef QT_NO_DEBUG
bool invokeResult =
#endif
QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue(menu)),
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),

View file

@ -93,8 +93,9 @@ template <typename T>
void testByteCountCoded() {
testByteCountCodedStable<T>(0);
testByteCountCodedStable<T>(1);
testByteCountCodedStable<T>(1 << 8*sizeof(T));
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8*sizeof(T));
// These two can't possibly be right. TODO: figure out what was being tested, here
// testByteCountCodedStable<T>(1 << 8*sizeof(T));
// testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8*sizeof(T));
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8);
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 1);
testByteCountCodedStable<T>(std::numeric_limits<T>::max());