mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
Warnings
This commit is contained in:
parent
409023158c
commit
c4a1fe9a00
3 changed files with 13 additions and 9 deletions
|
@ -1094,20 +1094,25 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
setHFMMaterial(hfmMaterial, material);
|
setHFMMaterial(hfmMaterial, material);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (int nodeIndex = 0; nodeIndex < numNodes; ++nodeIndex) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int meshCount = _file.meshes.size();
|
int meshCount = _file.meshes.size();
|
||||||
hfmModel.meshes.resize(meshCount);
|
hfmModel.meshes.resize(meshCount);
|
||||||
hfmModel.meshExtents.reset();
|
hfmModel.meshExtents.reset();
|
||||||
|
|
||||||
|
|
||||||
hfmModel.meshes.resize(meshCount);
|
hfmModel.meshes.resize(meshCount);
|
||||||
for (int meshIndex = 0; meshIndex < meshCount; ++meshIndex) {
|
for (int meshIndex = 0; meshIndex < meshCount; ++meshIndex) {
|
||||||
const auto& gltfMesh = _file.meshes[meshIndex];
|
const auto& gltfMesh = _file.meshes[meshIndex];
|
||||||
auto& mesh = hfmModel.meshes[meshIndex];
|
auto& mesh = hfmModel.meshes[meshIndex];
|
||||||
mesh.meshIndex = meshIndex;
|
mesh.meshIndex = meshIndex;
|
||||||
#if 0
|
|
||||||
if (!hfmModel.hasSkeletonJoints) {
|
if (!hfmModel.hasSkeletonJoints) {
|
||||||
HFMCluster cluster;
|
HFMCluster cluster;
|
||||||
|
#if 0
|
||||||
cluster.jointIndex = nodeIndex;
|
cluster.jointIndex = nodeIndex;
|
||||||
|
#endif
|
||||||
cluster.inverseBindMatrix = glm::mat4();
|
cluster.inverseBindMatrix = glm::mat4();
|
||||||
cluster.inverseBindTransform = Transform(cluster.inverseBindMatrix);
|
cluster.inverseBindTransform = Transform(cluster.inverseBindMatrix);
|
||||||
mesh.clusters.append(cluster);
|
mesh.clusters.append(cluster);
|
||||||
|
@ -1125,7 +1130,6 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
root.inverseBindMatrix = jointInverseBindTransforms[root.jointIndex];
|
root.inverseBindMatrix = jointInverseBindTransforms[root.jointIndex];
|
||||||
root.inverseBindTransform = Transform(root.inverseBindMatrix);
|
root.inverseBindTransform = Transform(root.inverseBindMatrix);
|
||||||
mesh.clusters.append(root);
|
mesh.clusters.append(root);
|
||||||
#endif
|
|
||||||
|
|
||||||
QSet<QString> meshAttributes;
|
QSet<QString> meshAttributes;
|
||||||
for(const auto &primitive : gltfMesh.primitives) {
|
for(const auto &primitive : gltfMesh.primitives) {
|
||||||
|
@ -1466,7 +1470,6 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
// Build weights (adapted from FBXSerializer.cpp)
|
// Build weights (adapted from FBXSerializer.cpp)
|
||||||
if (hfmModel.hasSkeletonJoints) {
|
if (hfmModel.hasSkeletonJoints) {
|
||||||
int prevMeshClusterIndexCount = mesh.clusterIndices.count();
|
int prevMeshClusterIndexCount = mesh.clusterIndices.count();
|
||||||
|
@ -1481,10 +1484,12 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
mesh.clusterWeights.push_back(0);
|
mesh.clusterWeights.push_back(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
for (int c = 0; c < clusterJoints.size(); ++c) {
|
for (int c = 0; c < clusterJoints.size(); ++c) {
|
||||||
mesh.clusterIndices[prevMeshClusterIndexCount + c] =
|
mesh.clusterIndices[prevMeshClusterIndexCount + c] =
|
||||||
originalToNewNodeIndexMap[_file.skins[node.skin].joints[clusterJoints[c]]];
|
originalToNewNodeIndexMap[_file.skins[node.skin].joints[clusterJoints[c]]];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// normalize and compress to 16-bits
|
// normalize and compress to 16-bits
|
||||||
for (int i = 0; i < numVertices; ++i) {
|
for (int i = 0; i < numVertices; ++i) {
|
||||||
|
@ -1518,7 +1523,6 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (primitive.defined["material"]) {
|
if (primitive.defined["material"]) {
|
||||||
|
@ -1622,9 +1626,9 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
mesh.meshExtents.maximum += glm::vec3(EPSILON, EPSILON, EPSILON);
|
mesh.meshExtents.maximum += glm::vec3(EPSILON, EPSILON, EPSILON);
|
||||||
hfmModel.meshExtents.minimum -= glm::vec3(EPSILON, EPSILON, EPSILON);
|
hfmModel.meshExtents.minimum -= glm::vec3(EPSILON, EPSILON, EPSILON);
|
||||||
hfmModel.meshExtents.maximum += glm::vec3(EPSILON, EPSILON, EPSILON);
|
hfmModel.meshExtents.maximum += glm::vec3(EPSILON, EPSILON, EPSILON);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int nodeIndex = 0; nodeIndex < numNodes; ++nodeIndex) {
|
for (int nodeIndex = 0; nodeIndex < numNodes; ++nodeIndex) {
|
||||||
const auto& node = _file.nodes[nodeIndex];
|
const auto& node = _file.nodes[nodeIndex];
|
||||||
if (-1 == node.mesh) {
|
if (-1 == node.mesh) {
|
||||||
|
|
|
@ -175,7 +175,7 @@ void HFMModel::computeKdops() {
|
||||||
|
|
||||||
// NOTE: points are in joint-frame
|
// NOTE: points are in joint-frame
|
||||||
ShapeVertices& points = shapeVertices.at(i);
|
ShapeVertices& points = shapeVertices.at(i);
|
||||||
glm::quat rotOffset = jointRotationOffsets.contains(i) ? glm::inverse(jointRotationOffsets[i]) : quat();
|
glm::quat rotOffset = jointRotationOffsets.contains((int)i) ? glm::inverse(jointRotationOffsets[i]) : quat();
|
||||||
if (points.size() > 0) {
|
if (points.size() > 0) {
|
||||||
// compute average point
|
// compute average point
|
||||||
glm::vec3 avgPoint = glm::vec3(0.0f);
|
glm::vec3 avgPoint = glm::vec3(0.0f);
|
||||||
|
|
|
@ -124,7 +124,7 @@ class Cluster {
|
||||||
public:
|
public:
|
||||||
static const uint32_t INVALID_JOINT_INDEX{ (uint32_t)-1 };
|
static const uint32_t INVALID_JOINT_INDEX{ (uint32_t)-1 };
|
||||||
uint32_t jointIndex{ INVALID_JOINT_INDEX };
|
uint32_t jointIndex{ INVALID_JOINT_INDEX };
|
||||||
glm::mat4 inverseBindMatrix;
|
glm::mat4 inverseBindMatrix{ glm::mat4{ 1.0 } };
|
||||||
Transform inverseBindTransform;
|
Transform inverseBindTransform;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue