Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
aee7913
Allow context to recreate doodad pipeline when we should be switching…
Kejoko Sep 22, 2025
f95b82a
Increment quartz version
Kejoko Sep 22, 2025
c3b75fb
Inspect some of the behavior of the UBO info's stride calculation - i…
Kejoko Sep 24, 2025
5341840
Unit test for validating UBO info stride calc (using vulkan spec powe…
Kejoko Sep 24, 2025
4f2f6dd
Test UBO construction, vulkan printing utility
Kejoko Oct 2, 2025
8de39ea
Test the locally mapped buffer (kinda)
Kejoko Oct 2, 2025
d5e40a0
Create rendering pipeline for colliders using simple shaders
Kejoko Oct 7, 2025
5a13b87
First pass at getting box colliders displayed on screen
Kejoko Oct 7, 2025
71b101f
Create primitive constructor accepting vertices and indices
Kejoko Oct 19, 2025
2b9fb65
Put box collider primitive in the swapchain class as a member variable
Kejoko Oct 19, 2025
3c97179
Colliders use unique colors based on collider id, passed via push con…
Kejoko Oct 20, 2025
ee784b3
Update oscillation rate for collider color choice, clamp value to [0,…
Kejoko Oct 20, 2025
81a346d
Enter doodad wire frame mode upon collider display mode
Kejoko Oct 20, 2025
1c8c0b7
rename wireframe collider mode to display collider mode
Kejoko Oct 20, 2025
472841c
Move cube vertices and indices to primitive
Kejoko Oct 23, 2025
1abefbe
Add piping for sphere colliders to be displayed, though currently wit…
Kejoko Oct 23, 2025
c119663
Create tool to extract vertices as a c++ style array from a gltf bina…
Kejoko Oct 23, 2025
d95e4b4
Populate sphere vertices and indices with newly created tools
Kejoko Oct 23, 2025
bc3aedd
Move the compile time vertices and indices to the basics class
Kejoko Oct 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ add_subdirectory("${QUARTZ_SOURCE_DIR}/scene/light")
add_subdirectory("${QUARTZ_SOURCE_DIR}/scene/scene")
add_subdirectory("${QUARTZ_SOURCE_DIR}/scene/sky_box")

#====================================================================
# Tooling
#====================================================================

include(CreateToolExecutable)
add_subdirectory("${QUARTZ_ROOT_SOURCE_DIR}/tools")

#====================================================================
# The tests
#====================================================================
Expand Down
2 changes: 1 addition & 1 deletion cmake/CreateScratchExecutable.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#====================================================================
# Functionality for easily creating scratch unit tests
# Functionality for easily creating scratch tests
#====================================================================

function(create_scratch_executable main_file)
Expand Down
19 changes: 19 additions & 0 deletions cmake/CreateToolExecutable.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#====================================================================
# Functionality for easily creating tooling executables tests
#====================================================================

function(create_tool_executable main_file)
get_filename_component(executable_name ${main_file} NAME_WE)
add_executable(${executable_name} ${main_file})

target_compile_definitions(${executable_name} PRIVATE ${QUARTZ_COMPILE_DEFINITIONS})
target_compile_options(${executable_name} PRIVATE ${QUARTZ_CMAKE_CXX_FLAGS})
target_include_directories(${executable_name} PRIVATE ${QUARTZ_INCLUDE_DIRS})

set(link_libraries ${ARGN})

target_link_libraries(${executable_name} PRIVATE ${link_libraries} UTIL_Logger)

set_target_properties(${executable_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tools)
endfunction()

18 changes: 7 additions & 11 deletions cmake/QuartzVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
# ====================================================================

function(set_quartz_major_minor_patch_versions major minor patch)
set(QUARTZ_MAJOR_VERSION
${major}
PARENT_SCOPE)
set(QUARTZ_MINOR_VERSION
${minor}
PARENT_SCOPE)
set(QUARTZ_PATCH_VERSION
${patch}
PARENT_SCOPE)
set(QUARTZ_MAJOR_VERSION ${major} PARENT_SCOPE)
set(QUARTZ_MINOR_VERSION ${minor} PARENT_SCOPE)
set(QUARTZ_PATCH_VERSION ${patch} PARENT_SCOPE)
endfunction()

# -----=====***** the versions *****=====----- #
Expand Down Expand Up @@ -47,9 +41,11 @@ endfunction()
# set_quartz_major_minor_patch_versions(0 2 11) # scene libarary fixes
# set_quartz_major_minor_patch_versions(0 2 12) # fixes for linux
# set_quartz_major_minor_patch_versions(0 2 13) # RichException implementation and usage
# set_quartz_major_minor_patch_versions(0 2 14) # Custom source_location and mocked stacktrace for Mac so we can still use rich exceptions
# set_quartz_major_minor_patch_versions(0 2 14) # custom source_location and mocked stacktrace for Mac so we can still use rich exceptions

# Minor Version 3 - Scene Debugging Capabilities

set_quartz_major_minor_patch_versions(0 3 0) # Enable Quartz to enter a debugging mode
# set_quartz_major_minor_patch_versions(0 3 0) # enable Quartz to enter a debugging mode
# set_quartz_major_minor_patch_versions(0 3 1) # allow for wireframe display of doodads when in scene debugging mode
set_quartz_major_minor_patch_versions(0 3 2) # allow for display of box colliders when in scene debugging mode

10 changes: 5 additions & 5 deletions src/quartz/application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ quartz::Application::Application(
m_isPaused(false),
m_sceneDebugMode(false),
m_wireframeDoodadMode(false),
m_wireframeColliderMode(false)
m_displayColliderMode(false)
{
LOG_FUNCTION_CALL_TRACEthis("");
}
Expand Down Expand Up @@ -103,7 +103,7 @@ void quartz::Application::run() {
double frameInterpolationFactor = (frameTimeAccumulator + targetTickTimeDelta) / targetTickTimeDelta;

currentScene.update(m_renderingContext.getRenderingWindow(), m_inputManager, totalElapsedTime, currentFrameTimeDelta, frameInterpolationFactor);
m_renderingContext.draw(currentScene, m_wireframeDoodadMode, m_wireframeColliderMode);
m_renderingContext.draw(currentScene, m_wireframeDoodadMode, m_displayColliderMode);
}

LOG_INFOthis("Unloading scene");
Expand Down Expand Up @@ -158,7 +158,7 @@ quartz::Application::determineSceneDebugMode(

if (!m_sceneDebugMode) {
m_wireframeDoodadMode = false;
m_wireframeColliderMode = false;
m_displayColliderMode = false;
return;
}

Expand All @@ -168,7 +168,7 @@ quartz::Application::determineSceneDebugMode(
}

if (shouldToggleWireframeColliderMode) {
m_wireframeColliderMode = !m_wireframeColliderMode;
LOG_INFOthis("{} collider wireframe mode", (m_wireframeColliderMode ? "Entering" : "Exiting"));
m_displayColliderMode = !m_displayColliderMode;
LOG_INFOthis("{} collider wireframe mode", (m_displayColliderMode ? "Entering" : "Exiting"));
}
}
4 changes: 2 additions & 2 deletions src/quartz/application/Application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class quartz::Application {

bool getSceneDebugMode() const { return m_sceneDebugMode; }
bool getWireframeDoodadMode() const { return m_wireframeDoodadMode; }
bool getWireframeColliderMode() const { return m_wireframeColliderMode; }
bool getWireframeColliderMode() const { return m_displayColliderMode; }

void run();

Expand Down Expand Up @@ -75,7 +75,7 @@ class quartz::Application {

bool m_sceneDebugMode;
bool m_wireframeDoodadMode;
bool m_wireframeColliderMode;
bool m_displayColliderMode;

private: // friends
friend class quartz::unit_test::ApplicationUnitTestClient;
Expand Down
7 changes: 5 additions & 2 deletions src/quartz/physics/collider/Collider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "quartz/physics/collider/SphereShape.hpp"
#include "quartz/physics/collider/Collider.hpp"

uint32_t quartz::physics::Collider::colliderCount = 0;
std::map<reactphysics3d::Collider*, quartz::physics::Collider*> quartz::physics::Collider::colliderMap;

quartz::physics::Collider::CollisionType
Expand Down Expand Up @@ -71,6 +72,7 @@ quartz::physics::Collider::Collider(
const quartz::physics::Collider::CollisionCallback& collisionStayCallback,
const quartz::physics::Collider::CollisionCallback& collisionEndCallback
) :
m_id(quartz::physics::Collider::colliderCount++),
mo_boxShape(
(std::holds_alternative<quartz::physics::BoxShape>(v_shape)) ?
std::optional<quartz::physics::BoxShape>{std::get<quartz::physics::BoxShape>(std::move(v_shape))} :
Expand All @@ -87,13 +89,14 @@ quartz::physics::Collider::Collider(
m_collisionEndCallback(collisionEndCallback ? collisionEndCallback : quartz::physics::Collider::noopCollisionCallback)
{
LOG_FUNCTION_SCOPE_TRACEthis("");
LOG_TRACEthis("Constructing Collider. Setting collider map rp3d pointer at {} to point to quartz pointer at {}", reinterpret_cast<void*>(mp_collider), reinterpret_cast<void*>(this));
LOG_TRACEthis("Constructing Collider {}. Setting collider map rp3d pointer at {} to point to quartz pointer at {}", m_id, reinterpret_cast<void*>(mp_collider), reinterpret_cast<void*>(this));
quartz::physics::Collider::colliderMap[mp_collider] = this;
}

quartz::physics::Collider::Collider(
quartz::physics::Collider&& other
) :
m_id(other.m_id),
mo_boxShape(std::move(other.mo_boxShape)),
mo_sphereShape(std::move(other.mo_sphereShape)),
mp_collider(std::move(other.mp_collider)),
Expand All @@ -102,7 +105,7 @@ quartz::physics::Collider::Collider(
m_collisionEndCallback(std::move(other.m_collisionEndCallback))
{
LOG_FUNCTION_SCOPE_TRACEthis("");
LOG_TRACEthis("Move-constructing Collider. Setting collider map rp3d pointer at {} to point to quartz pointer at {}", reinterpret_cast<void*>(mp_collider), reinterpret_cast<void*>(this));
LOG_TRACEthis("Move-constructing Collider {}. Setting collider map rp3d pointer at {} to point to quartz pointer at {}", m_id, reinterpret_cast<void*>(mp_collider), reinterpret_cast<void*>(this));
quartz::physics::Collider::colliderMap[mp_collider] = this;
}

Expand Down
4 changes: 4 additions & 0 deletions src/quartz/physics/collider/Collider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class quartz::physics::Collider {

quartz::physics::Collider::CategoryProperties getCategoryProperties() const;

uint32_t getId() const { return m_id; }
bool getIsTrigger() const;
math::Vec3 getLocalPosition() const;
math::Quaternion getLocalRotation() const;
Expand Down Expand Up @@ -145,9 +146,12 @@ class quartz::physics::Collider {
static void eraseCollider(reactphysics3d::Collider* const p_collider) { quartz::physics::Collider::colliderMap.erase(p_collider); }

private: // static variables
static uint32_t colliderCount;
static std::map<reactphysics3d::Collider*, quartz::physics::Collider*> colliderMap;

private: // member variables
const uint32_t m_id;

std::optional<quartz::physics::BoxShape> mo_boxShape;
std::optional<quartz::physics::SphereShape> mo_sphereShape;

Expand Down
4 changes: 3 additions & 1 deletion src/quartz/rendering/buffer/LocallyMappedBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class quartz::rendering::LocallyMappedBuffer {
USE_LOGGER(BUFFER_MAPPED);

const vk::UniqueBuffer& getVulkanLogicalBufferPtr() const { return mp_vulkanLogicalBuffer; }
const vk::UniqueDeviceMemory& getVulkanPhysicalDeviceMemoryPtr() const { return mp_vulkanPhysicalDeviceMemory; }
void* getMappedLocalMemoryPtr() { return mp_mappedLocalMemory; }

private: // static functions
Expand All @@ -45,4 +46,5 @@ class quartz::rendering::LocallyMappedBuffer {
vk::UniqueBuffer mp_vulkanLogicalBuffer;
vk::UniqueDeviceMemory mp_vulkanPhysicalDeviceMemory;
void* mp_mappedLocalMemory;
};
};

9 changes: 6 additions & 3 deletions src/quartz/rendering/context/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ target_compile_options(

target_compile_definitions(
QUARTZ_RENDERING_Context
PUBLIC ${QUARTZ_COMPILE_DEFINITIONS}
PUBLIC
${QUARTZ_COMPILE_DEFINITIONS}
)

target_compile_definitions(
QUARTZ_RENDERING_Context
PUBLIC ${QUARTZ_COMPILE_DEFINITIONS}
QUARTZ_RENDERING_Context
PUBLIC
${QUARTZ_COMPILE_DEFINITIONS}
)

target_link_libraries(
Expand Down Expand Up @@ -57,3 +59,4 @@ target_link_libraries(
QUARTZ_SCENE_Light
QUARTZ_SCENE_Scene
)

Loading