mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
fix for crash on unloaded model
This commit is contained in:
parent
3dd8fd838b
commit
189da81bb1
1 changed files with 10 additions and 8 deletions
|
@ -49,16 +49,18 @@ void CauterizedModel::createCollisionRenderItemSet() {
|
|||
}
|
||||
|
||||
bool CauterizedModel::updateGeometry() {
|
||||
bool returnValue = Model::updateGeometry();
|
||||
if (_rig->jointStatesEmpty() && getFBXGeometry().joints.size() > 0) {
|
||||
const FBXGeometry& fbxGeometry = getFBXGeometry();
|
||||
foreach (const FBXMesh& mesh, fbxGeometry.meshes) {
|
||||
Model::MeshState state;
|
||||
state.clusterMatrices.resize(mesh.clusters.size());
|
||||
_cauterizeMeshStates.append(state);
|
||||
bool needsFullUpdate = Model::updateGeometry();
|
||||
if (needsFullUpdate) {
|
||||
if (_rig->jointStatesEmpty() && getFBXGeometry().joints.size() > 0) {
|
||||
const FBXGeometry& fbxGeometry = getFBXGeometry();
|
||||
foreach (const FBXMesh& mesh, fbxGeometry.meshes) {
|
||||
Model::MeshState state;
|
||||
state.clusterMatrices.resize(mesh.clusters.size());
|
||||
_cauterizeMeshStates.append(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
return needsFullUpdate;
|
||||
}
|
||||
|
||||
void CauterizedModel::updateClusterMatrices() {
|
||||
|
|
Loading…
Reference in a new issue