mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-02 11:00:21 +02:00
Merge pull request #1007 from HifiExperiments/warnings_master2
Fix more warnings
This commit is contained in:
commit
9047d6a190
11 changed files with 61 additions and 52 deletions
|
@ -5768,8 +5768,7 @@ void MyAvatar::FollowHelper::deactivate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
|
void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
|
||||||
int int_type = static_cast<int>(type);
|
assert((int)type >= 0 && (int)type < static_cast<int>(CharacterController::FollowType::Count));
|
||||||
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
|
|
||||||
_timeRemaining[(int)type] = 0.0f;
|
_timeRemaining[(int)type] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5777,16 +5776,14 @@ void MyAvatar::FollowHelper::deactivate(CharacterController::FollowType type) {
|
||||||
// eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately
|
// eg. activate(FollowType::Rotation, true) snaps the FollowHelper's rotation immediately
|
||||||
// to the rotation of its _followDesiredBodyTransform.
|
// to the rotation of its _followDesiredBodyTransform.
|
||||||
void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) {
|
void MyAvatar::FollowHelper::activate(CharacterController::FollowType type, const bool snapFollow) {
|
||||||
int int_type = static_cast<int>(type);
|
assert((int)type >= 0 && (int)type < static_cast<int>(CharacterController::FollowType::Count));
|
||||||
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
|
|
||||||
|
|
||||||
// TODO: Perhaps, the follow time should be proportional to the displacement.
|
// TODO: Perhaps, the follow time should be proportional to the displacement.
|
||||||
_timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME;
|
_timeRemaining[(int)type] = snapFollow ? CharacterController::FOLLOW_TIME_IMMEDIATE_SNAP : FOLLOW_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const {
|
bool MyAvatar::FollowHelper::isActive(CharacterController::FollowType type) const {
|
||||||
int int_type = static_cast<int>(type);
|
assert((int)type >= 0 && (int)type < static_cast<int>(CharacterController::FollowType::Count));
|
||||||
assert(int_type >= 0 && int_type < static_cast<int>(CharacterController::FollowType::Count));
|
|
||||||
return _timeRemaining[(int)type] > 0.0f;
|
return _timeRemaining[(int)type] > 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ void Mesh::setVertexFormatAndStream(const gpu::Stream::FormatPointer& vf, const
|
||||||
|
|
||||||
// We require meshes to have a color attribute. If they don't, we default to white.
|
// We require meshes to have a color attribute. If they don't, we default to white.
|
||||||
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
if (!_vertexFormat->hasAttribute(gpu::Stream::COLOR)) {
|
||||||
int channelNum = _vertexStream.getNumBuffers();
|
gpu::Stream::Slot channelNum = (gpu::Stream::Slot)_vertexStream.getNumBuffers();
|
||||||
_vertexFormat->setAttribute(gpu::Stream::COLOR, channelNum, gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), 0, gpu::Stream::PER_INSTANCE);
|
_vertexFormat->setAttribute(gpu::Stream::COLOR, channelNum, gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA), 0, gpu::Stream::PER_INSTANCE);
|
||||||
_vertexStream.addBuffer(_colorBuffer, 0, _vertexFormat->getChannels().at(channelNum)._stride);
|
_vertexStream.addBuffer(_colorBuffer, 0, _vertexFormat->getChannels().at(channelNum)._stride);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include <qfile.h>
|
#include <qfile.h>
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#include <glm/gtx/transform.hpp>
|
#include <glm/gtx/transform.hpp>
|
||||||
|
|
||||||
#include <shared/NsightHelpers.h>
|
#include <shared/NsightHelpers.h>
|
||||||
|
@ -42,6 +44,18 @@
|
||||||
|
|
||||||
#include "FBXSerializer.h"
|
#include "FBXSerializer.h"
|
||||||
|
|
||||||
|
float atof_locale_independent(char* str) {
|
||||||
|
//TODO: Once we have C++17 we can use std::from_chars
|
||||||
|
std::istringstream streamToParse(str);
|
||||||
|
streamToParse.imbue(std::locale("C"));
|
||||||
|
float value;
|
||||||
|
if (!(streamToParse >> value)) {
|
||||||
|
qDebug(modelformat) << "cgltf: Cannot parse float from string: " << str;
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
#define GLTF_GET_INDICIES(accCount) int index1 = (indices[n + 0] * accCount); int index2 = (indices[n + 1] * accCount); int index3 = (indices[n + 2] * accCount);
|
#define GLTF_GET_INDICIES(accCount) int index1 = (indices[n + 0] * accCount); int index2 = (indices[n + 1] * accCount); int index3 = (indices[n + 2] * accCount);
|
||||||
|
|
||||||
#define GLTF_APPEND_ARRAY_1(newArray, oldArray) GLTF_GET_INDICIES(1) \
|
#define GLTF_APPEND_ARRAY_1(newArray, oldArray) GLTF_GET_INDICIES(1) \
|
||||||
|
@ -148,8 +162,8 @@ bool findNodeInPointerArray(const cgltf_node *nodePointer, cgltf_node **nodes, s
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> bool findPointerInArray(const T *pointer, const T *array, size_t arraySize, int &index) {
|
template<typename T> bool findPointerInArray(const T *pointer, const T *array, size_t arraySize, size_t &index) {
|
||||||
for (int i = 0; i < arraySize; i++) {
|
for (size_t i = 0; i < arraySize; i++) {
|
||||||
if (&array[i] == pointer) {
|
if (&array[i] == pointer) {
|
||||||
index = i;
|
index = i;
|
||||||
return true;
|
return true;
|
||||||
|
@ -187,13 +201,13 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
auto &node = _data->nodes[index];
|
auto &node = _data->nodes[index];
|
||||||
for(size_t childIndexInParent = 0; childIndexInParent < node.children_count; childIndexInParent++) {
|
for(size_t childIndexInParent = 0; childIndexInParent < node.children_count; childIndexInParent++) {
|
||||||
cgltf_node *child = node.children[childIndexInParent];
|
cgltf_node *child = node.children[childIndexInParent];
|
||||||
int childIndex = 0;
|
size_t childIndex = 0;
|
||||||
if (!findPointerInArray(child, _data->nodes, _data->nodes_count, childIndex)) {
|
if (!findPointerInArray(child, _data->nodes, _data->nodes_count, childIndex)) {
|
||||||
qDebug(modelformat) << "findPointerInArray failed for model: " << _url;
|
qDebug(modelformat) << "findPointerInArray failed for model: " << _url;
|
||||||
hfmModel.loadErrorCount++;
|
hfmModel.loadErrorCount++;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
parents[childIndex] = index;
|
parents[(int)childIndex] = index;
|
||||||
}
|
}
|
||||||
sortedNodes.push_back(index);
|
sortedNodes.push_back(index);
|
||||||
}
|
}
|
||||||
|
@ -918,14 +932,14 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int jointIndex = 0;
|
size_t jointIndex = 0;
|
||||||
if (!findPointerInArray(node.skin->joints[clusterJoints[c]], _data->nodes, _data->nodes_count, jointIndex)) {
|
if (!findPointerInArray(node.skin->joints[clusterJoints[c]], _data->nodes, _data->nodes_count, jointIndex)) {
|
||||||
qCWarning(modelformat) << "Cannot find the joint " << node.skin->joints[clusterJoints[c]]->name <<" in joint array";
|
qCWarning(modelformat) << "Cannot find the joint " << node.skin->joints[clusterJoints[c]]->name <<" in joint array";
|
||||||
hfmModel.loadErrorCount++;
|
hfmModel.loadErrorCount++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mesh.clusterIndices[prevMeshClusterIndexCount + c] =
|
mesh.clusterIndices[prevMeshClusterIndexCount + c] =
|
||||||
originalToNewNodeIndexMap[jointIndex];
|
originalToNewNodeIndexMap[(int)jointIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
// normalize and compress to 16-bits
|
// normalize and compress to 16-bits
|
||||||
|
@ -961,14 +975,14 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int materialIndex = 0;
|
size_t materialIndex = 0;
|
||||||
if (primitive.material != nullptr && !findPointerInArray(primitive.material, _data->materials, _data->materials_count, materialIndex)) {
|
if (primitive.material != nullptr && !findPointerInArray(primitive.material, _data->materials, _data->materials_count, materialIndex)) {
|
||||||
qCWarning(modelformat) << "GLTFSerializer::buildGeometry: Invalid material pointer";
|
qCWarning(modelformat) << "GLTFSerializer::buildGeometry: Invalid material pointer";
|
||||||
hfmModel.loadErrorCount++;
|
hfmModel.loadErrorCount++;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (primitive.material != nullptr) {
|
if (primitive.material != nullptr) {
|
||||||
part.materialID = materialIDs[materialIndex];
|
part.materialID = materialIDs[(int)materialIndex];
|
||||||
}
|
}
|
||||||
mesh.parts.push_back(part);
|
mesh.parts.push_back(part);
|
||||||
|
|
||||||
|
@ -1306,7 +1320,7 @@ HFMTexture GLTFSerializer::getHFMTexture(const cgltf_texture *texture) {
|
||||||
size_t offset = bufferView->offset;
|
size_t offset = bufferView->offset;
|
||||||
int length = (int)bufferView->size;
|
int length = (int)bufferView->size;
|
||||||
|
|
||||||
int imageIndex = 0;
|
size_t imageIndex = 0;
|
||||||
if (!findPointerInArray(image, _data->images, _data->images_count, imageIndex)) {
|
if (!findPointerInArray(image, _data->images, _data->images_count, imageIndex)) {
|
||||||
// This should never happen. It would mean a bug in cgltf library.
|
// This should never happen. It would mean a bug in cgltf library.
|
||||||
qDebug(modelformat) << "GLTFSerializer::getHFMTexture: can't find texture in the array";
|
qDebug(modelformat) << "GLTFSerializer::getHFMTexture: can't find texture in the array";
|
||||||
|
@ -1346,7 +1360,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const cgltf_material& m
|
||||||
}
|
}
|
||||||
if (mToonExtension["shadeMultiplyTexture"].isObject()) {
|
if (mToonExtension["shadeMultiplyTexture"].isObject()) {
|
||||||
QJsonObject object = mToonExtension["shadeMultiplyTexture"].toObject();
|
QJsonObject object = mToonExtension["shadeMultiplyTexture"].toObject();
|
||||||
if (object["index"].isDouble() && object["index"].toInt() < _data->textures_count) {
|
if (object["index"].isDouble() && object["index"].toInt() < (int)_data->textures_count) {
|
||||||
hfmMat.shadeTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
hfmMat.shadeTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1355,7 +1369,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const cgltf_material& m
|
||||||
}
|
}
|
||||||
if (mToonExtension["shadingShiftTexture"].isObject()) {
|
if (mToonExtension["shadingShiftTexture"].isObject()) {
|
||||||
QJsonObject object = mToonExtension["shadingShiftTexture"].toObject();
|
QJsonObject object = mToonExtension["shadingShiftTexture"].toObject();
|
||||||
if (object["index"].isDouble() && object["index"].toInt() < _data->textures_count) {
|
if (object["index"].isDouble() && object["index"].toInt() < (int)_data->textures_count) {
|
||||||
hfmMat.shadingShiftTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
hfmMat.shadingShiftTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1370,7 +1384,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const cgltf_material& m
|
||||||
}
|
}
|
||||||
if (mToonExtension["matcapTexture"].isObject()) {
|
if (mToonExtension["matcapTexture"].isObject()) {
|
||||||
QJsonObject object = mToonExtension["matcapTexture"].toObject();
|
QJsonObject object = mToonExtension["matcapTexture"].toObject();
|
||||||
if (object["index"].isDouble() && object["index"].toInt() < _data->textures_count) {
|
if (object["index"].isDouble() && object["index"].toInt() < (int)_data->textures_count) {
|
||||||
hfmMat.matcapTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
hfmMat.matcapTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1388,7 +1402,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const cgltf_material& m
|
||||||
}
|
}
|
||||||
if (mToonExtension["rimMultiplyTexture"].isObject()) {
|
if (mToonExtension["rimMultiplyTexture"].isObject()) {
|
||||||
QJsonObject object = mToonExtension["rimMultiplyTexture"].toObject();
|
QJsonObject object = mToonExtension["rimMultiplyTexture"].toObject();
|
||||||
if (object["index"].isDouble() && object["index"].toInt() < _data->textures_count) {
|
if (object["index"].isDouble() && object["index"].toInt() < (int)_data->textures_count) {
|
||||||
hfmMat.rimTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
hfmMat.rimTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1417,7 +1431,7 @@ void GLTFSerializer::setHFMMaterial(HFMMaterial& hfmMat, const cgltf_material& m
|
||||||
}
|
}
|
||||||
if (mToonExtension["uvAnimationMaskTexture"].isObject()) {
|
if (mToonExtension["uvAnimationMaskTexture"].isObject()) {
|
||||||
QJsonObject object = mToonExtension["uvAnimationMaskTexture"].toObject();
|
QJsonObject object = mToonExtension["uvAnimationMaskTexture"].toObject();
|
||||||
if (object["index"].isDouble() && object["index"].toInt() < _data->textures_count) {
|
if (object["index"].isDouble() && object["index"].toInt() < (int)_data->textures_count) {
|
||||||
hfmMat.uvAnimationTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
hfmMat.uvAnimationTexture = getHFMTexture(&_data->textures[object["index"].toInt()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,24 +14,12 @@
|
||||||
#ifndef hifi_GLTFSerializer_h
|
#ifndef hifi_GLTFSerializer_h
|
||||||
#define hifi_GLTFSerializer_h
|
#define hifi_GLTFSerializer_h
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
#include <hfm/ModelFormatLogging.h>
|
#include <hfm/ModelFormatLogging.h>
|
||||||
#include <hfm/HFMSerializer.h>
|
#include <hfm/HFMSerializer.h>
|
||||||
|
|
||||||
static float atof_locale_independent(char *str) {
|
float atof_locale_independent(char* str);
|
||||||
//TODO: Once we have C++17 we can use std::from_chars
|
|
||||||
std::istringstream streamToParse(str);
|
|
||||||
streamToParse.imbue(std::locale("C"));
|
|
||||||
float value;
|
|
||||||
if(!(streamToParse >> value)) {
|
|
||||||
qDebug(modelformat) << "cgltf: Cannot parse float from string: " << str;
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CGLTF_ATOF(str) atof_locale_independent(str)
|
#define CGLTF_ATOF(str) atof_locale_independent(str)
|
||||||
|
|
||||||
|
|
|
@ -1802,8 +1802,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
|
static void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
|
||||||
float len = glm::compMax(glm::abs(unpacked.positionOffset));
|
float len = max(abs(unpacked.positionOffsetX), max(abs(unpacked.positionOffsetY), abs(unpacked.positionOffsetZ)));
|
||||||
glm::vec3 normalizedPos(unpacked.positionOffset);
|
glm::vec3 normalizedPos(unpacked.positionOffsetX, unpacked.positionOffsetY, unpacked.positionOffsetZ);
|
||||||
if (len > 0.0f) {
|
if (len > 0.0f) {
|
||||||
normalizedPos /= len;
|
normalizedPos /= len;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1813,8 +1813,8 @@ static void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uve
|
||||||
packed = glm::uvec4(
|
packed = glm::uvec4(
|
||||||
glm::floatBitsToUint(len),
|
glm::floatBitsToUint(len),
|
||||||
glm_packSnorm3x10_1x2(glm::vec4(normalizedPos, 0.0f)),
|
glm_packSnorm3x10_1x2(glm::vec4(normalizedPos, 0.0f)),
|
||||||
glm_packSnorm3x10_1x2(glm::vec4(unpacked.normalOffset, 0.0f)),
|
glm_packSnorm3x10_1x2(glm::vec4(unpacked.normalOffsetX, unpacked.normalOffsetY, unpacked.normalOffsetZ, 0.0f)),
|
||||||
glm_packSnorm3x10_1x2(glm::vec4(unpacked.tangentOffset, 0.0f))
|
glm_packSnorm3x10_1x2(glm::vec4(unpacked.tangentOffsetX, unpacked.tangentOffsetY, unpacked.tangentOffsetZ, 0.0f))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1922,10 +1922,19 @@ void Blender::run() {
|
||||||
int index = blendshape.indices.at(j);
|
int index = blendshape.indices.at(j);
|
||||||
|
|
||||||
auto& currentBlendshapeOffset = unpackedBlendshapeOffsets[index];
|
auto& currentBlendshapeOffset = unpackedBlendshapeOffsets[index];
|
||||||
currentBlendshapeOffset.positionOffset += blendshape.vertices.at(j) * vertexCoefficient;
|
glm::vec3 blendshapePosition = blendshape.vertices.at(j) * vertexCoefficient;
|
||||||
currentBlendshapeOffset.normalOffset += blendshape.normals.at(j) * normalCoefficient;
|
currentBlendshapeOffset.positionOffsetX += blendshapePosition.x;
|
||||||
|
currentBlendshapeOffset.positionOffsetY += blendshapePosition.y;
|
||||||
|
currentBlendshapeOffset.positionOffsetZ += blendshapePosition.z;
|
||||||
|
glm::vec3 blendshapeNormal = blendshape.normals.at(j) * normalCoefficient;
|
||||||
|
currentBlendshapeOffset.normalOffsetX += blendshapeNormal.x;
|
||||||
|
currentBlendshapeOffset.normalOffsetY += blendshapeNormal.y;
|
||||||
|
currentBlendshapeOffset.normalOffsetZ += blendshapeNormal.z;
|
||||||
if (j < blendshape.tangents.size()) {
|
if (j < blendshape.tangents.size()) {
|
||||||
currentBlendshapeOffset.tangentOffset += blendshape.tangents.at(j) * normalCoefficient;
|
glm::vec3 blendshapeTangent = blendshape.tangents.at(j) * normalCoefficient;
|
||||||
|
currentBlendshapeOffset.tangentOffsetX += blendshapeTangent.x;
|
||||||
|
currentBlendshapeOffset.tangentOffsetY += blendshapeTangent.y;
|
||||||
|
currentBlendshapeOffset.tangentOffsetZ += blendshapeTangent.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,12 +139,12 @@ void IDsToBounds::run(const RenderContextPointer& renderContext, const ItemIDs&
|
||||||
for (auto id : inItems) {
|
for (auto id : inItems) {
|
||||||
auto& item = scene->getItem(id);
|
auto& item = scene->getItem(id);
|
||||||
if (item.exist()) {
|
if (item.exist()) {
|
||||||
outItems.emplace_back(ItemBound{ id, item.getBound(renderContext->args) });
|
outItems.emplace_back(ItemBound(id, item.getBound(renderContext->args)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (auto id : inItems) {
|
for (auto id : inItems) {
|
||||||
outItems.emplace_back(ItemBound{ id });
|
outItems.emplace_back(ItemBound(id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,9 +339,9 @@ class ItemBound {
|
||||||
ItemBound(ItemID id) : id(id) { }
|
ItemBound(ItemID id) : id(id) { }
|
||||||
ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { }
|
ItemBound(ItemID id, const AABox& bound) : id(id), bound(bound) { }
|
||||||
|
|
||||||
ItemID id;
|
ItemID id { 0 };
|
||||||
AABox bound;
|
AABox bound;
|
||||||
uint32_t padding;
|
uint32_t padding { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
// many Item Bounds in a vector
|
// many Item Bounds in a vector
|
||||||
|
|
|
@ -478,10 +478,10 @@ void ScriptManager::waitTillDoneRunning(bool shutdown) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
auto startedWaiting = usecTimestampNow();
|
//auto startedWaiting = usecTimestampNow();
|
||||||
while (!_isDoneRunning) {
|
while (!_isDoneRunning) {
|
||||||
// If the final evaluation takes too long, then tell the script engine to stop running
|
// If the final evaluation takes too long, then tell the script engine to stop running
|
||||||
auto elapsedUsecs = usecTimestampNow() - startedWaiting;
|
//auto elapsedUsecs = usecTimestampNow() - startedWaiting;
|
||||||
// TODO: This part was very unsafe and was causing crashes all the time.
|
// TODO: This part was very unsafe and was causing crashes all the time.
|
||||||
// I disabled it for now until we find a safer solution.
|
// I disabled it for now until we find a safer solution.
|
||||||
// With it disabled now we get clean shutdowns and restarts.
|
// With it disabled now we get clean shutdowns and restarts.
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool qBytearrayFromScriptValue(const ScriptValue& object, QByteArray &qByteArray
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
v8::Local<v8::ArrayBuffer> arrayBuffer = v8::Local<v8::ArrayBuffer>::Cast(v8Value);
|
v8::Local<v8::ArrayBuffer> arrayBuffer = v8::Local<v8::ArrayBuffer>::Cast(v8Value);
|
||||||
qByteArray.resize(arrayBuffer->ByteLength());
|
qByteArray.resize((int)arrayBuffer->ByteLength());
|
||||||
memcpy(qByteArray.data(), arrayBuffer->Data(), arrayBuffer->ByteLength());
|
memcpy(qByteArray.data(), arrayBuffer->Data(), arrayBuffer->ByteLength());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1309,7 +1309,8 @@ int ScriptSignalV8Proxy::qt_metacall(QMetaObject::Call call, int id, void** argu
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::TryCatch tryCatch(isolate);
|
v8::TryCatch tryCatch(isolate);
|
||||||
callback->Call(functionContext, v8This, numArgs, args);
|
auto maybeResult = callback->Call(functionContext, v8This, numArgs, args);
|
||||||
|
Q_UNUSED(maybeResult); // Signals don't have return values
|
||||||
if (tryCatch.HasCaught()) {
|
if (tryCatch.HasCaught()) {
|
||||||
QString errorMessage(QString("Signal proxy ") + fullName() + " connection call failed: \""
|
QString errorMessage(QString("Signal proxy ") + fullName() + " connection call failed: \""
|
||||||
+ _engine->formatErrorMessageFromTryCatch(tryCatch)
|
+ _engine->formatErrorMessageFromTryCatch(tryCatch)
|
||||||
|
|
|
@ -119,9 +119,9 @@ struct BlendshapeOffsetPacked {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BlendshapeOffsetUnpacked {
|
struct BlendshapeOffsetUnpacked {
|
||||||
glm::vec3 positionOffset;
|
float positionOffsetX, positionOffsetY, positionOffsetZ;
|
||||||
glm::vec3 normalOffset;
|
float normalOffsetX, normalOffsetY, normalOffsetZ;
|
||||||
glm::vec3 tangentOffset;
|
float tangentOffsetX, tangentOffsetY, tangentOffsetZ;
|
||||||
};
|
};
|
||||||
|
|
||||||
using BlendshapeOffset = BlendshapeOffsetPacked;
|
using BlendshapeOffset = BlendshapeOffsetPacked;
|
||||||
|
|
Loading…
Reference in a new issue