-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditorstate.hpp
61 lines (41 loc) · 1.52 KB
/
editorstate.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef GAMELIB_EDITORSTATE_HPP
#define GAMELIB_EDITORSTATE_HPP
#include "../gamelib/gameobject.hpp"
#include "../urhoextras/cameracontrol.hpp"
#include "scenerendererstate.hpp"
#include <Urho3D/Scene/Scene.h>
namespace GameLib
{
class App;
class EditorState : public SceneRendererState
{
public:
EditorState(App* app, Urho3D::Context* context, Urho3D::String const& path);
void show() override;
void hide() override;
private:
enum Mode
{
MODE_DEFAULT,
MODE_ROTATING_VIEW,
MODE_ROTATING_OBJECT
};
Urho3D::String path;
Urho3D::Vector<Urho3D::StringHash> editable_object_types;
Mode mode;
// Camera
UrhoExtras::CameraControl cam_control;
// Brush
int brush_selection;
float brush_yaw;
void handleKeyDown(Urho3D::StringHash event_type, Urho3D::VariantMap& event_data);
void handleKeyUp(Urho3D::StringHash event_type, Urho3D::VariantMap& event_data);
void handleMouseButtonDown(Urho3D::StringHash event_type, Urho3D::VariantMap& event_data);
void handleMouseButtonUp(Urho3D::StringHash event_type, Urho3D::VariantMap& event_data);
void handleMouseWheel(Urho3D::StringHash event_type, Urho3D::VariantMap& event_data);
void handleUpdate(Urho3D::StringHash event_type, Urho3D::VariantMap& event_data);
bool raycast(Urho3D::Vector3& result_pos, Urho3D::Vector3& result_normal);
Urho3D::Vector3 calculateObjectPlacementPosition(Urho3D::Vector3 const& pos, Urho3D::Vector3 const& normal, GameLib::GameObject const* obj);
};
}
#endif