mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 23:23:11 +02:00
commit
63c3f7c1a7
86 changed files with 224 additions and 210 deletions
|
@ -384,7 +384,7 @@ void Agent::processAgentAvatarAndAudio(float deltaTime) {
|
||||||
int numAvailableBytes = (soundByteArray.size() - _numAvatarSoundSentBytes) > SCRIPT_AUDIO_BUFFER_BYTES
|
int numAvailableBytes = (soundByteArray.size() - _numAvatarSoundSentBytes) > SCRIPT_AUDIO_BUFFER_BYTES
|
||||||
? SCRIPT_AUDIO_BUFFER_BYTES
|
? SCRIPT_AUDIO_BUFFER_BYTES
|
||||||
: soundByteArray.size() - _numAvatarSoundSentBytes;
|
: soundByteArray.size() - _numAvatarSoundSentBytes;
|
||||||
numAvailableSamples = numAvailableBytes / sizeof(int16_t);
|
numAvailableSamples = (int16_t)numAvailableBytes / sizeof(int16_t);
|
||||||
|
|
||||||
|
|
||||||
// check if the all of the _numAvatarAudioBufferSamples to be sent are silence
|
// check if the all of the _numAvatarAudioBufferSamples to be sent are silence
|
||||||
|
|
|
@ -171,7 +171,7 @@ void AudioMixerClientData::sendAudioStreamStatsPackets(const SharedNodePointer&
|
||||||
statsPacket->writePrimitive(appendFlag);
|
statsPacket->writePrimitive(appendFlag);
|
||||||
appendFlag = 1;
|
appendFlag = 1;
|
||||||
|
|
||||||
int numStreamStatsRoomFor = (statsPacket->size() - sizeof(quint8) - sizeof(quint16)) / sizeof(AudioStreamStats);
|
int numStreamStatsRoomFor = (int)(statsPacket->size() - sizeof(quint8) - sizeof(quint16)) / sizeof(AudioStreamStats);
|
||||||
|
|
||||||
// calculate and pack the number of stream stats to follow
|
// calculate and pack the number of stream stats to follow
|
||||||
quint16 numStreamStatsToPack = std::min(numStreamStatsRemaining, numStreamStatsRoomFor);
|
quint16 numStreamStatsToPack = std::min(numStreamStatsRemaining, numStreamStatsRoomFor);
|
||||||
|
|
|
@ -293,7 +293,7 @@ int OctreeInboundPacketProcessor::sendNackPackets() {
|
||||||
|
|
||||||
qDebug() << "NACK Sent back to editor/client... destinationNode=" << nodeUUID;
|
qDebug() << "NACK Sent back to editor/client... destinationNode=" << nodeUUID;
|
||||||
|
|
||||||
packetsSent += nackPacketList->getNumPackets();
|
packetsSent += (int)nackPacketList->getNumPackets();
|
||||||
|
|
||||||
// send the list of nack packets
|
// send the list of nack packets
|
||||||
totalBytesSent += nodeList->sendPacketList(std::move(nackPacketList), *destinationNode);
|
totalBytesSent += nodeList->sendPacketList(std::move(nackPacketList), *destinationNode);
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
#include <QtNetwork/QNetworkDiskCache>
|
#include <QtNetwork/QNetworkDiskCache>
|
||||||
|
|
||||||
#include <gl/Config.h>
|
#include <gl/Config.h>
|
||||||
#include <QOpenGLContextWrapper.h>
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
|
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
|
@ -3054,7 +3054,7 @@ int Application::sendNackPackets() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nackPacketList->getNumPackets()) {
|
if (nackPacketList->getNumPackets()) {
|
||||||
packetsSent += nackPacketList->getNumPackets();
|
packetsSent += (int)nackPacketList->getNumPackets();
|
||||||
|
|
||||||
// send the packet list
|
// send the packet list
|
||||||
nodeList->sendPacketList(std::move(nackPacketList), *node);
|
nodeList->sendPacketList(std::move(nackPacketList), *node);
|
||||||
|
|
|
@ -100,25 +100,25 @@ public:
|
||||||
/// Returns the distance to use as a LOD parameter.
|
/// Returns the distance to use as a LOD parameter.
|
||||||
float getLODDistance() const;
|
float getLODDistance() const;
|
||||||
|
|
||||||
virtual bool isMyAvatar() const { return false; }
|
virtual bool isMyAvatar() const override { return false; }
|
||||||
|
|
||||||
virtual QVector<glm::quat> getJointRotations() const;
|
virtual QVector<glm::quat> getJointRotations() const override;
|
||||||
virtual glm::quat getJointRotation(int index) const;
|
virtual glm::quat getJointRotation(int index) const override;
|
||||||
virtual glm::vec3 getJointTranslation(int index) const;
|
virtual glm::vec3 getJointTranslation(int index) const override;
|
||||||
virtual int getJointIndex(const QString& name) const;
|
virtual int getJointIndex(const QString& name) const override;
|
||||||
virtual QStringList getJointNames() const;
|
virtual QStringList getJointNames() const override;
|
||||||
|
|
||||||
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
|
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
|
||||||
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
|
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
|
||||||
|
|
||||||
virtual void setFaceModelURL(const QUrl& faceModelURL);
|
virtual void setFaceModelURL(const QUrl& faceModelURL) override;
|
||||||
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
|
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
|
||||||
virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData);
|
virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData) override;
|
||||||
virtual void setBillboard(const QByteArray& billboard);
|
virtual void setBillboard(const QByteArray& billboard) override;
|
||||||
|
|
||||||
void setShowDisplayName(bool showDisplayName);
|
void setShowDisplayName(bool showDisplayName);
|
||||||
|
|
||||||
virtual int parseDataFromBuffer(const QByteArray& buffer);
|
virtual int parseDataFromBuffer(const QByteArray& buffer) override;
|
||||||
|
|
||||||
static void renderJointConnectingCone( gpu::Batch& batch, glm::vec3 position1, glm::vec3 position2,
|
static void renderJointConnectingCone( gpu::Batch& batch, glm::vec3 position1, glm::vec3 position2,
|
||||||
float radius1, float radius2, const glm::vec4& color);
|
float radius1, float radius2, const glm::vec4& color);
|
||||||
|
@ -144,7 +144,7 @@ public:
|
||||||
void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const;
|
void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const;
|
||||||
|
|
||||||
void slamPosition(const glm::vec3& position);
|
void slamPosition(const glm::vec3& position);
|
||||||
virtual void updateAttitude() { _skeletonModel.updateAttitude(); }
|
virtual void updateAttitude() override { _skeletonModel.updateAttitude(); }
|
||||||
|
|
||||||
// Call this when updating Avatar position with a delta. This will allow us to
|
// Call this when updating Avatar position with a delta. This will allow us to
|
||||||
// _accurately_ measure position changes and compute the resulting velocity
|
// _accurately_ measure position changes and compute the resulting velocity
|
||||||
|
@ -217,7 +217,7 @@ protected:
|
||||||
virtual bool shouldRenderHead(const RenderArgs* renderArgs) const;
|
virtual bool shouldRenderHead(const RenderArgs* renderArgs) const;
|
||||||
virtual void fixupModelsInScene();
|
virtual void fixupModelsInScene();
|
||||||
|
|
||||||
virtual void updateJointMappings();
|
virtual void updateJointMappings() override;
|
||||||
|
|
||||||
render::ItemID _renderItemID;
|
render::ItemID _renderItemID;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ DeviceTracker::SingletonData::~SingletonData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int DeviceTracker::getNumDevices() {
|
int DeviceTracker::getNumDevices() {
|
||||||
return Singleton::get()->_devicesMap.size();
|
return (int)Singleton::get()->_devicesMap.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceTracker::ID DeviceTracker::getDeviceID(const Name& name) {
|
DeviceTracker::ID DeviceTracker::getDeviceID(const Name& name) {
|
||||||
|
@ -58,7 +58,7 @@ DeviceTracker::ID DeviceTracker::registerDevice(const Name& name, DeviceTracker*
|
||||||
}
|
}
|
||||||
|
|
||||||
// Good to register the device
|
// Good to register the device
|
||||||
deviceID = Singleton::get()->_devicesVector.size();
|
deviceID = (ID)Singleton::get()->_devicesVector.size();
|
||||||
Singleton::get()->_devicesMap.insert(Map::value_type(name, deviceID));
|
Singleton::get()->_devicesMap.insert(Map::value_type(name, deviceID));
|
||||||
Singleton::get()->_devicesVector.push_back(device);
|
Singleton::get()->_devicesVector.push_back(device);
|
||||||
device->assignIDAndName(deviceID, name);
|
device->assignIDAndName(deviceID, name);
|
||||||
|
|
|
@ -255,7 +255,7 @@ void Faceshift::receive(const QByteArray& buffer) {
|
||||||
}
|
}
|
||||||
case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
|
case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
|
||||||
const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
|
const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
|
||||||
for (size_t i = 0; i < names.size(); i++) {
|
for (int i = 0; i < (int)names.size(); i++) {
|
||||||
if (names[i] == "EyeBlink_L") {
|
if (names[i] == "EyeBlink_L") {
|
||||||
_leftBlinkIndex = i;
|
_leftBlinkIndex = i;
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ MotionTracker::Index MotionTracker::addJoint(const Semantic& semantic, Index par
|
||||||
|
|
||||||
|
|
||||||
// All good then allocate the joint
|
// All good then allocate the joint
|
||||||
Index newIndex = _jointsArray.size();
|
Index newIndex = (Index)_jointsArray.size();
|
||||||
_jointsArray.push_back(JointTracker(semantic, parent));
|
_jointsArray.push_back(JointTracker(semantic, parent));
|
||||||
_jointsMap.insert(JointTracker::Map::value_type(semantic, newIndex));
|
_jointsMap.insert(JointTracker::Map::value_type(semantic, newIndex));
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ public:
|
||||||
|
|
||||||
virtual bool isConnected() const;
|
virtual bool isConnected() const;
|
||||||
|
|
||||||
Index numJointTrackers() const { return _jointsArray.size(); }
|
Index numJointTrackers() const { return (Index)_jointsArray.size(); }
|
||||||
|
|
||||||
/// Access a Joint from it's index.
|
/// Access a Joint from it's index.
|
||||||
/// Index 0 is always the "Root".
|
/// Index 0 is always the "Root".
|
||||||
|
|
|
@ -118,7 +118,7 @@ void Stats::updateStats(bool force) {
|
||||||
STAT_UPDATE(avatarCount, avatarManager->size() - 1);
|
STAT_UPDATE(avatarCount, avatarManager->size() - 1);
|
||||||
STAT_UPDATE(avatarRenderableCount, avatarManager->getNumberInRenderRange());
|
STAT_UPDATE(avatarRenderableCount, avatarManager->getNumberInRenderRange());
|
||||||
STAT_UPDATE(avatarRenderDistance, (int) round(avatarManager->getRenderDistance())); // deliberately truncating
|
STAT_UPDATE(avatarRenderDistance, (int) round(avatarManager->getRenderDistance())); // deliberately truncating
|
||||||
STAT_UPDATE(serverCount, nodeList->size());
|
STAT_UPDATE(serverCount, (int)nodeList->size());
|
||||||
STAT_UPDATE(renderrate, (int)qApp->getFps());
|
STAT_UPDATE(renderrate, (int)qApp->getFps());
|
||||||
if (qApp->getActiveDisplayPlugin()) {
|
if (qApp->getActiveDisplayPlugin()) {
|
||||||
STAT_UPDATE(presentrate, (int)round(qApp->getActiveDisplayPlugin()->presentRate()));
|
STAT_UPDATE(presentrate, (int)round(qApp->getActiveDisplayPlugin()->presentRate()));
|
||||||
|
@ -270,7 +270,7 @@ void Stats::updateStats(bool force) {
|
||||||
if (voxelPacketsToProcess == 0) {
|
if (voxelPacketsToProcess == 0) {
|
||||||
_resetRecentMaxPacketsSoon = true;
|
_resetRecentMaxPacketsSoon = true;
|
||||||
} else if (voxelPacketsToProcess > _recentMaxPackets) {
|
} else if (voxelPacketsToProcess > _recentMaxPackets) {
|
||||||
_recentMaxPackets = voxelPacketsToProcess;
|
_recentMaxPackets = (int)voxelPacketsToProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server Octree Elements
|
// Server Octree Elements
|
||||||
|
@ -344,18 +344,18 @@ void Stats::setRenderDetails(const RenderDetails& details) {
|
||||||
STAT_UPDATE(triangles, details._trianglesRendered);
|
STAT_UPDATE(triangles, details._trianglesRendered);
|
||||||
STAT_UPDATE(materialSwitches, details._materialSwitches);
|
STAT_UPDATE(materialSwitches, details._materialSwitches);
|
||||||
if (_expanded) {
|
if (_expanded) {
|
||||||
STAT_UPDATE(opaqueConsidered, details._opaque._considered);
|
STAT_UPDATE(opaqueConsidered, (int)details._opaque._considered);
|
||||||
STAT_UPDATE(opaqueOutOfView, details._opaque._outOfView);
|
STAT_UPDATE(opaqueOutOfView, details._opaque._outOfView);
|
||||||
STAT_UPDATE(opaqueTooSmall, details._opaque._tooSmall);
|
STAT_UPDATE(opaqueTooSmall, details._opaque._tooSmall);
|
||||||
STAT_UPDATE(opaqueRendered, details._opaque._rendered);
|
STAT_UPDATE(opaqueRendered, (int)details._opaque._rendered);
|
||||||
STAT_UPDATE(translucentConsidered, details._translucent._considered);
|
STAT_UPDATE(translucentConsidered, (int)details._translucent._considered);
|
||||||
STAT_UPDATE(translucentOutOfView, details._translucent._outOfView);
|
STAT_UPDATE(translucentOutOfView, details._translucent._outOfView);
|
||||||
STAT_UPDATE(translucentTooSmall, details._translucent._tooSmall);
|
STAT_UPDATE(translucentTooSmall, details._translucent._tooSmall);
|
||||||
STAT_UPDATE(translucentRendered, details._translucent._rendered);
|
STAT_UPDATE(translucentRendered, (int)details._translucent._rendered);
|
||||||
STAT_UPDATE(otherConsidered, details._other._considered);
|
STAT_UPDATE(otherConsidered, (int)details._other._considered);
|
||||||
STAT_UPDATE(otherOutOfView, details._other._outOfView);
|
STAT_UPDATE(otherOutOfView, details._other._outOfView);
|
||||||
STAT_UPDATE(otherTooSmall, details._other._tooSmall);
|
STAT_UPDATE(otherTooSmall, details._other._tooSmall);
|
||||||
STAT_UPDATE(otherRendered, details._other._rendered);
|
STAT_UPDATE(otherRendered, (int)details._other._rendered);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ const AnimPoseVec& AnimBlendLinearMove::evaluate(const AnimVariantMap& animVars,
|
||||||
evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
|
evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
float clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
|
auto clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
|
||||||
size_t prevPoseIndex = glm::floor(clampedAlpha);
|
auto prevPoseIndex = glm::floor(clampedAlpha);
|
||||||
size_t nextPoseIndex = glm::ceil(clampedAlpha);
|
auto nextPoseIndex = glm::ceil(clampedAlpha);
|
||||||
float alpha = glm::fract(clampedAlpha);
|
auto alpha = glm::fract(clampedAlpha);
|
||||||
float prevDeltaTime, nextDeltaTime;
|
float prevDeltaTime, nextDeltaTime;
|
||||||
setFrameAndPhase(dt, alpha, prevPoseIndex, nextPoseIndex, &prevDeltaTime, &nextDeltaTime, triggersOut);
|
setFrameAndPhase(dt, alpha, prevPoseIndex, nextPoseIndex, &prevDeltaTime, &nextDeltaTime, triggersOut);
|
||||||
evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
|
evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
|
||||||
|
|
|
@ -57,7 +57,7 @@ const AnimPoseVec& AnimClip::evaluate(const AnimVariantMap& animVars, float dt,
|
||||||
|
|
||||||
// It can be quite possible for the user to set _startFrame and _endFrame to
|
// It can be quite possible for the user to set _startFrame and _endFrame to
|
||||||
// values before or past valid ranges. We clamp the frames here.
|
// values before or past valid ranges. We clamp the frames here.
|
||||||
int frameCount = _anim.size();
|
int frameCount = (int)_anim.size();
|
||||||
prevIndex = std::min(std::max(0, prevIndex), frameCount - 1);
|
prevIndex = std::min(std::max(0, prevIndex), frameCount - 1);
|
||||||
nextIndex = std::min(std::max(0, nextIndex), frameCount - 1);
|
nextIndex = std::min(std::max(0, nextIndex), frameCount - 1);
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ void AnimClip::copyFromNetworkAnim() {
|
||||||
// by matching joints with the same name.
|
// by matching joints with the same name.
|
||||||
const FBXGeometry& geom = _networkAnim->getGeometry();
|
const FBXGeometry& geom = _networkAnim->getGeometry();
|
||||||
AnimSkeleton animSkeleton(geom);
|
AnimSkeleton animSkeleton(geom);
|
||||||
const int animJointCount = animSkeleton.getNumJoints();
|
const auto animJointCount = animSkeleton.getNumJoints();
|
||||||
const int skeletonJointCount = _skeleton->getNumJoints();
|
const auto skeletonJointCount = _skeleton->getNumJoints();
|
||||||
std::vector<int> jointMap;
|
std::vector<int> jointMap;
|
||||||
jointMap.reserve(animJointCount);
|
jointMap.reserve(animJointCount);
|
||||||
for (int i = 0; i < animJointCount; i++) {
|
for (int i = 0; i < animJointCount; i++) {
|
||||||
|
|
|
@ -114,7 +114,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removeUnfoundJoints) {
|
if (removeUnfoundJoints) {
|
||||||
int numVars = _targetVarVec.size();
|
int numVars = (int)_targetVarVec.size();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < numVars) {
|
while (i < numVars) {
|
||||||
if (_targetVarVec[i].jointIndex == -1) {
|
if (_targetVarVec[i].jointIndex == -1) {
|
||||||
|
@ -145,7 +145,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
|
||||||
int numLoops = 0;
|
int numLoops = 0;
|
||||||
const int MAX_IK_LOOPS = 4;
|
const int MAX_IK_LOOPS = 4;
|
||||||
do {
|
do {
|
||||||
int lowestMovedIndex = _relativePoses.size();
|
int lowestMovedIndex = (int)_relativePoses.size();
|
||||||
for (auto& target: targets) {
|
for (auto& target: targets) {
|
||||||
IKTarget::Type targetType = target.getType();
|
IKTarget::Type targetType = target.getType();
|
||||||
if (targetType == IKTarget::Type::RotationOnly) {
|
if (targetType == IKTarget::Type::RotationOnly) {
|
||||||
|
@ -283,8 +283,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
|
||||||
}
|
}
|
||||||
|
|
||||||
// only update the absolutePoses that need it: those between lowestMovedIndex and _maxTargetIndex
|
// only update the absolutePoses that need it: those between lowestMovedIndex and _maxTargetIndex
|
||||||
for (int i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
|
for (auto i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
|
||||||
int parentIndex = _skeleton->getParentIndex(i);
|
auto parentIndex = _skeleton->getParentIndex((int)i);
|
||||||
if (parentIndex != -1) {
|
if (parentIndex != -1) {
|
||||||
absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i];
|
absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i];
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
|
int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
|
||||||
for (size_t i = 0; i < _joints.size(); i++) {
|
for (int i = 0; i < (int)_joints.size(); i++) {
|
||||||
if (_joints[i].name == jointName) {
|
if (_joints[i].name == jointName) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int AnimSkeleton::getNumJoints() const {
|
int AnimSkeleton::getNumJoints() const {
|
||||||
return _joints.size();
|
return (int)_joints.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimPose& AnimSkeleton::getAbsoluteBindPose(int jointIndex) const {
|
const AnimPose& AnimSkeleton::getAbsoluteBindPose(int jointIndex) const {
|
||||||
|
@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
|
||||||
_relativeDefaultPoses.reserve(joints.size());
|
_relativeDefaultPoses.reserve(joints.size());
|
||||||
|
|
||||||
// iterate over FBXJoints and extract the bind pose information.
|
// iterate over FBXJoints and extract the bind pose information.
|
||||||
for (size_t i = 0; i < joints.size(); i++) {
|
for (int i = 0; i < (int)joints.size(); i++) {
|
||||||
|
|
||||||
// build relative and absolute default poses
|
// build relative and absolute default poses
|
||||||
glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);
|
glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);
|
||||||
|
|
|
@ -234,7 +234,7 @@ bool Rig::jointStatesEmpty() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int Rig::getJointStateCount() const {
|
int Rig::getJointStateCount() const {
|
||||||
return _internalPoseSet._relativePoses.size();
|
return (int)_internalPoseSet._relativePoses.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Rig::indexOfJoint(const QString& jointName) const {
|
int Rig::indexOfJoint(const QString& jointName) const {
|
||||||
|
@ -434,7 +434,7 @@ void Rig::calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds,
|
||||||
|
|
||||||
void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
|
void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
|
||||||
// TODO: use cached eye/hips indices for these calculations
|
// TODO: use cached eye/hips indices for these calculations
|
||||||
int numPoses = poses.size();
|
int numPoses = (int)poses.size();
|
||||||
int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
|
int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
|
||||||
int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
|
int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
|
||||||
if (hipsIndex > 0 && headIndex > 0) {
|
if (hipsIndex > 0 && headIndex > 0) {
|
||||||
|
@ -1066,8 +1066,8 @@ glm::mat4 Rig::getJointTransform(int jointIndex) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rig::copyJointsIntoJointData(QVector<JointData>& jointDataVec) const {
|
void Rig::copyJointsIntoJointData(QVector<JointData>& jointDataVec) const {
|
||||||
jointDataVec.resize(getJointStateCount());
|
jointDataVec.resize((int)getJointStateCount());
|
||||||
for (int i = 0; i < jointDataVec.size(); i++) {
|
for (auto i = 0; i < jointDataVec.size(); i++) {
|
||||||
JointData& data = jointDataVec[i];
|
JointData& data = jointDataVec[i];
|
||||||
data.rotationSet |= getJointStateRotation(i, data.rotation);
|
data.rotationSet |= getJointStateRotation(i, data.rotation);
|
||||||
// geometry offset is used here so that translations are in meters.
|
// geometry offset is used here so that translations are in meters.
|
||||||
|
@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
|
||||||
// even if they do not have legs (default robot)
|
// even if they do not have legs (default robot)
|
||||||
totalExtents.addPoint(glm::vec3(0.0f));
|
totalExtents.addPoint(glm::vec3(0.0f));
|
||||||
|
|
||||||
int numPoses = finalPoses.size();
|
int numPoses = (int)finalPoses.size();
|
||||||
for (int i = 0; i < numPoses; i++) {
|
for (int i = 0; i < numPoses; i++) {
|
||||||
const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
|
const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
|
||||||
AnimPose pose = finalPoses[i];
|
AnimPose pose = finalPoses[i];
|
||||||
|
|
|
@ -36,7 +36,7 @@ void SwingTwistConstraint::SwingLimitFunction::setCone(float maxAngle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwingTwistConstraint::SwingLimitFunction::setMinDots(const std::vector<float>& minDots) {
|
void SwingTwistConstraint::SwingLimitFunction::setMinDots(const std::vector<float>& minDots) {
|
||||||
uint32_t numDots = minDots.size();
|
uint32_t numDots = (uint32_t)minDots.size();
|
||||||
_minDots.clear();
|
_minDots.clear();
|
||||||
if (numDots == 0) {
|
if (numDots == 0) {
|
||||||
// push two copies of MIN_MINDOT
|
// push two copies of MIN_MINDOT
|
||||||
|
@ -90,7 +90,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
|
||||||
};
|
};
|
||||||
std::vector<SwingLimitData> limits;
|
std::vector<SwingLimitData> limits;
|
||||||
|
|
||||||
uint32_t numLimits = swungDirections.size();
|
uint32_t numLimits = (uint32_t)swungDirections.size();
|
||||||
limits.reserve(numLimits);
|
limits.reserve(numLimits);
|
||||||
|
|
||||||
// compute the limit pairs: <theta, minDot>
|
// compute the limit pairs: <theta, minDot>
|
||||||
|
@ -108,7 +108,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<float> minDots;
|
std::vector<float> minDots;
|
||||||
numLimits = limits.size();
|
numLimits = (uint32_t)limits.size();
|
||||||
if (numLimits == 0) {
|
if (numLimits == 0) {
|
||||||
// trivial case: nearly free constraint
|
// trivial case: nearly free constraint
|
||||||
std::vector<float> minDots;
|
std::vector<float> minDots;
|
||||||
|
|
|
@ -1184,11 +1184,11 @@ float AudioClient::getAudioOutputMsecsUnplayed() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) {
|
qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) {
|
||||||
int samplesRequested = maxSize / sizeof(int16_t);
|
auto samplesRequested = maxSize / sizeof(int16_t);
|
||||||
int samplesPopped;
|
int samplesPopped;
|
||||||
int bytesWritten;
|
int bytesWritten;
|
||||||
|
|
||||||
if ((samplesPopped = _receivedAudioStream.popSamples(samplesRequested, false)) > 0) {
|
if ((samplesPopped = _receivedAudioStream.popSamples((int)samplesRequested, false)) > 0) {
|
||||||
AudioRingBuffer::ConstIterator lastPopOutput = _receivedAudioStream.getLastPopOutput();
|
AudioRingBuffer::ConstIterator lastPopOutput = _receivedAudioStream.getLastPopOutput();
|
||||||
lastPopOutput.readSamples((int16_t*)data, samplesPopped);
|
lastPopOutput.readSamples((int16_t*)data, samplesPopped);
|
||||||
bytesWritten = samplesPopped * sizeof(int16_t);
|
bytesWritten = samplesPopped * sizeof(int16_t);
|
||||||
|
|
|
@ -55,7 +55,7 @@ static const float LATE_MIX_RIGHT_DEFAULT = 90.0f;
|
||||||
static const float WET_DRY_MIX_DEFAULT = 50.0f;
|
static const float WET_DRY_MIX_DEFAULT = 50.0f;
|
||||||
|
|
||||||
static void setOption(QScriptValue arguments, const QString name, float defaultValue, float& variable) {
|
static void setOption(QScriptValue arguments, const QString name, float defaultValue, float& variable) {
|
||||||
variable = arguments.property(name).isNumber() ? arguments.property(name).toNumber() : defaultValue;
|
variable = arguments.property(name).isNumber() ? (float)arguments.property(name).toNumber() : defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioEffectOptions::AudioEffectOptions(QScriptValue arguments) {
|
AudioEffectOptions::AudioEffectOptions(QScriptValue arguments) {
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
|
|
||||||
#include <QtOpenGL/QGLWidget>
|
#include <QtOpenGL/QGLWidget>
|
||||||
#include <QtGui/QImage>
|
#include <QtGui/QImage>
|
||||||
#include <QtGui/QOpenGLContext>
|
|
||||||
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
|
|
||||||
#include <gl/GLWidget.h>
|
#include <gl/GLWidget.h>
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
|
@ -104,7 +105,7 @@ public:
|
||||||
|
|
||||||
// take the latest texture and present it
|
// take the latest texture and present it
|
||||||
_context->makeCurrent();
|
_context->makeCurrent();
|
||||||
if (QOpenGLContext::currentContext() == _context->contextHandle()) {
|
if (isCurrentContext(_context->contextHandle())) {
|
||||||
currentPlugin->present();
|
currentPlugin->present();
|
||||||
_context->doneCurrent();
|
_context->doneCurrent();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -66,5 +66,5 @@ void RenderableBoxEntityItem::render(RenderArgs* args) {
|
||||||
DependencyManager::get<DeferredLightingEffect>()->renderSolidCubeInstance(batch, getTransformToCenter(), cubeColor);
|
DependencyManager::get<DeferredLightingEffect>()->renderSolidCubeInstance(batch, getTransformToCenter(), cubeColor);
|
||||||
}
|
}
|
||||||
static const auto triCount = DependencyManager::get<GeometryCache>()->getCubeTriangleCount();
|
static const auto triCount = DependencyManager::get<GeometryCache>()->getCubeTriangleCount();
|
||||||
args->_details._trianglesRendered += triCount;
|
args->_details._trianglesRendered += (int)triCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
virtual ~RenderableModelEntityItem();
|
virtual ~RenderableModelEntityItem();
|
||||||
|
|
||||||
virtual void setDimensions(const glm::vec3& value) override;
|
virtual void setDimensions(const glm::vec3& value) override;
|
||||||
virtual void setModelURL(const QString& url);
|
virtual void setModelURL(const QString& url) override;
|
||||||
|
|
||||||
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
|
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
|
||||||
virtual bool setProperties(const EntityItemProperties& properties) override;
|
virtual bool setProperties(const EntityItemProperties& properties) override;
|
||||||
|
|
|
@ -106,7 +106,7 @@ public:
|
||||||
batch.setInputBuffer(0, _particleBuffer, 0, sizeof(ParticlePrimitive));
|
batch.setInputBuffer(0, _particleBuffer, 0, sizeof(ParticlePrimitive));
|
||||||
|
|
||||||
auto numParticles = _particleBuffer->getSize() / sizeof(ParticlePrimitive);
|
auto numParticles = _particleBuffer->getSize() / sizeof(ParticlePrimitive);
|
||||||
batch.drawInstanced(numParticles, gpu::TRIANGLE_STRIP, VERTEX_PER_PARTICLE);
|
batch.drawInstanced((gpu::uint32)numParticles, gpu::TRIANGLE_STRIP, (gpu::uint32)VERTEX_PER_PARTICLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -32,11 +32,18 @@
|
||||||
#include <PerfStat.h>
|
#include <PerfStat.h>
|
||||||
#include <render/Scene.h>
|
#include <render/Scene.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning( disable : 4267 )
|
||||||
|
#endif
|
||||||
#include <PolyVoxCore/CubicSurfaceExtractorWithNormals.h>
|
#include <PolyVoxCore/CubicSurfaceExtractorWithNormals.h>
|
||||||
#include <PolyVoxCore/MarchingCubesSurfaceExtractor.h>
|
#include <PolyVoxCore/MarchingCubesSurfaceExtractor.h>
|
||||||
#include <PolyVoxCore/SurfaceMesh.h>
|
#include <PolyVoxCore/SurfaceMesh.h>
|
||||||
#include <PolyVoxCore/SimpleVolume.h>
|
#include <PolyVoxCore/SimpleVolume.h>
|
||||||
#include <PolyVoxCore/Material.h>
|
#include <PolyVoxCore/Material.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "model/Geometry.h"
|
#include "model/Geometry.h"
|
||||||
#include "EntityTreeRenderer.h"
|
#include "EntityTreeRenderer.h"
|
||||||
|
@ -539,7 +546,7 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
||||||
int voxelVolumeSizeLocation = _pipeline->getProgram()->getUniforms().findLocation("voxelVolumeSize");
|
int voxelVolumeSizeLocation = _pipeline->getProgram()->getUniforms().findLocation("voxelVolumeSize");
|
||||||
batch._glUniform3f(voxelVolumeSizeLocation, _voxelVolumeSize.x, _voxelVolumeSize.y, _voxelVolumeSize.z);
|
batch._glUniform3f(voxelVolumeSizeLocation, _voxelVolumeSize.x, _voxelVolumeSize.y, _voxelVolumeSize.z);
|
||||||
|
|
||||||
batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
|
batch.drawIndexed(gpu::TRIANGLES, (gpu::uint32)mesh->getNumIndices(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderablePolyVoxEntityItem::addToScene(EntityItemPointer self,
|
bool RenderablePolyVoxEntityItem::addToScene(EntityItemPointer self,
|
||||||
|
|
|
@ -72,5 +72,5 @@ void RenderableSphereEntityItem::render(RenderArgs* args) {
|
||||||
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphereInstance(batch, modelTransform, sphereColor);
|
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphereInstance(batch, modelTransform, sphereColor);
|
||||||
}
|
}
|
||||||
static const auto triCount = DependencyManager::get<GeometryCache>()->getSphereTriangleCount();
|
static const auto triCount = DependencyManager::get<GeometryCache>()->getSphereTriangleCount();
|
||||||
args->_details._trianglesRendered += triCount;
|
args->_details._trianglesRendered += (int)triCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -620,7 +620,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
Q_ASSERT(parser.data() + parser.offset() == dataAt);
|
Q_ASSERT(parser.data() + parser.offset() == dataAt);
|
||||||
#else
|
#else
|
||||||
const unsigned char* dataAt = parser.data() + parser.offset();
|
const unsigned char* dataAt = parser.data() + parser.offset();
|
||||||
int bytesRead = parser.offset();
|
int bytesRead = (int)parser.offset();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
@ -749,7 +749,7 @@ void EntityItem::debugDump() const {
|
||||||
void EntityItem::adjustEditPacketForClockSkew(QByteArray& buffer, int clockSkew) {
|
void EntityItem::adjustEditPacketForClockSkew(QByteArray& buffer, int clockSkew) {
|
||||||
unsigned char* dataAt = reinterpret_cast<unsigned char*>(buffer.data());
|
unsigned char* dataAt = reinterpret_cast<unsigned char*>(buffer.data());
|
||||||
int octets = numberOfThreeBitSectionsInCode(dataAt);
|
int octets = numberOfThreeBitSectionsInCode(dataAt);
|
||||||
int lengthOfOctcode = bytesRequiredForCodeLength(octets);
|
int lengthOfOctcode = (int)bytesRequiredForCodeLength(octets);
|
||||||
dataAt += lengthOfOctcode;
|
dataAt += lengthOfOctcode;
|
||||||
|
|
||||||
// lastEdited
|
// lastEdited
|
||||||
|
|
|
@ -389,7 +389,7 @@ protected:
|
||||||
const QByteArray getActionDataInternal() const;
|
const QByteArray getActionDataInternal() const;
|
||||||
void setActionDataInternal(QByteArray actionData);
|
void setActionDataInternal(QByteArray actionData);
|
||||||
|
|
||||||
virtual void locationChanged();
|
virtual void locationChanged() override;
|
||||||
EntityTypes::EntityType _type;
|
EntityTypes::EntityType _type;
|
||||||
quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
|
quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
|
||||||
// and physics changes
|
// and physics changes
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
|
||||||
// the first part of the data is an octcode, this is a required element of the edit packet format, but we don't
|
// the first part of the data is an octcode, this is a required element of the edit packet format, but we don't
|
||||||
// actually use it, we do need to skip it and read to the actual data we care about.
|
// actually use it, we do need to skip it and read to the actual data we care about.
|
||||||
int octets = numberOfThreeBitSectionsInCode(data);
|
int octets = numberOfThreeBitSectionsInCode(data);
|
||||||
int bytesToReadOfOctcode = bytesRequiredForCodeLength(octets);
|
int bytesToReadOfOctcode = (int)bytesRequiredForCodeLength(octets);
|
||||||
|
|
||||||
// we don't actually do anything with this octcode...
|
// we don't actually do anything with this octcode...
|
||||||
dataAt += bytesToReadOfOctcode;
|
dataAt += bytesToReadOfOctcode;
|
||||||
|
|
|
@ -1062,7 +1062,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
|
||||||
break; // bail to prevent buffer overflow
|
break; // bail to prevent buffer overflow
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray encodedID = dataByteArray.mid(processedBytes, NUM_BYTES_RFC4122_UUID);
|
QByteArray encodedID = dataByteArray.mid((int)processedBytes, NUM_BYTES_RFC4122_UUID);
|
||||||
QUuid entityID = QUuid::fromRfc4122(encodedID);
|
QUuid entityID = QUuid::fromRfc4122(encodedID);
|
||||||
dataAt += encodedID.size();
|
dataAt += encodedID.size();
|
||||||
processedBytes += encodedID.size();
|
processedBytes += encodedID.size();
|
||||||
|
@ -1081,7 +1081,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
|
||||||
}
|
}
|
||||||
deleteEntities(entityItemIDsToDelete, true, true);
|
deleteEntities(entityItemIDsToDelete, true, true);
|
||||||
}
|
}
|
||||||
return processedBytes;
|
return (int)processedBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityTreeElementPointer EntityTree::getContainingElement(const EntityItemID& entityItemID) /*const*/ {
|
EntityTreeElementPointer EntityTree::getContainingElement(const EntityItemID& entityItemID) /*const*/ {
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
void createRootElement();
|
void createRootElement();
|
||||||
|
|
||||||
/// Implements our type specific root element factory
|
/// Implements our type specific root element factory
|
||||||
virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL);
|
virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL) override;
|
||||||
|
|
||||||
/// Type safe version of getRoot()
|
/// Type safe version of getRoot()
|
||||||
EntityTreeElementPointer getRoot() {
|
EntityTreeElementPointer getRoot() {
|
||||||
|
@ -68,15 +68,15 @@ public:
|
||||||
return std::static_pointer_cast<EntityTreeElement>(_rootElement);
|
return std::static_pointer_cast<EntityTreeElement>(_rootElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void eraseAllOctreeElements(bool createNewRoot = true);
|
virtual void eraseAllOctreeElements(bool createNewRoot = true) override;
|
||||||
|
|
||||||
// These methods will allow the OctreeServer to send your tree inbound edit packets of your
|
// These methods will allow the OctreeServer to send your tree inbound edit packets of your
|
||||||
// own definition. Implement these to allow your octree based server to support editing
|
// own definition. Implement these to allow your octree based server to support editing
|
||||||
virtual bool getWantSVOfileVersions() const { return true; }
|
virtual bool getWantSVOfileVersions() const override { return true; }
|
||||||
virtual PacketType expectedDataPacketType() const { return PacketType::EntityData; }
|
virtual PacketType expectedDataPacketType() const override { return PacketType::EntityData; }
|
||||||
virtual bool canProcessVersion(PacketVersion thisVersion) const
|
virtual bool canProcessVersion(PacketVersion thisVersion) const override
|
||||||
{ return thisVersion >= VERSION_ENTITIES_USE_METERS_AND_RADIANS; }
|
{ return thisVersion >= VERSION_ENTITIES_USE_METERS_AND_RADIANS; }
|
||||||
virtual bool handlesEditPacketType(PacketType packetType) const;
|
virtual bool handlesEditPacketType(PacketType packetType) const override;
|
||||||
void fixupTerseEditLogging(EntityItemProperties& properties, QList<QString>& changedProperties);
|
void fixupTerseEditLogging(EntityItemProperties& properties, QList<QString>& changedProperties);
|
||||||
virtual int processEditPacketData(ReceivedMessage& message, const unsigned char* editData, int maxLength,
|
virtual int processEditPacketData(ReceivedMessage& message, const unsigned char* editData, int maxLength,
|
||||||
const SharedNodePointer& senderNode) override;
|
const SharedNodePointer& senderNode) override;
|
||||||
|
@ -89,18 +89,18 @@ public:
|
||||||
bool* accurateResult = NULL,
|
bool* accurateResult = NULL,
|
||||||
bool precisionPicking = false);
|
bool precisionPicking = false);
|
||||||
|
|
||||||
virtual bool rootElementHasData() const { return true; }
|
virtual bool rootElementHasData() const override { return true; }
|
||||||
|
|
||||||
// the root at least needs to store the number of entities in the packet/buffer
|
// the root at least needs to store the number of entities in the packet/buffer
|
||||||
virtual int minimumRequiredRootDataBytes() const { return sizeof(uint16_t); }
|
virtual int minimumRequiredRootDataBytes() const override { return sizeof(uint16_t); }
|
||||||
virtual bool suppressEmptySubtrees() const { return false; }
|
virtual bool suppressEmptySubtrees() const override { return false; }
|
||||||
virtual void releaseSceneEncodeData(OctreeElementExtraEncodeData* extraEncodeData) const;
|
virtual void releaseSceneEncodeData(OctreeElementExtraEncodeData* extraEncodeData) const override;
|
||||||
virtual bool mustIncludeAllChildData() const { return false; }
|
virtual bool mustIncludeAllChildData() const override { return false; }
|
||||||
|
|
||||||
virtual bool versionHasSVOfileBreaks(PacketVersion thisVersion) const
|
virtual bool versionHasSVOfileBreaks(PacketVersion thisVersion) const override
|
||||||
{ return thisVersion >= VERSION_ENTITIES_HAS_FILE_BREAKS; }
|
{ return thisVersion >= VERSION_ENTITIES_HAS_FILE_BREAKS; }
|
||||||
|
|
||||||
virtual void update();
|
virtual void update() override;
|
||||||
|
|
||||||
// The newer API...
|
// The newer API...
|
||||||
void postAddEntity(EntityItemPointer entityItem);
|
void postAddEntity(EntityItemPointer entityItem);
|
||||||
|
@ -177,8 +177,8 @@ public:
|
||||||
EntityTreeElementPointer getContainingElement(const EntityItemID& entityItemID) /*const*/;
|
EntityTreeElementPointer getContainingElement(const EntityItemID& entityItemID) /*const*/;
|
||||||
void setContainingElement(const EntityItemID& entityItemID, EntityTreeElementPointer element);
|
void setContainingElement(const EntityItemID& entityItemID, EntityTreeElementPointer element);
|
||||||
void debugDumpMap();
|
void debugDumpMap();
|
||||||
virtual void dumpTree();
|
virtual void dumpTree() override;
|
||||||
virtual void pruneTree();
|
virtual void pruneTree() override;
|
||||||
|
|
||||||
QVector<EntityItemID> sendEntities(EntityEditPacketSender* packetSender, EntityTreePointer localTree,
|
QVector<EntityItemID> sendEntities(EntityEditPacketSender* packetSender, EntityTreePointer localTree,
|
||||||
float x, float y, float z);
|
float x, float y, float z);
|
||||||
|
@ -198,12 +198,12 @@ public:
|
||||||
|
|
||||||
void remapIDs();
|
void remapIDs();
|
||||||
|
|
||||||
bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues);
|
virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues) override;
|
||||||
bool readFromMap(QVariantMap& entityDescription);
|
virtual bool readFromMap(QVariantMap& entityDescription) override;
|
||||||
|
|
||||||
float getContentsLargestDimension();
|
float getContentsLargestDimension();
|
||||||
|
|
||||||
virtual void resetEditStats() {
|
virtual void resetEditStats() override {
|
||||||
_totalEditMessages = 0;
|
_totalEditMessages = 0;
|
||||||
_totalUpdates = 0;
|
_totalUpdates = 0;
|
||||||
_totalCreates = 0;
|
_totalCreates = 0;
|
||||||
|
@ -214,11 +214,11 @@ public:
|
||||||
_totalLoggingTime = 0;
|
_totalLoggingTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual quint64 getAverageDecodeTime() const { return _totalEditMessages == 0 ? 0 : _totalDecodeTime / _totalEditMessages; }
|
virtual quint64 getAverageDecodeTime() const override { return _totalEditMessages == 0 ? 0 : _totalDecodeTime / _totalEditMessages; }
|
||||||
virtual quint64 getAverageLookupTime() const { return _totalEditMessages == 0 ? 0 : _totalLookupTime / _totalEditMessages; }
|
virtual quint64 getAverageLookupTime() const override { return _totalEditMessages == 0 ? 0 : _totalLookupTime / _totalEditMessages; }
|
||||||
virtual quint64 getAverageUpdateTime() const { return _totalUpdates == 0 ? 0 : _totalUpdateTime / _totalUpdates; }
|
virtual quint64 getAverageUpdateTime() const override { return _totalUpdates == 0 ? 0 : _totalUpdateTime / _totalUpdates; }
|
||||||
virtual quint64 getAverageCreateTime() const { return _totalCreates == 0 ? 0 : _totalCreateTime / _totalCreates; }
|
virtual quint64 getAverageCreateTime() const override { return _totalCreates == 0 ? 0 : _totalCreateTime / _totalCreates; }
|
||||||
virtual quint64 getAverageLoggingTime() const { return _totalEditMessages == 0 ? 0 : _totalLoggingTime / _totalEditMessages; }
|
virtual quint64 getAverageLoggingTime() const override { return _totalEditMessages == 0 ? 0 : _totalLoggingTime / _totalEditMessages; }
|
||||||
|
|
||||||
void trackIncomingEntityLastEdited(quint64 lastEditedTime, int bytesRead);
|
void trackIncomingEntityLastEdited(quint64 lastEditedTime, int bytesRead);
|
||||||
quint64 getAverageEditDeltas() const
|
quint64 getAverageEditDeltas() const
|
||||||
|
|
|
@ -38,7 +38,7 @@ glm::vec3 EnvironmentData::getSunLocation(const glm::vec3& cameraPosition) const
|
||||||
return _sunLocation;
|
return _sunLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
|
size_t EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
|
||||||
unsigned char* bufferStart = destinationBuffer;
|
unsigned char* bufferStart = destinationBuffer;
|
||||||
|
|
||||||
memcpy(destinationBuffer, &_id, sizeof(_id));
|
memcpy(destinationBuffer, &_id, sizeof(_id));
|
||||||
|
@ -77,7 +77,7 @@ int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
|
||||||
return destinationBuffer - bufferStart;
|
return destinationBuffer - bufferStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) {
|
size_t EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) {
|
||||||
const unsigned char* startPosition = sourceBuffer;
|
const unsigned char* startPosition = sourceBuffer;
|
||||||
|
|
||||||
memcpy(&_id, sourceBuffer, sizeof(_id));
|
memcpy(&_id, sourceBuffer, sizeof(_id));
|
||||||
|
|
|
@ -54,8 +54,8 @@ public:
|
||||||
glm::vec3 getAtmosphereCenter(const glm::vec3& cameraPosition) const;
|
glm::vec3 getAtmosphereCenter(const glm::vec3& cameraPosition) const;
|
||||||
glm::vec3 getSunLocation(const glm::vec3& cameraPosition) const;
|
glm::vec3 getSunLocation(const glm::vec3& cameraPosition) const;
|
||||||
|
|
||||||
int getBroadcastData(unsigned char* destinationBuffer) const;
|
size_t getBroadcastData(unsigned char* destinationBuffer) const;
|
||||||
int parseData(const unsigned char* sourceBuffer, int numBytes);
|
size_t parseData(const unsigned char* sourceBuffer, int numBytes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -195,8 +195,7 @@ public:
|
||||||
QMultiHash<int, int> newIndices;
|
QMultiHash<int, int> newIndices;
|
||||||
QVector<QHash<int, int> > blendshapeIndexMaps;
|
QVector<QHash<int, int> > blendshapeIndexMaps;
|
||||||
QVector<QPair<int, int> > partMaterialTextures;
|
QVector<QPair<int, int> > partMaterialTextures;
|
||||||
QHash<QString, int> texcoordSetMap;
|
QHash<QString, size_t> texcoordSetMap;
|
||||||
std::map<QString, int> texcoordSetMap2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A single animation frame extracted from an FBX document.
|
/// A single animation frame extracted from an FBX document.
|
||||||
|
|
|
@ -288,7 +288,7 @@ ExtractedMesh FBXReader::extractMesh(const FBXNode& object, unsigned int& meshIn
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, int>::iterator it = data.extracted.texcoordSetMap.find(attrib.name);
|
QHash<QString, size_t>::iterator it = data.extracted.texcoordSetMap.find(attrib.name);
|
||||||
if (it == data.extracted.texcoordSetMap.end()) {
|
if (it == data.extracted.texcoordSetMap.end()) {
|
||||||
data.extracted.texcoordSetMap.insert(attrib.name, data.attributes.size());
|
data.extracted.texcoordSetMap.insert(attrib.name, data.attributes.size());
|
||||||
data.attributes.push_back(attrib);
|
data.attributes.push_back(attrib);
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <forward_list>
|
#include <forward_list>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <GL/glew.h>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
|
|
@ -76,3 +76,6 @@ void OffscreenGLCanvas::doneCurrent() {
|
||||||
_context->doneCurrent();
|
_context->doneCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QObject* OffscreenGLCanvas::getContextObject() {
|
||||||
|
return _context;
|
||||||
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@ public:
|
||||||
QOpenGLContext* getContext() {
|
QOpenGLContext* getContext() {
|
||||||
return _context;
|
return _context;
|
||||||
}
|
}
|
||||||
|
QObject* getContextObject();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::once_flag _reportOnce;
|
std::once_flag _reportOnce;
|
||||||
QOpenGLContext* _context;
|
QOpenGLContext* _context;
|
||||||
|
|
|
@ -17,15 +17,14 @@
|
||||||
#include <QtQuick/QQuickRenderControl>
|
#include <QtQuick/QQuickRenderControl>
|
||||||
#include <QtCore/QWaitCondition>
|
#include <QtCore/QWaitCondition>
|
||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
#include <QtGui/QOpenGLContext>
|
|
||||||
|
|
||||||
#include <shared/NsightHelpers.h>
|
#include <shared/NsightHelpers.h>
|
||||||
#include <PerfStat.h>
|
#include <PerfStat.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
|
|
||||||
#include "GLEscrow.h"
|
|
||||||
#include "OffscreenGLCanvas.h"
|
#include "OffscreenGLCanvas.h"
|
||||||
|
#include "GLEscrow.h"
|
||||||
|
|
||||||
|
|
||||||
// Time between receiving a request to render the offscreen UI actually triggering
|
// Time between receiving a request to render the offscreen UI actually triggering
|
||||||
|
@ -60,7 +59,6 @@ static const QEvent::Type INIT = QEvent::Type(QEvent::User + 1);
|
||||||
static const QEvent::Type RENDER = QEvent::Type(QEvent::User + 2);
|
static const QEvent::Type RENDER = QEvent::Type(QEvent::User + 2);
|
||||||
static const QEvent::Type RESIZE = QEvent::Type(QEvent::User + 3);
|
static const QEvent::Type RESIZE = QEvent::Type(QEvent::User + 3);
|
||||||
static const QEvent::Type STOP = QEvent::Type(QEvent::User + 4);
|
static const QEvent::Type STOP = QEvent::Type(QEvent::User + 4);
|
||||||
static const QEvent::Type UPDATE = QEvent::Type(QEvent::User + 5);
|
|
||||||
|
|
||||||
class OffscreenQmlRenderer : public OffscreenGLCanvas {
|
class OffscreenQmlRenderer : public OffscreenGLCanvas {
|
||||||
friend class OffscreenQmlSurface;
|
friend class OffscreenQmlSurface;
|
||||||
|
@ -84,7 +82,7 @@ public:
|
||||||
|
|
||||||
// Qt 5.5
|
// Qt 5.5
|
||||||
_renderControl->prepareThread(&_thread);
|
_renderControl->prepareThread(&_thread);
|
||||||
_context->moveToThread(&_thread);
|
getContextObject()->moveToThread(&_thread);
|
||||||
moveToThread(&_thread);
|
moveToThread(&_thread);
|
||||||
_thread.setObjectName("QML Thread");
|
_thread.setObjectName("QML Thread");
|
||||||
_thread.start();
|
_thread.start();
|
||||||
|
@ -176,7 +174,7 @@ private:
|
||||||
|
|
||||||
doneCurrent();
|
doneCurrent();
|
||||||
|
|
||||||
_context->moveToThread(QCoreApplication::instance()->thread());
|
getContextObject()->moveToThread(QCoreApplication::instance()->thread());
|
||||||
_cond.wakeOne();
|
_cond.wakeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ GLBackend::GLFramebuffer* GLBackend::syncGPUObject(const Framebuffer& framebuffe
|
||||||
|
|
||||||
// Last but not least, define where we draw
|
// Last but not least, define where we draw
|
||||||
if (!colorBuffers.empty()) {
|
if (!colorBuffers.empty()) {
|
||||||
glDrawBuffers(colorBuffers.size(), colorBuffers.data());
|
glDrawBuffers((GLsizei)colorBuffers.size(), colorBuffers.data());
|
||||||
} else {
|
} else {
|
||||||
glDrawBuffer( GL_NONE );
|
glDrawBuffer( GL_NONE );
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!drawBuffers.empty()) {
|
if (!drawBuffers.empty()) {
|
||||||
glDrawBuffers(drawBuffers.size(), drawBuffers.data());
|
glDrawBuffers((GLsizei)drawBuffers.size(), drawBuffers.data());
|
||||||
glClearColor(color.x, color.y, color.z, color.w);
|
glClearColor(color.x, color.y, color.z, color.w);
|
||||||
glmask |= GL_COLOR_BUFFER_BIT;
|
glmask |= GL_COLOR_BUFFER_BIT;
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
|
||||||
if (_output._framebuffer && !drawBuffers.empty()) {
|
if (_output._framebuffer && !drawBuffers.empty()) {
|
||||||
auto glFramebuffer = syncGPUObject(*_output._framebuffer);
|
auto glFramebuffer = syncGPUObject(*_output._framebuffer);
|
||||||
if (glFramebuffer) {
|
if (glFramebuffer) {
|
||||||
glDrawBuffers(glFramebuffer->_colorBuffers.size(), glFramebuffer->_colorBuffers.data());
|
glDrawBuffers((GLsizei)glFramebuffer->_colorBuffers.size(), glFramebuffer->_colorBuffers.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,13 +301,13 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
|
||||||
void GLBackend::do_blit(Batch& batch, size_t paramOffset) {
|
void GLBackend::do_blit(Batch& batch, size_t paramOffset) {
|
||||||
auto srcframebuffer = batch._framebuffers.get(batch._params[paramOffset]._uint);
|
auto srcframebuffer = batch._framebuffers.get(batch._params[paramOffset]._uint);
|
||||||
Vec4i srcvp;
|
Vec4i srcvp;
|
||||||
for (size_t i = 0; i < 4; ++i) {
|
for (auto i = 0; i < 4; ++i) {
|
||||||
srcvp[i] = batch._params[paramOffset + 1 + i]._int;
|
srcvp[i] = batch._params[paramOffset + 1 + i]._int;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dstframebuffer = batch._framebuffers.get(batch._params[paramOffset + 5]._uint);
|
auto dstframebuffer = batch._framebuffers.get(batch._params[paramOffset + 5]._uint);
|
||||||
Vec4i dstvp;
|
Vec4i dstvp;
|
||||||
for (size_t i = 0; i < 4; ++i) {
|
for (auto i = 0; i < 4; ++i) {
|
||||||
dstvp[i] = batch._params[paramOffset + 6 + i]._int;
|
dstvp[i] = batch._params[paramOffset + 6 + i]._int;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -357,7 +357,7 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
|
||||||
|
|
||||||
object->_storageStamp = texture.getStamp();
|
object->_storageStamp = texture.getStamp();
|
||||||
object->_contentStamp = texture.getDataStamp();
|
object->_contentStamp = texture.getDataStamp();
|
||||||
object->_size = texture.getSize();
|
object->_size = (GLuint)texture.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, boundTex);
|
glBindTexture(GL_TEXTURE_2D, boundTex);
|
||||||
|
@ -435,7 +435,7 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
|
||||||
|
|
||||||
object->_storageStamp = texture.getStamp();
|
object->_storageStamp = texture.getStamp();
|
||||||
object->_contentStamp = texture.getDataStamp();
|
object->_contentStamp = texture.getDataStamp();
|
||||||
object->_size = texture.getSize();
|
object->_size = (GLuint)texture.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_CUBE_MAP, boundTex);
|
glBindTexture(GL_TEXTURE_CUBE_MAP, boundTex);
|
||||||
|
|
|
@ -99,7 +99,7 @@ bool Texture::Storage::assignMipData(uint16 level, const Element& format, Size s
|
||||||
// The bytes assigned here are supposed to contain all the faces bytes of the mip.
|
// The bytes assigned here are supposed to contain all the faces bytes of the mip.
|
||||||
// For tex1D, 2D, 3D there is only one face
|
// For tex1D, 2D, 3D there is only one face
|
||||||
// For Cube, we expect the 6 faces in the order X+, X-, Y+, Y-, Z+, Z-
|
// For Cube, we expect the 6 faces in the order X+, X-, Y+, Y-, Z+, Z-
|
||||||
int sizePerFace = size / mip.size();
|
auto sizePerFace = size / mip.size();
|
||||||
auto faceBytes = bytes;
|
auto faceBytes = bytes;
|
||||||
Size allocated = 0;
|
Size allocated = 0;
|
||||||
for (auto& face : mip) {
|
for (auto& face : mip) {
|
||||||
|
|
|
@ -335,7 +335,7 @@ void NetworkGeometry::modelParseSuccess(FBXGeometry* geometry) {
|
||||||
_meshes.emplace_back(buildNetworkMesh(mesh, _textureBaseUrl));
|
_meshes.emplace_back(buildNetworkMesh(mesh, _textureBaseUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, int> fbxMatIDToMatID;
|
QHash<QString, size_t> fbxMatIDToMatID;
|
||||||
foreach(const FBXMaterial& material, _geometry->materials) {
|
foreach(const FBXMaterial& material, _geometry->materials) {
|
||||||
fbxMatIDToMatID[material.materialID] = _materials.size();
|
fbxMatIDToMatID[material.materialID] = _materials.size();
|
||||||
_materials.emplace_back(buildNetworkMaterial(material, _textureBaseUrl));
|
_materials.emplace_back(buildNetworkMaterial(material, _textureBaseUrl));
|
||||||
|
@ -349,7 +349,7 @@ void NetworkGeometry::modelParseSuccess(FBXGeometry* geometry) {
|
||||||
NetworkShape* networkShape = new NetworkShape();
|
NetworkShape* networkShape = new NetworkShape();
|
||||||
networkShape->_meshID = meshID;
|
networkShape->_meshID = meshID;
|
||||||
networkShape->_partID = partID;
|
networkShape->_partID = partID;
|
||||||
networkShape->_materialID = fbxMatIDToMatID[part.materialID];
|
networkShape->_materialID = (int)fbxMatIDToMatID[part.materialID];
|
||||||
_shapes.emplace_back(networkShape);
|
_shapes.emplace_back(networkShape);
|
||||||
partID++;
|
partID++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,11 +46,11 @@ public:
|
||||||
// Vertex buffer
|
// Vertex buffer
|
||||||
void setVertexBuffer(const BufferView& buffer);
|
void setVertexBuffer(const BufferView& buffer);
|
||||||
const BufferView& getVertexBuffer() const { return _vertexBuffer; }
|
const BufferView& getVertexBuffer() const { return _vertexBuffer; }
|
||||||
uint getNumVertices() const { return _vertexBuffer.getNumElements(); }
|
size_t getNumVertices() const { return _vertexBuffer.getNumElements(); }
|
||||||
bool hasVertexData() const { return _vertexBuffer._buffer.get() != nullptr; }
|
bool hasVertexData() const { return _vertexBuffer._buffer.get() != nullptr; }
|
||||||
|
|
||||||
// Attribute Buffers
|
// Attribute Buffers
|
||||||
int getNumAttributes() const { return _attributeBuffers.size(); }
|
size_t getNumAttributes() const { return _attributeBuffers.size(); }
|
||||||
void addAttribute(Slot slot, const BufferView& buffer);
|
void addAttribute(Slot slot, const BufferView& buffer);
|
||||||
const BufferView getAttributeBuffer(int attrib) const;
|
const BufferView getAttributeBuffer(int attrib) const;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
// Index Buffer
|
// Index Buffer
|
||||||
void setIndexBuffer(const BufferView& buffer);
|
void setIndexBuffer(const BufferView& buffer);
|
||||||
const BufferView& getIndexBuffer() const { return _indexBuffer; }
|
const BufferView& getIndexBuffer() const { return _indexBuffer; }
|
||||||
uint getNumIndices() const { return _indexBuffer.getNumElements(); }
|
size_t getNumIndices() const { return _indexBuffer.getNumElements(); }
|
||||||
|
|
||||||
// Access vertex position value
|
// Access vertex position value
|
||||||
const Vec3& getPos3(Index index) const { return _vertexBuffer.get<Vec3>(index); }
|
const Vec3& getPos3(Index index) const { return _vertexBuffer.get<Vec3>(index); }
|
||||||
|
@ -104,7 +104,7 @@ public:
|
||||||
|
|
||||||
void setPartBuffer(const BufferView& buffer);
|
void setPartBuffer(const BufferView& buffer);
|
||||||
const BufferView& getPartBuffer() const { return _partBuffer; }
|
const BufferView& getPartBuffer() const { return _partBuffer; }
|
||||||
uint getNumParts() const { return _partBuffer.getNumElements(); }
|
size_t getNumParts() const { return _partBuffer.getNumElements(); }
|
||||||
|
|
||||||
// evaluate the bounding box of A part
|
// evaluate the bounding box of A part
|
||||||
Box evalPartBound(int partNum) const;
|
Box evalPartBound(int partNum) const;
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
|
|
||||||
void (*linkedDataCreateCallback)(Node *);
|
void (*linkedDataCreateCallback)(Node *);
|
||||||
|
|
||||||
int size() const { return _nodeHash.size(); }
|
size_t size() const { return _nodeHash.size(); }
|
||||||
|
|
||||||
SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
|
SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ bool PacketSender::nonThreadedProcess() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int packetsLeft = _packets.size();
|
auto packetsLeft = _packets.size();
|
||||||
|
|
||||||
// Now that we know how many packets to send this call to process, just send them.
|
// Now that we know how many packets to send this call to process, just send them.
|
||||||
while ((packetsSentThisCall < packetsToSendThisCall) && (packetsLeft > 0)) {
|
while ((packetsSentThisCall < packetsToSendThisCall) && (packetsLeft > 0)) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
bool hasPacketsToSend() const { return _packets.size() > 0; }
|
bool hasPacketsToSend() const { return _packets.size() > 0; }
|
||||||
|
|
||||||
/// how many packets are there in the send queue waiting to be sent
|
/// how many packets are there in the send queue waiting to be sent
|
||||||
int packetsToSendCount() const { return _packets.size(); }
|
size_t packetsToSendCount() const { return _packets.size(); }
|
||||||
|
|
||||||
/// If you're running in non-threaded mode, call this to give us a hint as to how frequently you will call process.
|
/// If you're running in non-threaded mode, call this to give us a hint as to how frequently you will call process.
|
||||||
/// This has no effect in threaded mode. This is only considered a hint in non-threaded mode.
|
/// This has no effect in threaded mode. This is only considered a hint in non-threaded mode.
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How many received packets waiting are to be processed
|
/// How many received packets waiting are to be processed
|
||||||
int packetsToProcessCount() const { return _packets.size(); }
|
int packetsToProcessCount() const { return (int)_packets.size(); }
|
||||||
|
|
||||||
float getIncomingPPS() const { return _incomingPPS.getAverage(); }
|
float getIncomingPPS() const { return _incomingPPS.getAverage(); }
|
||||||
float getProcessedPPS() const { return _processedPPS.getAverage(); }
|
float getProcessedPPS() const { return _processedPPS.getAverage(); }
|
||||||
|
|
|
@ -129,7 +129,7 @@ QByteArray PacketList::getMessage() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
data.reserve(sizeBytes);
|
data.reserve((int)sizeBytes);
|
||||||
|
|
||||||
for (auto& packet : _packets) {
|
for (auto& packet : _packets) {
|
||||||
data.append(packet->getPayload(), packet->getPayloadSize());
|
data.append(packet->getPayload(), packet->getPayloadSize());
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
bool isReliable() const { return _isReliable; }
|
bool isReliable() const { return _isReliable; }
|
||||||
bool isOrdered() const { return _isOrdered; }
|
bool isOrdered() const { return _isOrdered; }
|
||||||
|
|
||||||
int getNumPackets() const { return _packets.size() + (_currentPacket ? 1 : 0); }
|
size_t getNumPackets() const { return _packets.size() + (_currentPacket ? 1 : 0); }
|
||||||
size_t getDataSize() const;
|
size_t getDataSize() const;
|
||||||
size_t getMessageSize() const;
|
size_t getMessageSize() const;
|
||||||
QByteArray getMessage() const;
|
QByteArray getMessage() const;
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
|
|
||||||
JurisdictionListener(NodeType_t type = NodeType::EntityServer);
|
JurisdictionListener(NodeType_t type = NodeType::EntityServer);
|
||||||
|
|
||||||
virtual bool process();
|
virtual bool process() override;
|
||||||
|
|
||||||
NodeToJurisdictionMap* getJurisdictions() { return &_jurisdictions; }
|
NodeToJurisdictionMap* getJurisdictions() { return &_jurisdictions; }
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
|
||||||
packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
|
packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
|
||||||
|
|
||||||
// if and only if there's a root jurisdiction, also include the end nodes
|
// if and only if there's a root jurisdiction, also include the end nodes
|
||||||
int endNodeCount = _endNodes.size();
|
int endNodeCount = (int)_endNodes.size();
|
||||||
packet->writePrimitive(endNodeCount);
|
packet->writePrimitive(endNodeCount);
|
||||||
|
|
||||||
for (int i=0; i < endNodeCount; i++) {
|
for (int i=0; i < endNodeCount; i++) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
|
|
||||||
unsigned char* getRootOctalCode() const { return _rootOctalCode; }
|
unsigned char* getRootOctalCode() const { return _rootOctalCode; }
|
||||||
unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
|
unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
|
||||||
int getEndNodeCount() const { return _endNodes.size(); }
|
int getEndNodeCount() const { return (int)_endNodes.size(); }
|
||||||
|
|
||||||
void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);
|
void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
|
|
||||||
void setJurisdiction(JurisdictionMap* map) { _jurisdictionMap = map; }
|
void setJurisdiction(JurisdictionMap* map) { _jurisdictionMap = map; }
|
||||||
|
|
||||||
virtual bool process();
|
virtual bool process() override;
|
||||||
|
|
||||||
NodeType_t getNodeType() const { return _nodeType; }
|
NodeType_t getNodeType() const { return _nodeType; }
|
||||||
void setNodeType(NodeType_t type) { _nodeType = type; }
|
void setNodeType(NodeType_t type) { _nodeType = type; }
|
||||||
|
|
|
@ -479,12 +479,12 @@ void Octree::readBitstreamToTree(const unsigned char * bitstream, unsigned long
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int octalCodeBytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInStream);
|
auto octalCodeBytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInStream);
|
||||||
|
|
||||||
int theseBytesRead = 0;
|
int theseBytesRead = 0;
|
||||||
theseBytesRead += octalCodeBytes;
|
theseBytesRead += (int)octalCodeBytes;
|
||||||
int lowerLevelBytes = readElementData(bitstreamRootElement, bitstreamAt + octalCodeBytes,
|
int lowerLevelBytes = readElementData(bitstreamRootElement, bitstreamAt + octalCodeBytes,
|
||||||
bufferSizeBytes - (bytesRead + octalCodeBytes), args);
|
bufferSizeBytes - (bytesRead + (int)octalCodeBytes), args);
|
||||||
|
|
||||||
theseBytesRead += lowerLevelBytes;
|
theseBytesRead += lowerLevelBytes;
|
||||||
|
|
||||||
|
@ -921,7 +921,7 @@ int Octree::encodeTreeBitstream(OctreeElementPointer element,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
roomForOctalCode = packetData->startSubTree(element->getOctalCode());
|
roomForOctalCode = packetData->startSubTree(element->getOctalCode());
|
||||||
codeLength = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(element->getOctalCode()));
|
codeLength = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(element->getOctalCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the octalcode couldn't fit, then we can return, because no nodes below us will fit...
|
// If the octalcode couldn't fit, then we can return, because no nodes below us will fit...
|
||||||
|
|
|
@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
|
||||||
_pendingPacketsLock.lock();
|
_pendingPacketsLock.lock();
|
||||||
_preServerSingleMessagePackets.push_back(std::move(packet));
|
_preServerSingleMessagePackets.push_back(std::move(packet));
|
||||||
// if we've saved MORE than our max, then clear out the oldest packet...
|
// if we've saved MORE than our max, then clear out the oldest packet...
|
||||||
int allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
|
int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
|
||||||
if (allPendingMessages > _maxPendingMessages) {
|
if (allPendingMessages > _maxPendingMessages) {
|
||||||
_preServerSingleMessagePackets.pop_front();
|
_preServerSingleMessagePackets.pop_front();
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
|
||||||
_preServerEdits.push_back(messagePair);
|
_preServerEdits.push_back(messagePair);
|
||||||
|
|
||||||
// if we've saved MORE than out max, then clear out the oldest packet...
|
// if we've saved MORE than out max, then clear out the oldest packet...
|
||||||
int allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
|
int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
|
||||||
if (allPendingMessages > _maxPendingMessages) {
|
if (allPendingMessages > _maxPendingMessages) {
|
||||||
_preServerEdits.pop_front();
|
_preServerEdits.pop_front();
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ bool OctreePacketData::startSubTree(const unsigned char* octcode) {
|
||||||
int possibleStartAt = _bytesInUse;
|
int possibleStartAt = _bytesInUse;
|
||||||
int length = 0;
|
int length = 0;
|
||||||
if (octcode) {
|
if (octcode) {
|
||||||
length = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octcode));
|
length = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octcode));
|
||||||
success = append(octcode, length); // handles checking compression
|
success = append(octcode, length); // handles checking compression
|
||||||
} else {
|
} else {
|
||||||
// NULL case, means root node, which is 0
|
// NULL case, means root node, which is 0
|
||||||
|
|
|
@ -109,7 +109,7 @@ int OctreeQuery::parseData(ReceivedMessage& message) {
|
||||||
|
|
||||||
auto bytesRead = sourceBuffer - startPosition;
|
auto bytesRead = sourceBuffer - startPosition;
|
||||||
auto bytesLeft = message.getSize() - bytesRead;
|
auto bytesLeft = message.getSize() - bytesRead;
|
||||||
if (bytesLeft >= sizeof(_keyholeRadius)) {
|
if (bytesLeft >= (int)sizeof(_keyholeRadius)) {
|
||||||
memcpy(&_keyholeRadius, sourceBuffer, sizeof(_keyholeRadius));
|
memcpy(&_keyholeRadius, sourceBuffer, sizeof(_keyholeRadius));
|
||||||
sourceBuffer += sizeof(_keyholeRadius);
|
sourceBuffer += sizeof(_keyholeRadius);
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,14 +123,14 @@ void OctreeSceneStats::copyFromOther(const OctreeSceneStats& other) {
|
||||||
|
|
||||||
// Now copy the values from the other
|
// Now copy the values from the other
|
||||||
if (other._jurisdictionRoot) {
|
if (other._jurisdictionRoot) {
|
||||||
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(other._jurisdictionRoot));
|
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(other._jurisdictionRoot));
|
||||||
_jurisdictionRoot = new unsigned char[bytes];
|
_jurisdictionRoot = new unsigned char[bytes];
|
||||||
memcpy(_jurisdictionRoot, other._jurisdictionRoot, bytes);
|
memcpy(_jurisdictionRoot, other._jurisdictionRoot, bytes);
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < other._jurisdictionEndNodes.size(); i++) {
|
for (size_t i = 0; i < other._jurisdictionEndNodes.size(); i++) {
|
||||||
unsigned char* endNodeCode = other._jurisdictionEndNodes[i];
|
unsigned char* endNodeCode = other._jurisdictionEndNodes[i];
|
||||||
if (endNodeCode) {
|
if (endNodeCode) {
|
||||||
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
|
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
|
||||||
unsigned char* endNodeCodeCopy = new unsigned char[bytes];
|
unsigned char* endNodeCodeCopy = new unsigned char[bytes];
|
||||||
memcpy(endNodeCodeCopy, endNodeCode, bytes);
|
memcpy(endNodeCodeCopy, endNodeCode, bytes);
|
||||||
_jurisdictionEndNodes.push_back(endNodeCodeCopy);
|
_jurisdictionEndNodes.push_back(endNodeCodeCopy);
|
||||||
|
@ -178,7 +178,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
|
||||||
if (jurisdictionMap) {
|
if (jurisdictionMap) {
|
||||||
unsigned char* jurisdictionRoot = jurisdictionMap->getRootOctalCode();
|
unsigned char* jurisdictionRoot = jurisdictionMap->getRootOctalCode();
|
||||||
if (jurisdictionRoot) {
|
if (jurisdictionRoot) {
|
||||||
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(jurisdictionRoot));
|
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(jurisdictionRoot));
|
||||||
_jurisdictionRoot = new unsigned char[bytes];
|
_jurisdictionRoot = new unsigned char[bytes];
|
||||||
memcpy(_jurisdictionRoot, jurisdictionRoot, bytes);
|
memcpy(_jurisdictionRoot, jurisdictionRoot, bytes);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
|
||||||
for (int i = 0; i < jurisdictionMap->getEndNodeCount(); i++) {
|
for (int i = 0; i < jurisdictionMap->getEndNodeCount(); i++) {
|
||||||
unsigned char* endNodeCode = jurisdictionMap->getEndNodeOctalCode(i);
|
unsigned char* endNodeCode = jurisdictionMap->getEndNodeOctalCode(i);
|
||||||
if (endNodeCode) {
|
if (endNodeCode) {
|
||||||
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
|
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
|
||||||
unsigned char* endNodeCodeCopy = new unsigned char[bytes];
|
unsigned char* endNodeCodeCopy = new unsigned char[bytes];
|
||||||
memcpy(endNodeCodeCopy, endNodeCode, bytes);
|
memcpy(endNodeCodeCopy, endNodeCode, bytes);
|
||||||
_jurisdictionEndNodes.push_back(endNodeCodeCopy);
|
_jurisdictionEndNodes.push_back(endNodeCodeCopy);
|
||||||
|
@ -418,18 +418,18 @@ int OctreeSceneStats::packIntoPacket() {
|
||||||
// add the root jurisdiction
|
// add the root jurisdiction
|
||||||
if (_jurisdictionRoot) {
|
if (_jurisdictionRoot) {
|
||||||
// copy the
|
// copy the
|
||||||
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
|
int bytes = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
|
||||||
_statsPacket->writePrimitive(bytes);
|
_statsPacket->writePrimitive(bytes);
|
||||||
_statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
|
_statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
|
||||||
|
|
||||||
// if and only if there's a root jurisdiction, also include the end elements
|
// if and only if there's a root jurisdiction, also include the end elements
|
||||||
int endNodeCount = _jurisdictionEndNodes.size();
|
int endNodeCount = (int)_jurisdictionEndNodes.size();
|
||||||
|
|
||||||
_statsPacket->writePrimitive(endNodeCount);
|
_statsPacket->writePrimitive(endNodeCount);
|
||||||
|
|
||||||
for (int i=0; i < endNodeCount; i++) {
|
for (int i=0; i < endNodeCount; i++) {
|
||||||
unsigned char* endNodeCode = _jurisdictionEndNodes[i];
|
unsigned char* endNodeCode = _jurisdictionEndNodes[i];
|
||||||
int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
|
auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
|
||||||
_statsPacket->writePrimitive(bytes);
|
_statsPacket->writePrimitive(bytes);
|
||||||
_statsPacket->write(reinterpret_cast<char*>(endNodeCode), bytes);
|
_statsPacket->write(reinterpret_cast<char*>(endNodeCode), bytes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public slots:
|
||||||
bool hasPacketsToSend() const { return _packetSender->hasPacketsToSend(); }
|
bool hasPacketsToSend() const { return _packetSender->hasPacketsToSend(); }
|
||||||
|
|
||||||
/// how many packets are there in the send queue waiting to be sent
|
/// how many packets are there in the send queue waiting to be sent
|
||||||
int packetsToSendCount() const { return _packetSender->packetsToSendCount(); }
|
int packetsToSendCount() const { return (int)_packetSender->packetsToSendCount(); }
|
||||||
|
|
||||||
/// returns the packets per second send rate of this object over its lifetime
|
/// returns the packets per second send rate of this object over its lifetime
|
||||||
float getLifetimePPS() const { return _packetSender->getLifetimePPS(); }
|
float getLifetimePPS() const { return _packetSender->getLifetimePPS(); }
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
virtual void updateShapeIfNecessary() = 0;
|
virtual void updateShapeIfNecessary() = 0;
|
||||||
|
|
||||||
// overrides from btCharacterControllerInterface
|
// overrides from btCharacterControllerInterface
|
||||||
virtual void setWalkDirection(const btVector3 &walkDirection) { assert(false); }
|
virtual void setWalkDirection(const btVector3 &walkDirection) override { assert(false); }
|
||||||
virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); }
|
virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); }
|
||||||
virtual void reset(btCollisionWorld* collisionWorld) override { }
|
virtual void reset(btCollisionWorld* collisionWorld) override { }
|
||||||
virtual void warp(const btVector3& origin) override { }
|
virtual void warp(const btVector3& origin) override { }
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override;
|
virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override;
|
||||||
virtual bool canJump() const override { assert(false); return false; } // never call this
|
virtual bool canJump() const override { assert(false); return false; } // never call this
|
||||||
virtual void jump() override;
|
virtual void jump() override;
|
||||||
virtual bool onGround() const;
|
virtual bool onGround() const override;
|
||||||
|
|
||||||
void preSimulation();
|
void preSimulation();
|
||||||
void postSimulation();
|
void postSimulation();
|
||||||
|
|
|
@ -271,7 +271,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
|
||||||
|
|
||||||
// create some variables to hold temporary results
|
// create some variables to hold temporary results
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
uint32_t numPoints = points.size();
|
uint32_t numPoints = (uint32_t)points.size();
|
||||||
#endif
|
#endif
|
||||||
const btVector3 p0(0.0f, 0.0f, 0.0f);
|
const btVector3 p0(0.0f, 0.0f, 0.0f);
|
||||||
btMatrix3x3 tetraInertia;
|
btMatrix3x3 tetraInertia;
|
||||||
|
@ -280,7 +280,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
|
||||||
btVector3 center;
|
btVector3 center;
|
||||||
|
|
||||||
// loop over triangles
|
// loop over triangles
|
||||||
uint32_t numTriangles = triangleIndices.size() / 3;
|
uint32_t numTriangles = (uint32_t)triangleIndices.size() / 3;
|
||||||
for (uint32_t i = 0; i < numTriangles; ++i) {
|
for (uint32_t i = 0; i < numTriangles; ++i) {
|
||||||
uint32_t t = 3 * i;
|
uint32_t t = 3 * i;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
|
@ -123,7 +123,7 @@ void Procedural::parse(const QJsonObject& proceduralData) {
|
||||||
_parsedChannels = channels.toArray();
|
_parsedChannels = channels.toArray();
|
||||||
size_t channelCount = std::min(MAX_PROCEDURAL_TEXTURE_CHANNELS, (size_t)_parsedChannels.size());
|
size_t channelCount = std::min(MAX_PROCEDURAL_TEXTURE_CHANNELS, (size_t)_parsedChannels.size());
|
||||||
for (size_t i = 0; i < channelCount; ++i) {
|
for (size_t i = 0; i < channelCount; ++i) {
|
||||||
QString url = _parsedChannels.at(i).toString();
|
QString url = _parsedChannels.at((int)i).toString();
|
||||||
_channels[i] = textureCache->getTexture(QUrl(url));
|
_channels[i] = textureCache->getTexture(QUrl(url));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm
|
||||||
gpuTexture->setSampler(sampler);
|
gpuTexture->setSampler(sampler);
|
||||||
gpuTexture->autoGenerateMips(-1);
|
gpuTexture->autoGenerateMips(-1);
|
||||||
}
|
}
|
||||||
batch.setResourceTexture(i, gpuTexture);
|
batch.setResourceTexture((gpu::uint32)i, gpuTexture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
batch.setIndexBuffer(gpu::UINT16, _indexBuffer, 0);
|
batch.setIndexBuffer(gpu::UINT16, _indexBuffer, 0);
|
||||||
|
|
||||||
auto numIndices = _indexBuffer->getSize() / sizeof(uint16_t);
|
auto numIndices = _indexBuffer->getSize() / sizeof(uint16_t);
|
||||||
batch.drawIndexed(gpu::LINES, numIndices);
|
batch.drawIndexed(gpu::LINES, (int)numIndices);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::PipelinePointer _pipeline;
|
gpu::PipelinePointer _pipeline;
|
||||||
|
@ -326,7 +326,7 @@ void AnimDebugDraw::update() {
|
||||||
for (auto& iter : _absolutePoses) {
|
for (auto& iter : _absolutePoses) {
|
||||||
AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);
|
AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);
|
||||||
numVerts += skeleton->getNumJoints() * VERTICES_PER_BONE;
|
numVerts += skeleton->getNumJoints() * VERTICES_PER_BONE;
|
||||||
for (int i = 0; i < skeleton->getNumJoints(); i++) {
|
for (auto i = 0; i < skeleton->getNumJoints(); i++) {
|
||||||
auto parentIndex = skeleton->getParentIndex(i);
|
auto parentIndex = skeleton->getParentIndex(i);
|
||||||
if (parentIndex >= 0) {
|
if (parentIndex >= 0) {
|
||||||
numVerts += VERTICES_PER_LINK;
|
numVerts += VERTICES_PER_LINK;
|
||||||
|
@ -336,9 +336,9 @@ void AnimDebugDraw::update() {
|
||||||
|
|
||||||
// count marker verts from shared DebugDraw singleton
|
// count marker verts from shared DebugDraw singleton
|
||||||
auto markerMap = DebugDraw::getInstance().getMarkerMap();
|
auto markerMap = DebugDraw::getInstance().getMarkerMap();
|
||||||
numVerts += markerMap.size() * VERTICES_PER_BONE;
|
numVerts += (int)markerMap.size() * VERTICES_PER_BONE;
|
||||||
auto myAvatarMarkerMap = DebugDraw::getInstance().getMyAvatarMarkerMap();
|
auto myAvatarMarkerMap = DebugDraw::getInstance().getMyAvatarMarkerMap();
|
||||||
numVerts += myAvatarMarkerMap.size() * VERTICES_PER_BONE;
|
numVerts += (int)myAvatarMarkerMap.size() * VERTICES_PER_BONE;
|
||||||
|
|
||||||
// allocate verts!
|
// allocate verts!
|
||||||
data._vertexBuffer->resize(sizeof(Vertex) * numVerts);
|
data._vertexBuffer->resize(sizeof(Vertex) * numVerts);
|
||||||
|
|
|
@ -314,7 +314,7 @@ void DeferredLightingEffect::addPointLight(const glm::vec3& position, float radi
|
||||||
void DeferredLightingEffect::addSpotLight(const glm::vec3& position, float radius, const glm::vec3& color,
|
void DeferredLightingEffect::addSpotLight(const glm::vec3& position, float radius, const glm::vec3& color,
|
||||||
float intensity, const glm::quat& orientation, float exponent, float cutoff) {
|
float intensity, const glm::quat& orientation, float exponent, float cutoff) {
|
||||||
|
|
||||||
unsigned int lightID = _pointLights.size() + _spotLights.size() + _globalLights.size();
|
unsigned int lightID = (unsigned int)(_pointLights.size() + _spotLights.size() + _globalLights.size());
|
||||||
if (lightID >= _allocatedLights.size()) {
|
if (lightID >= _allocatedLights.size()) {
|
||||||
_allocatedLights.push_back(std::make_shared<model::Light>());
|
_allocatedLights.push_back(std::make_shared<model::Light>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,28 +93,28 @@ void GeometryCache::ShapeData::setupBatch(gpu::Batch& batch) const {
|
||||||
void GeometryCache::ShapeData::draw(gpu::Batch& batch) const {
|
void GeometryCache::ShapeData::draw(gpu::Batch& batch) const {
|
||||||
if (_indexCount) {
|
if (_indexCount) {
|
||||||
setupBatch(batch);
|
setupBatch(batch);
|
||||||
batch.drawIndexed(gpu::TRIANGLES, _indexCount, _indexOffset);
|
batch.drawIndexed(gpu::TRIANGLES, (gpu::uint32)_indexCount, (gpu::uint32)_indexOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryCache::ShapeData::drawWire(gpu::Batch& batch) const {
|
void GeometryCache::ShapeData::drawWire(gpu::Batch& batch) const {
|
||||||
if (_wireIndexCount) {
|
if (_wireIndexCount) {
|
||||||
setupBatch(batch);
|
setupBatch(batch);
|
||||||
batch.drawIndexed(gpu::LINES, _wireIndexCount, _wireIndexOffset);
|
batch.drawIndexed(gpu::LINES, (gpu::uint32)_wireIndexCount, (gpu::uint32)_wireIndexOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryCache::ShapeData::drawInstances(gpu::Batch& batch, size_t count) const {
|
void GeometryCache::ShapeData::drawInstances(gpu::Batch& batch, size_t count) const {
|
||||||
if (_indexCount) {
|
if (_indexCount) {
|
||||||
setupBatch(batch);
|
setupBatch(batch);
|
||||||
batch.drawIndexedInstanced(count, gpu::TRIANGLES, _indexCount, _indexOffset);
|
batch.drawIndexedInstanced((gpu::uint32)count, gpu::TRIANGLES, (gpu::uint32)_indexCount, (gpu::uint32)_indexOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryCache::ShapeData::drawWireInstances(gpu::Batch& batch, size_t count) const {
|
void GeometryCache::ShapeData::drawWireInstances(gpu::Batch& batch, size_t count) const {
|
||||||
if (_wireIndexCount) {
|
if (_wireIndexCount) {
|
||||||
setupBatch(batch);
|
setupBatch(batch);
|
||||||
batch.drawIndexedInstanced(count, gpu::LINES, _wireIndexCount, _wireIndexOffset);
|
batch.drawIndexedInstanced((gpu::uint32)count, gpu::LINES, (gpu::uint32)_wireIndexCount, (gpu::uint32)_wireIndexOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ size_t GeometryCache::getCubeTriangleCount() {
|
||||||
void GeometryCache::buildShapes() {
|
void GeometryCache::buildShapes() {
|
||||||
auto vertexBuffer = std::make_shared<gpu::Buffer>();
|
auto vertexBuffer = std::make_shared<gpu::Buffer>();
|
||||||
auto indexBuffer = std::make_shared<gpu::Buffer>();
|
auto indexBuffer = std::make_shared<gpu::Buffer>();
|
||||||
uint16_t startingIndex = 0;
|
size_t startingIndex = 0;
|
||||||
|
|
||||||
// Cube
|
// Cube
|
||||||
startingIndex = _shapeVertices->getSize() / SHAPE_VERTEX_STRIDE;
|
startingIndex = _shapeVertices->getSize() / SHAPE_VERTEX_STRIDE;
|
||||||
|
@ -324,7 +324,7 @@ void GeometryCache::buildShapes() {
|
||||||
20, 21, 22, 22, 23, 20 // back
|
20, 21, 22, 22, 23, 20 // back
|
||||||
};
|
};
|
||||||
for (auto& index : indices) {
|
for (auto& index : indices) {
|
||||||
index += startingIndex;
|
index += (uint16_t)startingIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
IndexVector wireIndices{
|
IndexVector wireIndices{
|
||||||
|
@ -334,7 +334,7 @@ void GeometryCache::buildShapes() {
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < wireIndices.size(); ++i) {
|
for (size_t i = 0; i < wireIndices.size(); ++i) {
|
||||||
indices[i] += startingIndex;
|
indices[i] += (uint16_t)startingIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
shapeData.setupIndices(_shapeIndices, indices, wireIndices);
|
shapeData.setupIndices(_shapeIndices, indices, wireIndices);
|
||||||
|
@ -375,7 +375,7 @@ void GeometryCache::buildShapes() {
|
||||||
for (size_t j = 0; j < VERTICES_PER_TRIANGLE; ++j) {
|
for (size_t j = 0; j < VERTICES_PER_TRIANGLE; ++j) {
|
||||||
auto triangleVertexIndex = j;
|
auto triangleVertexIndex = j;
|
||||||
auto vertexIndex = triangleStartIndex + triangleVertexIndex;
|
auto vertexIndex = triangleStartIndex + triangleVertexIndex;
|
||||||
indices.push_back(vertexIndex + startingIndex);
|
indices.push_back((uint16_t)(vertexIndex + startingIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ void GeometryCache::buildShapes() {
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < wireIndices.size(); ++i) {
|
for (size_t i = 0; i < wireIndices.size(); ++i) {
|
||||||
wireIndices[i] += startingIndex;
|
wireIndices[i] += (uint16_t)startingIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
shapeData.setupIndices(_shapeIndices, indices, wireIndices);
|
shapeData.setupIndices(_shapeIndices, indices, wireIndices);
|
||||||
|
@ -411,7 +411,7 @@ void GeometryCache::buildShapes() {
|
||||||
// Spheres use the same values for vertices and normals
|
// Spheres use the same values for vertices and normals
|
||||||
vertices.push_back(vertex);
|
vertices.push_back(vertex);
|
||||||
vertices.push_back(vertex);
|
vertices.push_back(vertex);
|
||||||
indices.push_back(vertexIndex + startingIndex);
|
indices.push_back((uint16_t)(vertexIndex + startingIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -445,7 +445,7 @@ void GeometryCache::buildShapes() {
|
||||||
auto vertexIndex = triangleStartIndex + triangleVertexIndex;
|
auto vertexIndex = triangleStartIndex + triangleVertexIndex;
|
||||||
vertices.push_back(glm::normalize(originalVertices[vertexIndex]));
|
vertices.push_back(glm::normalize(originalVertices[vertexIndex]));
|
||||||
vertices.push_back(faceNormal);
|
vertices.push_back(faceNormal);
|
||||||
indices.push_back(vertexIndex + startingIndex);
|
indices.push_back((uint16_t)(vertexIndex + startingIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,8 +465,8 @@ void GeometryCache::buildShapes() {
|
||||||
});
|
});
|
||||||
IndexVector wireIndices;
|
IndexVector wireIndices;
|
||||||
// Only two indices
|
// Only two indices
|
||||||
wireIndices.push_back(0 + startingIndex);
|
wireIndices.push_back(0 + (uint16_t)startingIndex);
|
||||||
wireIndices.push_back(1 + startingIndex);
|
wireIndices.push_back(1 + (uint16_t)startingIndex);
|
||||||
|
|
||||||
shapeData.setupIndices(_shapeIndices, IndexVector(), wireIndices);
|
shapeData.setupIndices(_shapeIndices, IndexVector(), wireIndices);
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the number of joint states in the model.
|
/// Returns the number of joint states in the model.
|
||||||
int getJointStateCount() const { return _rig->getJointStateCount(); }
|
int getJointStateCount() const { return (int)_rig->getJointStateCount(); }
|
||||||
bool getJointPositionInWorldFrame(int jointIndex, glm::vec3& position) const;
|
bool getJointPositionInWorldFrame(int jointIndex, glm::vec3& position) const;
|
||||||
bool getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation) const;
|
bool getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation) const;
|
||||||
bool getJointCombinedRotation(int jointIndex, glm::quat& rotation) const;
|
bool getJointCombinedRotation(int jointIndex, glm::quat& rotation) const;
|
||||||
|
|
|
@ -91,12 +91,12 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
|
||||||
_jobs.push_back(Job(new AmbientOcclusion::JobModel("AmbientOcclusion")));
|
_jobs.push_back(Job(new AmbientOcclusion::JobModel("AmbientOcclusion")));
|
||||||
|
|
||||||
_jobs.back().setEnabled(false);
|
_jobs.back().setEnabled(false);
|
||||||
_occlusionJobIndex = _jobs.size() - 1;
|
_occlusionJobIndex = (int)_jobs.size() - 1;
|
||||||
|
|
||||||
_jobs.push_back(Job(new Antialiasing::JobModel("Antialiasing")));
|
_jobs.push_back(Job(new Antialiasing::JobModel("Antialiasing")));
|
||||||
|
|
||||||
_jobs.back().setEnabled(false);
|
_jobs.back().setEnabled(false);
|
||||||
_antialiasingJobIndex = _jobs.size() - 1;
|
_antialiasingJobIndex = (int)_jobs.size() - 1;
|
||||||
|
|
||||||
_jobs.push_back(Job(new FetchItems::JobModel("FetchTransparent",
|
_jobs.push_back(Job(new FetchItems::JobModel("FetchTransparent",
|
||||||
FetchItems(
|
FetchItems(
|
||||||
|
@ -119,13 +119,13 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
|
||||||
_jobs.push_back(Job(new render::DrawStatus::JobModel("DrawStatus", renderedOpaques, DrawStatus(statusIconMap))));
|
_jobs.push_back(Job(new render::DrawStatus::JobModel("DrawStatus", renderedOpaques, DrawStatus(statusIconMap))));
|
||||||
|
|
||||||
_jobs.back().setEnabled(false);
|
_jobs.back().setEnabled(false);
|
||||||
_drawStatusJobIndex = _jobs.size() - 1;
|
_drawStatusJobIndex = (int)_jobs.size() - 1;
|
||||||
|
|
||||||
_jobs.push_back(Job(new DrawOverlay3D::JobModel("DrawOverlay3D")));
|
_jobs.push_back(Job(new DrawOverlay3D::JobModel("DrawOverlay3D")));
|
||||||
|
|
||||||
_jobs.push_back(Job(new HitEffect::JobModel("HitEffect")));
|
_jobs.push_back(Job(new HitEffect::JobModel("HitEffect")));
|
||||||
_jobs.back().setEnabled(false);
|
_jobs.back().setEnabled(false);
|
||||||
_drawHitEffectJobIndex = _jobs.size() -1;
|
_drawHitEffectJobIndex = (int)_jobs.size() -1;
|
||||||
|
|
||||||
|
|
||||||
// Give ourselves 3 frmaes of timer queries
|
// Give ourselves 3 frmaes of timer queries
|
||||||
|
@ -181,7 +181,7 @@ void DrawOpaqueDeferred::run(const SceneContextPointer& sceneContext, const Rend
|
||||||
batch.setStateScissorRect(args->_viewport);
|
batch.setStateScissorRect(args->_viewport);
|
||||||
args->_batch = &batch;
|
args->_batch = &batch;
|
||||||
|
|
||||||
renderContext->_numDrawnOpaqueItems = inItems.size();
|
renderContext->_numDrawnOpaqueItems = (int)inItems.size();
|
||||||
|
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -210,7 +210,7 @@ void DrawTransparentDeferred::run(const SceneContextPointer& sceneContext, const
|
||||||
batch.setStateScissorRect(args->_viewport);
|
batch.setStateScissorRect(args->_viewport);
|
||||||
args->_batch = &batch;
|
args->_batch = &batch;
|
||||||
|
|
||||||
renderContext->_numDrawnTransparentItems = inItems.size();
|
renderContext->_numDrawnTransparentItems = (int)inItems.size();
|
||||||
|
|
||||||
glm::mat4 projMat;
|
glm::mat4 projMat;
|
||||||
Transform viewMat;
|
Transform viewMat;
|
||||||
|
@ -262,8 +262,8 @@ void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderCon
|
||||||
inItems.emplace_back(id);
|
inItems.emplace_back(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
renderContext->_numFeedOverlay3DItems = inItems.size();
|
renderContext->_numFeedOverlay3DItems = (int)inItems.size();
|
||||||
renderContext->_numDrawnOverlay3DItems = inItems.size();
|
renderContext->_numDrawnOverlay3DItems = (int)inItems.size();
|
||||||
|
|
||||||
if (!inItems.empty()) {
|
if (!inItems.empty()) {
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
|
|
|
@ -107,7 +107,7 @@ void FetchItems::run(const SceneContextPointer& sceneContext, const RenderContex
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_probeNumItems) {
|
if (_probeNumItems) {
|
||||||
_probeNumItems(renderContext, outItems.size());
|
_probeNumItems(renderContext, (int)outItems.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -495,7 +495,7 @@ public:
|
||||||
/// WARNING, There is No check on the validity of the ID, so this could return a bad Item
|
/// WARNING, There is No check on the validity of the ID, so this could return a bad Item
|
||||||
const Item& getItem(const ItemID& id) const { return _items[id]; }
|
const Item& getItem(const ItemID& id) const { return _items[id]; }
|
||||||
|
|
||||||
unsigned int getNumItems() const { return _items.size(); }
|
size_t getNumItems() const { return _items.size(); }
|
||||||
|
|
||||||
|
|
||||||
void processPendingChangesQueue();
|
void processPendingChangesQueue();
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
inline void readCompressedCount(T& result) {
|
inline void readCompressedCount(T& result) {
|
||||||
// FIXME switch to a heapless implementation as soon as Brad provides it.
|
// FIXME switch to a heapless implementation as soon as Brad provides it.
|
||||||
ByteCountCoded<T> codec;
|
ByteCountCoded<T> codec;
|
||||||
_offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), remaining());
|
_offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), (int)remaining());
|
||||||
result = codec.data;
|
result = codec.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
|
||||||
clear(); // we are cleared out!
|
clear(); // we are cleared out!
|
||||||
|
|
||||||
size_t bytesConsumed = 0;
|
size_t bytesConsumed = 0;
|
||||||
int bitCount = BITS_IN_BYTE * size;
|
int bitCount = BITS_IN_BYTE * (int)size;
|
||||||
|
|
||||||
int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
|
int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
|
||||||
int leadBits = 1; // there is always at least 1 lead bit
|
int leadBits = 1; // there is always at least 1 lead bit
|
||||||
|
@ -246,7 +246,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_encodedLength = bytesConsumed;
|
_encodedLength = (int)bytesConsumed;
|
||||||
return bytesConsumed;
|
return bytesConsumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Item {
|
struct Item {
|
||||||
int _considered = 0;
|
size_t _considered = 0;
|
||||||
int _rendered = 0;
|
size_t _rendered = 0;
|
||||||
int _outOfView = 0;
|
int _outOfView = 0;
|
||||||
int _tooSmall = 0;
|
int _tooSmall = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -334,8 +334,8 @@ unsigned char* pointToVoxel(float x, float y, float z, float s, unsigned char r,
|
||||||
voxelSizeInOctets++;
|
voxelSizeInOctets++;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1;
|
auto voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1;
|
||||||
unsigned int voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color
|
auto voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color
|
||||||
|
|
||||||
// allocate our resulting buffer
|
// allocate our resulting buffer
|
||||||
unsigned char* voxelOut = new unsigned char[voxelBufferSize];
|
unsigned char* voxelOut = new unsigned char[voxelBufferSize];
|
||||||
|
|
|
@ -30,8 +30,8 @@ T glmFromJson(const QJsonValue& json) {
|
||||||
T result;
|
T result;
|
||||||
if (json.isArray()) {
|
if (json.isArray()) {
|
||||||
QJsonArray array = json.toArray();
|
QJsonArray array = json.toArray();
|
||||||
size_t length = std::min(array.size(), result.length());
|
auto length = std::min(array.size(), result.length());
|
||||||
for (size_t i = 0; i < length; ++i) {
|
for (auto i = 0; i < length; ++i) {
|
||||||
result[i] = (float)array[i].toDouble();
|
result[i] = (float)array[i].toDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,10 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
|
||||||
|
|
||||||
//in this function, you can write the message to any stream!
|
//in this function, you can write the message to any stream!
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case QtInfoMsg:
|
||||||
|
fprintf(stdout, "UnknownType: %s\n", qPrintable(msg));
|
||||||
|
txt += msg;
|
||||||
|
break;
|
||||||
case QtDebugMsg:
|
case QtDebugMsg:
|
||||||
fprintf(stdout, "Debug: %s\n", qPrintable(msg));
|
fprintf(stdout, "Debug: %s\n", qPrintable(msg));
|
||||||
txt += msg;
|
txt += msg;
|
||||||
|
@ -72,6 +76,7 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
fprintf(stdout, "Fatal: %s\n", qPrintable(msg));
|
fprintf(stdout, "Fatal: %s\n", qPrintable(msg));
|
||||||
txt += msg;
|
txt += msg;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outStream) {
|
if (outStream) {
|
||||||
|
|
|
@ -121,7 +121,7 @@ void testPropertyFlags(uint32_t value) {
|
||||||
|
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
int decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size());
|
int decodeSize = (int)decodeNew.decode((const uint8_t*)encoded.data(), (int)encoded.size());
|
||||||
Q_ASSERT(originalSize == decodeSize);
|
Q_ASSERT(originalSize == decodeSize);
|
||||||
Q_ASSERT(decodeNew == original);
|
Q_ASSERT(decodeNew == original);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
#include <gpu/StandardShaderLib.h>
|
#include <gpu/StandardShaderLib.h>
|
||||||
#include <gpu/GLBackend.h>
|
#include <gpu/GLBackend.h>
|
||||||
|
|
||||||
#include <QOpenGLContextWrapper.h>
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
#include <QOpenGLDebugLoggerWrapper.h>
|
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||||
|
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
#include <PathUtils.h>
|
#include <PathUtils.h>
|
||||||
|
@ -58,7 +58,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int count() const {
|
unsigned int count() const {
|
||||||
return times.size() - 1;
|
return (unsigned int)times.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
float elapsed() const {
|
float elapsed() const {
|
||||||
|
@ -283,10 +283,10 @@ public:
|
||||||
GeometryCache::ShapeData shapeData = geometryCache->_shapes[shape];
|
GeometryCache::ShapeData shapeData = geometryCache->_shapes[shape];
|
||||||
{
|
{
|
||||||
gpu::Batch::DrawIndexedIndirectCommand indirectCommand;
|
gpu::Batch::DrawIndexedIndirectCommand indirectCommand;
|
||||||
indirectCommand._count = shapeData._indexCount;
|
indirectCommand._count = (uint)shapeData._indexCount;
|
||||||
indirectCommand._instanceCount = ITEM_COUNT;
|
indirectCommand._instanceCount = ITEM_COUNT;
|
||||||
indirectCommand._baseInstance = i * ITEM_COUNT;
|
indirectCommand._baseInstance = (uint)(i * ITEM_COUNT);
|
||||||
indirectCommand._firstIndex = shapeData._indexOffset / 2;
|
indirectCommand._firstIndex = (uint)shapeData._indexOffset / 2;
|
||||||
indirectCommand._baseVertex = 0;
|
indirectCommand._baseVertex = 0;
|
||||||
indirectBuffer->append(indirectCommand);
|
indirectBuffer->append(indirectCommand);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
#include <gpu/GLBackend.h>
|
#include <gpu/GLBackend.h>
|
||||||
|
|
||||||
#include <QOpenGLContextWrapper.h>
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
#include <QOpenGLDebugLoggerWrapper.h>
|
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
@ -38,7 +38,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int count() const {
|
unsigned int count() const {
|
||||||
return times.size() - 1;
|
return (unsigned int)times.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
float elapsed() const {
|
float elapsed() const {
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
|
|
||||||
#include <gl/GLHelpers.h>
|
#include <gl/GLHelpers.h>
|
||||||
|
|
||||||
#include <QOpenGLDebugLoggerWrapper.h>
|
#include <gl/QOpenGLDebugLoggerWrapper.h>
|
||||||
#include <QOpenGLContextWrapper.h>
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
|
|
||||||
#include "../model/Skybox_vert.h"
|
#include "../model/Skybox_vert.h"
|
||||||
#include "../model/Skybox_frag.h"
|
#include "../model/Skybox_frag.h"
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
times.clear();
|
times.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int count() const {
|
size_t count() const {
|
||||||
return times.size() - 1;
|
return times.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -730,7 +730,8 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
|
||||||
BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
|
BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
|
||||||
if (funcBlock) {
|
if (funcBlock) {
|
||||||
// before diving in the func tree, let's modify the vars with the local defs:
|
// before diving in the func tree, let's modify the vars with the local defs:
|
||||||
int nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
|
int nbParams = (int)std::min(block->command.arguments.size(),
|
||||||
|
funcBlock->command.arguments.size());
|
||||||
std::vector< String > paramCache;
|
std::vector< String > paramCache;
|
||||||
paramCache.push_back("");
|
paramCache.push_back("");
|
||||||
String val;
|
String val;
|
||||||
|
@ -839,7 +840,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
|
||||||
String val;
|
String val;
|
||||||
for (unsigned int t = 1; t < block->command.arguments.size(); t++) {
|
for (unsigned int t = 1; t < block->command.arguments.size(); t++) {
|
||||||
// detect if a param is a var
|
// detect if a param is a var
|
||||||
int len = block->command.arguments[t].length();
|
auto len = block->command.arguments[t].length();
|
||||||
if ((block->command.arguments[t][0] == Tag::VAR)
|
if ((block->command.arguments[t][0] == Tag::VAR)
|
||||||
&& (block->command.arguments[t][len - 1] == Tag::VAR)) {
|
&& (block->command.arguments[t][len - 1] == Tag::VAR)) {
|
||||||
String var = block->command.arguments[t].substr(1, len - 2);
|
String var = block->command.arguments[t].substr(1, len - 2);
|
||||||
|
|
|
@ -311,8 +311,8 @@ void UDTTest::sendPacket() {
|
||||||
|
|
||||||
packetList->closeCurrentPacket();
|
packetList->closeCurrentPacket();
|
||||||
|
|
||||||
_totalQueuedBytes += packetList->getDataSize();
|
_totalQueuedBytes += (int)packetList->getDataSize();
|
||||||
_totalQueuedPackets += packetList->getNumPackets();
|
_totalQueuedPackets += (int)packetList->getNumPackets();
|
||||||
|
|
||||||
_socket.writePacketList(std::move(packetList), _target);
|
_socket.writePacketList(std::move(packetList), _target);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ void vhacd::VHACDUtil::fattenMeshes(const FBXMesh& mesh, FBXMesh& result,
|
||||||
getTrianglesInMeshPart(meshPart, triangles);
|
getTrianglesInMeshPart(meshPart, triangles);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int triangleCount = triangles.size() / 3;
|
auto triangleCount = triangles.size() / 3;
|
||||||
if (triangleCount == 0) {
|
if (triangleCount == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ bool vhacd::VHACDUtil::computeVHACD(FBXGeometry& geometry,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nPoints = vertices.size();
|
auto nPoints = vertices.size();
|
||||||
AABox aaBox = getAABoxForMeshPart(mesh, meshPart);
|
AABox aaBox = getAABoxForMeshPart(mesh, meshPart);
|
||||||
const float largestDimension = aaBox.getLargestDimension();
|
const float largestDimension = aaBox.getLargestDimension();
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ bool vhacd::VHACDUtil::computeVHACD(FBXGeometry& geometry,
|
||||||
|
|
||||||
|
|
||||||
// compute approximate convex decomposition
|
// compute approximate convex decomposition
|
||||||
bool res = interfaceVHACD->Compute(&vertices[0].x, 3, nPoints, &triangles[0], 3, triangleCount, params);
|
bool res = interfaceVHACD->Compute(&vertices[0].x, 3, (uint)nPoints, &triangles[0], 3, triangleCount, params);
|
||||||
if (!res){
|
if (!res){
|
||||||
qDebug() << "V-HACD computation failed for Mesh : " << count;
|
qDebug() << "V-HACD computation failed for Mesh : " << count;
|
||||||
count++;
|
count++;
|
||||||
|
|
Loading…
Reference in a new issue