Skip to content

Commit

Permalink
fix #5012
Browse files Browse the repository at this point in the history
  • Loading branch information
rtri committed Dec 16, 2015
1 parent 262dff8 commit a2f3526
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rts/Rendering/Models/3DModel.cpp
Expand Up @@ -159,6 +159,11 @@ void LocalModel::SetModel(const S3DModel* model)
pieces.reserve(model->numPieces);

CreateLocalModelPieces(model->GetRootPiece());

// must recursively update matrices here too: for features
// LocalModel::Update is never called, but they might have
// baked piece rotations (if .dae)
pieces[0].UpdateMatricesRec(false);
UpdateBoundingVolume(0);

assert(pieces.size() == model->numPieces);
Expand All @@ -168,8 +173,9 @@ LocalModelPiece* LocalModel::CreateLocalModelPieces(const S3DModelPiece* mpParen
{
LocalModelPiece* lmpChild = NULL;

// construct an LMP(mp) in-place
pieces.emplace_back(mpParent);
LocalModelPiece *lmpParent = &pieces.back();
LocalModelPiece* lmpParent = &pieces.back();

lmpParent->SetLModelPieceIndex(pieces.size() - 1);
lmpParent->SetScriptPieceIndex(pieces.size() - 1);
Expand Down

0 comments on commit a2f3526

Please sign in to comment.