Fix wi::scene::LoadModel returning the wrong entity (#921)

Fixed a bug caused by a typo in the LoadModel function call. The issue occurred because LoadModel(scene, fileName, transformMatrix, rootEntity) was mistakenly called instead of LoadModel2(scene, fileName, transformMatrix, rootEntity). The compiler did not catch this mistake because the last parameter of LoadModel is a boolean, and rootEntity was incorrectly used to satisfy that parameter.
This commit is contained in:
Romildo Franco
2024-08-12 01:38:51 -03:00
committed by GitHub
parent 4717d75cb4
commit 7449063784
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -7021,7 +7021,7 @@ namespace wi::scene
void LoadModel2(const std::string& fileName, const XMMATRIX& transformMatrix, Entity rootEntity)
{
Scene scene;
LoadModel(scene, fileName, transformMatrix, rootEntity);
LoadModel2(scene, fileName, transformMatrix, rootEntity);
GetScene().Merge(scene);
}
+1
View File
@@ -319,6 +319,7 @@ namespace wi::scene
virtual void Clear();
// Merge an other scene into this.
// The contents of the other scene will be lost (and moved to this)!
// Any references to entities or components from the other scene will now reference them in this scene.
virtual void Merge(Scene& other);
// Similar to merge but skipping some things that are safe to skip within the Update look
void MergeFastInternal(Scene& other);