summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-01-09 13:27:16 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-01-09 13:27:16 -0500
commitb04fefe8ee0086bc1404c06b8351ecb4e942f151 (patch)
treeadbb6fecfc17f781c16e9150a80124936040d8e3 /editor
parent5845642965a1eebaec3a1d1126445ecb459688b8 (diff)
deprecate cmake + fixes
Diffstat (limited to 'editor')
-rw-r--r--editor/CMakeLists.txt17
-rw-r--r--editor/editor.cpp23
2 files changed, 13 insertions, 27 deletions
diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt
deleted file mode 100644
index b1f3d64..0000000
--- a/editor/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-project(pke_editor VERSION 0.0)
-
-set(PKE_EDITOR_SOURCE_FILES
- main.cpp
- editor.hpp
- editor.cpp
-)
-add_executable(pke_editor
- ${PKE_EDITOR_SOURCE_FILES}
-)
-target_link_libraries(pke_editor PRIVATE pke)
-target_include_directories(pke_editor PRIVATE pke)
-
-install(
- TARGETS pke_editor
- RUNTIME DESTINATION bin
-)
diff --git a/editor/editor.cpp b/editor/editor.cpp
index db82fc0..86fae96 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -198,17 +198,20 @@ void PkeEditor_Tick(double delta) {
glm::vec3 fromCoords{unproject(glm::vec3(xMousePos, yMousePos, -1.f))};
glm::vec3 toCoords{unproject(glm::vec3(xMousePos, yMousePos, 1.f))};
- btVector3 rayOrigin{};
- btVector3 rayDestination{};
- GlmToBullet(fromCoords, rayOrigin);
- GlmToBullet(toCoords, rayDestination);
-
- btCollisionWorld::ClosestRayResultCallback rayResult{rayOrigin, rayDestination};
- rayResult.m_flags |= btTriangleRaycastCallback::kF_FilterBackfaces;
+ if (fromCoords.x == fromCoords.x && toCoords.x == toCoords.x) {
+ btVector3 rayOrigin{};
+ btVector3 rayDestination{};
+ GlmToBullet(fromCoords, rayOrigin);
+ GlmToBullet(toCoords, rayDestination);
+
+ btCollisionWorld::ClosestRayResultCallback rayResult{rayOrigin, rayDestination};
+ rayResult.m_flags |= btTriangleRaycastCallback::kF_FilterBackfaces;
+
+ BtDynamicsWorld->rayTest(rayOrigin, rayDestination, rayResult);
+ if (rayResult.hasHit()) {
+ hoveredEntity = reinterpret_cast<CompInstance *>(rayResult.m_collisionObject->getUserPointer());
+ }
- BtDynamicsWorld->rayTest(rayOrigin, rayDestination, rayResult);
- if (rayResult.hasHit()) {
- hoveredEntity = reinterpret_cast<CompInstance *>(rayResult.m_collisionObject->getUserPointer());
}
}