ADD: planet prototype
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <unordered_set>
|
||||
#include <chrono>
|
||||
|
||||
#include "scene/planet/planet_system.h"
|
||||
#include "core/device/swapchain.h"
|
||||
#include "core/context.h"
|
||||
#include "core/config.h"
|
||||
@@ -19,6 +20,8 @@
|
||||
#include "core/config.h"
|
||||
#include <fmt/core.h>
|
||||
|
||||
SceneManager::SceneManager() = default;
|
||||
|
||||
SceneManager::~SceneManager()
|
||||
{
|
||||
fmt::println("[SceneManager] dtor: loadedScenes={} dynamicGLTFInstances={} pendingGLTFRelease={}",
|
||||
@@ -121,6 +124,9 @@ void SceneManager::init(EngineContext *context)
|
||||
cameraRig.init(*this, mainCamera);
|
||||
|
||||
_camera_position_local = world_to_local(mainCamera.position_world, _origin_world);
|
||||
|
||||
_planetSystem = std::make_unique<PlanetSystem>();
|
||||
_planetSystem->init(_context);
|
||||
}
|
||||
|
||||
void SceneManager::update_scene()
|
||||
@@ -306,6 +312,11 @@ void SceneManager::update_scene()
|
||||
}
|
||||
}
|
||||
|
||||
if (_planetSystem)
|
||||
{
|
||||
_planetSystem->update_and_emit(*this, mainDrawContext);
|
||||
}
|
||||
|
||||
glm::mat4 view = mainCamera.getViewMatrix(_camera_position_local);
|
||||
// Use reversed infinite-Z projection (right-handed, -Z forward) to avoid far-plane clipping
|
||||
// on very large scenes. Vulkan clip space is 0..1 (GLM_FORCE_DEPTH_ZERO_TO_ONE) and requires Y flip.
|
||||
|
||||
Reference in New Issue
Block a user