ZOulhadj / vmve

Vulkan Model Viewer and Importer. A project developed as part of my final year project at University.
https://zoulhadj.github.io/vmve_website/
MIT License
1 stars 0 forks source link

Adding new model removes existing instance #63

Closed ZOulhadj closed 1 year ago

ZOulhadj commented 1 year ago

When a model is already loaded and there is at least one instance, adding a new model will remove the instances model.

ZOulhadj commented 1 year ago

What seems to be the issue is that each instance has a pointer to a model. When a new model is added then the underlying vector that holds all the models may reallocate and therefore, the memory address will change. This results in potentially undefined behaviour.

ZOulhadj commented 1 year ago

This has been solved for now as I am simply using index positions in the vector rather than pointers which may change. The implementation will change as the project requirements are better understood.