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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user