diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-06 10:52:44 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-12-06 10:52:44 -0500 |
| commit | 837b2c91076b52d10438a7c6a564e613436ced48 (patch) | |
| tree | d40f165ac75c3661842b8f13fa60543f4204f8a5 /editor | |
| parent | 2da469cbdd5dc780b1d78ea0dee2e3baa5a7023f (diff) | |
use NullCamera for fallback
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/editor.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index 4a7cdde..a896cfd 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -30,14 +30,6 @@ const char *dbgCtrl_ClearSelection = "debug-clear-selection"; ThreadPoolHandle threadPoolHandle = ThreadPoolHandle_MAX; -PkeCamera cameraDefault { - .pos = glm::vec3(-40.f, -40.f, -40.f), - .rot = glm::quat(1.f, 0.f, 0.f, 0.f), - .target = glm::vec3(0.f), - .type = PKE_CAMERA_TYPE_PERSPECTIVE, - .orientation = PKE_CAMERA_ORIENTATION_TARGET, - .stale = PKE_CAMERA_STALE_ALL, -}; PkeCamera cameraDbg { .pos = glm::vec3(4.f, 4.f, 4.f), .rot = glm::quat(1.f, 0.f, 0.f, 0.f), @@ -240,8 +232,8 @@ void PkeEditor_Tick(double delta) { if (shouldLockCamera) { shouldLockCamera = false; glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - cameraDefault.stale = PKE_CAMERA_STALE_ALL; - ActiveCamera = &cameraDefault; + NullCamera.stale = PKE_CAMERA_STALE_ALL; + ActiveCamera = &NullCamera; } if (pkeSettings.editorSettings.isUsingDebugCamera) { @@ -749,7 +741,12 @@ void PkeEditor_Init() { debugControlsHandle = PkeInput_RegisterSet(debugControlsSet); - ActiveCamera = &cameraDefault; + NullCamera.pos = glm::vec3(-40.f, -40.f, -40.f), + NullCamera.rot = glm::quat(1.f, 0.f, 0.f, 0.f), + NullCamera.target = glm::vec3(0.f), + NullCamera.type = PKE_CAMERA_TYPE_PERSPECTIVE, + NullCamera.orientation = PKE_CAMERA_ORIENTATION_TARGET, + NullCamera.stale = PKE_CAMERA_STALE_ALL, threadPoolHandle = PkeThreads_Init(1, 1); } |
