Fix loading of entities in scene graph example

This commit is contained in:
Harald Reingruber
2022-04-26 18:04:19 +02:00
parent 166aeced4b
commit d65be1e880

View File

@@ -98,7 +98,7 @@ int main()
// load entities // load entities
// ----------- // -----------
Model model = Model(FileSystem::getPath("resources/objects/planet/planet.obj")); Model model = Model(FileSystem::getPath("resources/objects/planet/planet.obj"));
Entity ourEntity(model); Entity ourEntity(model);
ourEntity.transform.setLocalPosition({ 10, 0, 0 }); ourEntity.transform.setLocalPosition({ 10, 0, 0 });
const float scale = 0.75; const float scale = 0.75;
@@ -109,7 +109,6 @@ int main()
for (unsigned int i = 0; i < 10; ++i) for (unsigned int i = 0; i < 10; ++i)
{ {
Model model = Model(FileSystem::getPath("resources/objects/planet/planet.obj"));
lastEntity->addChild(model); lastEntity->addChild(model);
lastEntity = lastEntity->children.back().get(); lastEntity = lastEntity->children.back().get();