Skip to content

Commit 28d5fb3

Browse files
author
Adrien GIVRY
committed
New models for arrows implemented and translation fixed
1 parent 4d0afae commit 28d5fb3

15 files changed

Lines changed: 146 additions & 123 deletions

File tree

36 KB
Binary file not shown.
15.4 KB
Binary file not shown.
15.8 KB
Binary file not shown.

Sources/Overload/OvEditor/OvEditor.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ xcopy "$(ProjectDir)Layout.ini" "$(SolutionDir)..\..\Build\$(ProjectName)\$(Conf
140140
<ClCompile Include="src\OvEditor\Core\EditorActions.cpp" />
141141
<ClCompile Include="src\OvEditor\Core\EditorRenderer.cpp" />
142142
<ClCompile Include="src\OvEditor\Core\EditorResources.cpp" />
143-
<ClCompile Include="src\OvEditor\Core\GuizmoOperations.cpp" />
143+
<ClCompile Include="src\OvEditor\Core\GizmoBehaviour.cpp" />
144144
<ClCompile Include="src\OvEditor\Core\PanelsManager.cpp" />
145145
<ClCompile Include="src\OvEditor\Core\ProjectHub.cpp" />
146146
<ClCompile Include="src\OvEditor\Panels\AssetBrowser.cpp" />
@@ -170,7 +170,7 @@ xcopy "$(ProjectDir)Layout.ini" "$(SolutionDir)..\..\Build\$(ProjectName)\$(Conf
170170
<ClInclude Include="include\OvEditor\Core\EditorActions.h" />
171171
<ClInclude Include="include\OvEditor\Core\EditorRenderer.h" />
172172
<ClInclude Include="include\OvEditor\Core\EditorResources.h" />
173-
<ClInclude Include="include\OvEditor\Core\GuizmoOperations.h" />
173+
<ClInclude Include="include\OvEditor\Core\GizmoBehaviour.h" />
174174
<ClInclude Include="include\OvEditor\Core\PanelsManager.h" />
175175
<ClInclude Include="include\OvEditor\Core\ProjectHub.h" />
176176
<ClInclude Include="include\OvEditor\Resources\RawShaders.h" />

Sources/Overload/OvEditor/OvEditor.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<ClCompile Include="src\OvEditor\Resources\RawShaders.cpp">
9797
<Filter>Source Files</Filter>
9898
</ClCompile>
99-
<ClCompile Include="src\OvEditor\Core\GuizmoOperations.cpp">
99+
<ClCompile Include="src\OvEditor\Core\GizmoBehaviour.cpp">
100100
<Filter>Source Files</Filter>
101101
</ClCompile>
102102
</ItemGroup>
@@ -185,7 +185,7 @@
185185
<ClInclude Include="include\OvEditor\Resources\RawShaders.h">
186186
<Filter>Header Files</Filter>
187187
</ClInclude>
188-
<ClInclude Include="include\OvEditor\Core\GuizmoOperations.h">
188+
<ClInclude Include="include\OvEditor\Core\GizmoBehaviour.h">
189189
<Filter>Header Files</Filter>
190190
</ClInclude>
191191
</ItemGroup>

Sources/Overload/OvEditor/include/OvEditor/Core/EditorRenderer.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "OvEditor/Core/Context.h"
1919

20+
namespace OvEditor::Core { enum class EGizmoOperation; }
2021
namespace OvEditor::Panels { class AView; }
2122

2223
namespace OvEditor::Core
@@ -72,12 +73,13 @@ namespace OvEditor::Core
7273
void RenderCameras();
7374

7475
/**
75-
* Render a guizmo at position
76+
* Render a gizmo at position
7677
* @param p_position
7778
* @param p_rotation
78-
* @param p_pickable (Determine the shader to use to render the guizmo)
79+
* @param p_operation
80+
* @param p_pickable (Determine the shader to use to render the gizmo)
7981
*/
80-
void RenderGuizmo(const OvMaths::FVector3& p_position, const OvMaths::FQuaternion& p_rotation, bool p_pickable = false);
82+
void RenderGizmo(const OvMaths::FVector3& p_position, const OvMaths::FQuaternion& p_rotation, OvEditor::Core::EGizmoOperation p_operation, bool p_pickable = false);
8183

