Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ compile_commands.json
.idea/**

!.idea/fileTemplates/
!.idea/fileTemplates/**
!.idea/fileTemplates/**

# Filament SDK (downloaded by scripts/setup.sh, ~130MB)
engine/third_party/filament/

# macOS
.DS_Store
36 changes: 26 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,29 @@ configure_file(
message(STATUS "SimpleEngine v${VERSION_STRING} (${GIT_HASH}) - ${BUILD_TYPE}")
add_subdirectory(libs/mmath)
add_subdirectory(engine)
#add_subdirectory(apps/sandbox)
add_subdirectory(apps/third_person_game)
add_subdirectory(apps/ssgi_test)
add_subdirectory(apps/animation_test)
add_subdirectory(tools/map_editor)
add_subdirectory(tools/ui_editor)
add_subdirectory(tools/animation_editor)

set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY VS_STARTUP_PROJECT sandbox)
option(SE_BUILD_APP_SANDBOX "Build sandbox app" ON)
option(SE_BUILD_APP_ANIMATION_TEST "Build animation_test app" OFF)

if(SE_BUILD_APP_SANDBOX)
add_subdirectory(apps/sandbox)
endif()
# Temporarily disabled — need Filament rendering pipeline reimplemented
#add_subdirectory(apps/third_person_game)
#add_subdirectory(apps/ssgi_test)
if(SE_BUILD_APP_ANIMATION_TEST)
add_subdirectory(apps/animation_test)
endif()
#add_subdirectory(tools/map_editor)
#add_subdirectory(tools/ui_editor)
#add_subdirectory(tools/animation_editor)

if(SE_BUILD_APP_SANDBOX)
set(SE_VS_STARTUP_PROJECT sandbox)
elseif(SE_BUILD_APP_ANIMATION_TEST)
set(SE_VS_STARTUP_PROJECT animation_test)
endif()

if(DEFINED SE_VS_STARTUP_PROJECT)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY VS_STARTUP_PROJECT ${SE_VS_STARTUP_PROJECT})
endif()
20 changes: 5 additions & 15 deletions apps/sandbox/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
cmake_minimum_required(VERSION 3.5)

# Filament sandbox — ThirdPersonLayer with Filament rendering backend
add_executable(sandbox
src/AppLayer.cpp
src/AppLayer.h
src/ThirdPersonLayer.cpp
src/ThirdPersonLayer.h
src/input_sample/InputSampleLayer.h
src/input_sample/InputSampleLayer.cpp
src/event_sample/EventSampleLayer.h
src/event_sample/EventSampleLayer.cpp
src/event_sample/events/Events.h
src/physics_sample/PhysicsSampleLayer.h
src/physics_sample/PhysicsSampleLayer.cpp
../SampleUtilities.h
src/main.cpp)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
src/main.cpp
src/ThirdPersonLayer.cpp)

set_property(TARGET ImGui PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set_property(TARGET sandbox PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

Expand Down
30 changes: 17 additions & 13 deletions apps/sandbox/src/AppLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,29 @@ void AppLayer::OnAttach() {

// Setup Input Bindings
auto& input = InputManager::Get();
input.BindAxis("MoveForward", Key::W, 1.0f);
input.BindAxis("MoveForward", Key::S, -1.0f);
input.BindAxis("MoveRight", Key::D, 1.0f);
input.BindAxis("MoveRight", Key::A, -1.0f);
input.BindAxis("MoveUp", Key::Space, 1.0f);
input.BindAxis("MoveUp", Key::LeftControl, -1.0f);
input.BindAxis("LookX", Key::MouseX, 1.0f);
input.BindAxis("LookY", Key::MouseY, -1.0f); // Inverted Y
input.BindAction("ToggleCamera", Key::Tab);
input.BindAction("ToggleCursor", Key::LeftAlt);

// InputHandler::setCursorModeFromString(window, "normal");
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); // Default to captured for camera
input.CreateActionMap(inputMapName_);
input.PushContext(inputMapName_);
input.BindAxis(inputMapName_, "MoveForward", Key::W, 1.0f);
input.BindAxis(inputMapName_, "MoveForward", Key::S, -1.0f);
input.BindAxis(inputMapName_, "MoveRight", Key::D, 1.0f);
input.BindAxis(inputMapName_, "MoveRight", Key::A, -1.0f);
input.BindAxis(inputMapName_, "MoveUp", Key::Space, 1.0f);
input.BindAxis(inputMapName_, "MoveUp", Key::LeftControl, -1.0f);
input.BindAxis(inputMapName_, "LookX", Key::MouseX, 1.0f);
input.BindAxis(inputMapName_, "LookY", Key::MouseY, -1.0f); // Inverted Y
input.BindAction(inputMapName_, "ToggleCamera", Key::Tab);
input.BindAction(inputMapName_, "ToggleCursor", Key::LeftAlt);

input.SetCursorMode(CursorMode::Locked); // Default to captured for camera

RenderCommand::SetClearColor({0.3f, 0.3f, 0.3f, 1.0f});
}

void AppLayer::OnDetach() {
SE_LOG_INFO("AppLayer detached");
auto& input = InputManager::Get();
input.PopContext(inputMapName_);
input.RemoveActionMap(inputMapName_);
scene_.reset();
}

Expand Down
2 changes: 2 additions & 0 deletions apps/sandbox/src/AppLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ class AppLayer : public Layer {
float yaw_ = 0.0f;

bool camera_active_ = true;

const std::string inputMapName_ = "sandbox.app";
};
Loading
Loading