more camera work

This commit is contained in:
Nick Fisher
2024-09-26 16:51:14 +08:00
parent 239891c400
commit 4355d9c83f
14 changed files with 114 additions and 9 deletions

View File

@@ -52,11 +52,13 @@ namespace thermion_filament
const ResourceLoaderWrapperImpl *const resourceLoaderWrapper,
Engine *engine,
Scene *scene,
const char *uberArchivePath)
const char *uberArchivePath,
Camera *mainCamera)
: _view(view),
_resourceLoaderWrapper(resourceLoaderWrapper),
_engine(engine),
_scene(scene)
_scene(scene),
_mainCamera(mainCamera)
{
_stbDecoder = createStbProvider(_engine);
@@ -2662,6 +2664,20 @@ EntityId SceneManager::createGeometry(
void SceneManager::setCamera(Camera* camera) {
_view->setCamera(camera);
}
size_t SceneManager::getCameraCount() {
return _cameras.size() + 1;
}
Camera* SceneManager::getCameraAt(size_t index) {
if(index == 0) {
return _mainCamera;
}
if(index - 1 > _cameras.size() - 1) {
return nullptr;
}
return _cameras[index-1];
}
} // namespace thermion_filament