Skip to content

Commit

Permalink
Reorganize FpsCamera
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Ozyurt committed Apr 15, 2024
1 parent ddcfada commit 4ce95a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RayTracer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
<None Include="readme.md" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\graphics\fps_camera.h" />
<ClInclude Include="src\scene\fps_camera.h" />
<ClInclude Include="src\common\common.h" />
<ClInclude Include="src\graphics\ray_tracer.h" />
<ClInclude Include="src\graphics\model.h" />
Expand Down
2 changes: 1 addition & 1 deletion RayTracer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<ClInclude Include="src\common\common.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\graphics\fps_camera.h">
<ClInclude Include="src\scene\fps_camera.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\graphics\model.h">
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <vector>

#include "common/common.h"
#include "graphics/fps_camera.h"
#include "graphics/model.h"
#include "graphics/ray_tracer.h"
#include "scene/fps_camera.h"
#include "scene/mesh_view.h"
#include "utils/win32.h"
#include "utils/xm.h"
Expand Down Expand Up @@ -124,7 +124,7 @@ int WINAPI wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
LONGLONG simulation_time = 0;
std::bitset<256> key_states{};
std::bitset<256> prev_key_states{};
auto fps_camera = FpsCamera();
auto fps_camera = scene::FpsCamera();
DirectX::XMVECTOR light_position =
DirectX::XMVectorSet(0.0f, 0.0f, 0.1f, 0.0f);

Expand Down
2 changes: 2 additions & 0 deletions src/graphics/fps_camera.h → src/scene/fps_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <cmath>

namespace scene {
class FpsCamera {
public:
inline FpsCamera() : position(0.0f, 0.0f, 0.0f), pitch_(0.0f), yaw_(0.0f) {}
Expand Down Expand Up @@ -62,3 +63,4 @@ class FpsCamera {
return DirectX::XMVector3Cross(GetForwardVector(), GetRightVector());
}
};
} // namespace scene

0 comments on commit 4ce95a4

Please sign in to comment.