mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 06:24:41 +02:00
Merge pull request #15082 from SamGondelman/modelCrash
Case 21528: Possible fix for model crash
This commit is contained in:
commit
fd5e2b4672
1 changed files with 12 additions and 7 deletions
|
@ -1346,14 +1346,19 @@ void Model::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Model::computeMeshPartLocalBounds() {
|
void Model::computeMeshPartLocalBounds() {
|
||||||
for (auto& part : _modelMeshRenderItems) {
|
render::Transaction transaction;
|
||||||
const Model::MeshState& state = _meshStates.at(part->_meshIndex);
|
auto meshStates = _meshStates;
|
||||||
|
for (auto renderItem : _modelMeshRenderItemIDs) {
|
||||||
|
transaction.updateItem<ModelMeshPartPayload>(renderItem, [this, meshStates](ModelMeshPartPayload& data) {
|
||||||
|
const Model::MeshState& state = meshStates.at(data._meshIndex);
|
||||||
if (_useDualQuaternionSkinning) {
|
if (_useDualQuaternionSkinning) {
|
||||||
part->computeAdjustedLocalBound(state.clusterDualQuaternions);
|
data.computeAdjustedLocalBound(state.clusterDualQuaternions);
|
||||||
} else {
|
} else {
|
||||||
part->computeAdjustedLocalBound(state.clusterMatrices);
|
data.computeAdjustedLocalBound(state.clusterMatrices);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
AbstractViewStateInterface::instance()->getMain3DScene()->enqueueTransaction(transaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
|
|
Loading…
Reference in a new issue