mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 08:57:12 +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() {
|
||||
for (auto& part : _modelMeshRenderItems) {
|
||||
const Model::MeshState& state = _meshStates.at(part->_meshIndex);
|
||||
if (_useDualQuaternionSkinning) {
|
||||
part->computeAdjustedLocalBound(state.clusterDualQuaternions);
|
||||
} else {
|
||||
part->computeAdjustedLocalBound(state.clusterMatrices);
|
||||
}
|
||||
render::Transaction transaction;
|
||||
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) {
|
||||
data.computeAdjustedLocalBound(state.clusterDualQuaternions);
|
||||
} else {
|
||||
data.computeAdjustedLocalBound(state.clusterMatrices);
|
||||
}
|
||||
});
|
||||
}
|
||||
AbstractViewStateInterface::instance()->getMain3DScene()->enqueueTransaction(transaction);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
Loading…
Reference in a new issue