mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 02:24:51 +02:00
naming, condition
This commit is contained in:
parent
d1d999dd72
commit
40fe156c8b
2 changed files with 8 additions and 8 deletions
|
@ -751,7 +751,7 @@ void GLTFSerializer::getSkinInverseBindMatrices(std::vector<std::vector<float>>&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLTFSerializer::getNodeQueueByDepthFirstChildren(std::vector<int>& children, int stride, bool order, std::vector<int>& result) {
|
void GLTFSerializer::getNodeQueueByDepthFirstChildren(std::vector<int>& children, int stride, bool needToSort, std::vector<int>& result) {
|
||||||
int startingIndex = 0;
|
int startingIndex = 0;
|
||||||
int finalIndex = (int)children.size();
|
int finalIndex = (int)children.size();
|
||||||
if (stride == -1) {
|
if (stride == -1) {
|
||||||
|
@ -763,12 +763,12 @@ void GLTFSerializer::getNodeQueueByDepthFirstChildren(std::vector<int>& children
|
||||||
result.push_back(c);
|
result.push_back(c);
|
||||||
std::vector<int> nested = _file.nodes[c].children.toStdVector();
|
std::vector<int> nested = _file.nodes[c].children.toStdVector();
|
||||||
if (nested.size() != 0) {
|
if (nested.size() != 0) {
|
||||||
if (order) {
|
if (needToSort) {
|
||||||
std::sort(nested.begin(), nested.end());
|
std::sort(nested.begin(), nested.end());
|
||||||
}
|
}
|
||||||
for (int r : nested) {
|
for (int r : nested) {
|
||||||
if (result.end() == std::find(result.begin(), result.end(), r)) {
|
if (result.end() == std::find(result.begin(), result.end(), r)) {
|
||||||
getNodeQueueByDepthFirstChildren(nested, stride, order, result);
|
getNodeQueueByDepthFirstChildren(nested, stride, needToSort, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -813,7 +813,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::URL& url) {
|
||||||
|
|
||||||
|
|
||||||
// initialize order in which nodes will be parsed
|
// initialize order in which nodes will be parsed
|
||||||
bool sortNodes = (!parentOutOfOrder && skinnedModel) || !skinnedModel;
|
bool needToSort = !parentOutOfOrder || !skinnedModel;
|
||||||
std::vector<int> nodeQueue;
|
std::vector<int> nodeQueue;
|
||||||
nodeQueue.reserve(numNodes);
|
nodeQueue.reserve(numNodes);
|
||||||
int rootNode = 0;
|
int rootNode = 0;
|
||||||
|
@ -830,7 +830,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::URL& url) {
|
||||||
if (!rootAtStartOfList) { nodeListStride = -1; }
|
if (!rootAtStartOfList) { nodeListStride = -1; }
|
||||||
|
|
||||||
QVector<int> initialSceneNodes = _file.scenes[_file.scene].nodes;
|
QVector<int> initialSceneNodes = _file.scenes[_file.scene].nodes;
|
||||||
if (sortNodes) {
|
if (needToSort) {
|
||||||
std::sort(initialSceneNodes.begin(), initialSceneNodes.end());
|
std::sort(initialSceneNodes.begin(), initialSceneNodes.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,10 +844,10 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::URL& url) {
|
||||||
int i = initialSceneNodes[index];
|
int i = initialSceneNodes[index];
|
||||||
nodeQueue.push_back(i);
|
nodeQueue.push_back(i);
|
||||||
std::vector<int> children = _file.nodes[i].children.toStdVector();
|
std::vector<int> children = _file.nodes[i].children.toStdVector();
|
||||||
if (sortNodes) {
|
if (needToSort) {
|
||||||
std::sort(children.begin(), children.end());
|
std::sort(children.begin(), children.end());
|
||||||
}
|
}
|
||||||
getNodeQueueByDepthFirstChildren(children, nodeListStride, sortNodes, nodeQueue);
|
getNodeQueueByDepthFirstChildren(children, nodeListStride, needToSort, nodeQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -713,7 +713,7 @@ private:
|
||||||
|
|
||||||
glm::mat4 getModelTransform(const GLTFNode& node);
|
glm::mat4 getModelTransform(const GLTFNode& node);
|
||||||
void getSkinInverseBindMatrices(std::vector<std::vector<float>>& inverseBindMatrixValues);
|
void getSkinInverseBindMatrices(std::vector<std::vector<float>>& inverseBindMatrixValues);
|
||||||
void getNodeQueueByDepthFirstChildren(std::vector<int>& children, int stride, bool order, std::vector<int>& result);
|
void getNodeQueueByDepthFirstChildren(std::vector<int>& children, int stride, bool needToSort, std::vector<int>& result);
|
||||||
|
|
||||||
bool buildGeometry(HFMModel& hfmModel, const hifi::URL& url);
|
bool buildGeometry(HFMModel& hfmModel, const hifi::URL& url);
|
||||||
bool parseGLTF(const hifi::ByteArray& data);
|
bool parseGLTF(const hifi::ByteArray& data);
|
||||||
|
|
Loading…
Reference in a new issue