Rendering instances of different models
First, we need a small extension of the GltfInstance
class, a getter for the saved glTF model. The declaration in the GltfInstance.h
file and the implementation in the GltfInstance.cpp
file in the model folder are trivial, so we can skip a listing.
More interesting are the changes to the OGLRenderer
class. Change the declaration of the private
member variable storing the glTF model in the OGLRenderer.h
file in the opengl
folder to std::vector
:
std::vector<std::shared_ptr<GltfModel>> mGltfModels{};
Also, add two new vectors to store the pointers to the instances using joint matrices or dual quaternions:
std::vector<std::shared_ptr<GltfInstance>>
mGltfMatrixInstances{};
std::vector<std::shared_ptr<GltfInstance>>
mGltfDQInstances{};
Due to the possible mixing...