8284
/**
8385
* Render a model to the stencil buffer
@@ -147,9 +149,9 @@ namespace OvEditor::Core
147149
OvCore::Resources::Material m_emptyMaterial;
148150
OvCore::Resources::Material m_defaultMaterial;
149151
OvCore::Resources::Material m_cameraMaterial;
150-
OvCore::Resources::Material m_guizmoArrowMaterial;
151-
OvCore::Resources::Material m_guizmoBallMaterial;
152-
OvCore::Resources::Material m_guizmoPickingMaterial;
152+
OvCore::Resources::Material m_gizmoArrowMaterial;
153+
OvCore::Resources::Material m_gizmoBallMaterial;
154+
OvCore::Resources::Material m_gizmoPickingMaterial;
153155
OvCore::Resources::Material m_actorPickingMaterial;
154156
};
155157
}

Sources/Overload/OvEditor/include/OvEditor/Core/GuizmoOperations.h renamed to Sources/Overload/OvEditor/include/OvEditor/Core/GizmoBehaviour.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
namespace OvEditor::Core
1212
{
13-
/* Handle guizmo behaviours */
14-
class GuizmoOperations
13+
enum class EGizmoOperation
1514
{
16-
public:
17-
enum class EOperation
18-
{
19-
TRANSLATION,
20-
ROTATION,
21-
SCALE
22-
};
15+
TRANSLATION,
16+
ROTATION,
17+
SCALE
18+
};
2319

20+
/* Handle gizmo behaviours */
21+
class GizmoBehaviour
22+
{
23+
public:
2424
enum class EDirection
2525
{
2626
X,
@@ -29,16 +29,16 @@ namespace OvEditor::Core
2929
};
3030

3131
/**
32-
* Starts the guizmo picking behaviour for the given target in the given direction
32+
* Starts the gizmo picking behaviour for the given target in the given direction
3333
* @param p_actor
3434
* @param p_cameraPosition
3535
* @param p_operation
3636
* @param p_direction
3737
*/
38-
void StartPicking(OvCore::ECS::Actor& p_target, const OvMaths::FVector3& p_cameraPosition, EOperation p_operation, EDirection p_direction);
38+
void StartPicking(OvCore::ECS::Actor& p_target, const OvMaths::FVector3& p_cameraPosition, EGizmoOperation p_operation, EDirection p_direction);
3939

4040
/**
41-
* Stops the guizmo picking behaviour
41+
* Stops the gizmo picking behaviour
4242
*/
4343
void StopPicking();
4444

@@ -57,7 +57,7 @@ namespace OvEditor::Core
5757
void SetCurrentMouse(const OvMaths::FVector2& p_mousePosition);
5858

5959
/**
60-
* Returns true if the guizmo is currently picked
60+
* Returns true if the gizmo is currently picked
6161
*/
6262
bool IsPicking() const;
6363

@@ -109,7 +109,7 @@ namespace OvEditor::Core
109109
bool m_firstMouse = true;
110110
float m_distanceToActor = 0.0f;
111111
OvCore::ECS::Actor* m_target;
112-
EOperation m_currentOperation;
112+
EGizmoOperation m_currentOperation;
113113
EDirection m_direction;
114114
OvMaths::FTransform m_originalTransform;
115115
OvMaths::FVector2 m_originMouse;

Sources/Overload/OvEditor/include/OvEditor/Panels/SceneView.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#pragma once
88

99
#include "OvEditor/Panels/AViewControllable.h"
10-
#include "OvEditor/Core/GuizmoOperations.h"
10+
#include "OvEditor/Core/GizmoBehaviour.h"
1111

1212
namespace OvEditor::Panels
1313
{
@@ -56,7 +56,7 @@ namespace OvEditor::Panels
5656
private:
5757
OvCore::SceneSystem::SceneManager& m_sceneManager;
5858
OvRendering::Buffers::Framebuffer m_actorPickingFramebuffer;
59-
OvEditor::Core::GuizmoOperations m_guizmoOperations;
60-
OvEditor::Core::GuizmoOperations::EOperation m_currentOperation = OvEditor::Core::GuizmoOperations::EOperation::TRANSLATION;
59+
OvEditor::Core::GizmoBehaviour m_gizmoOperations;
60+
OvEditor::Core::EGizmoOperation m_currentOperation = OvEditor::Core::EGizmoOperation::TRANSLATION;
6161
};
6262
}

Sources/Overload/OvEditor/include/OvEditor/Resources/RawShaders.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace OvEditor::Resources
2222
static std::pair<std::string, std::string> GetGrid();
2323

2424
/**
25-
* Returns the guizmo shader
25+
* Returns the gizmo shader
2626
*/
27-
static std::pair<std::string, std::string> GetGuizmo();
27+
static std::pair<std::string, std::string> GetGizmo();
2828
};
2929
}

0 commit comments

Comments
 (0)