Plasma Engine  2.0
Loading...
Searching...
No Matches
SnapProvider.h
1#pragma once
2
3#include <EditorFramework/EditorFrameworkDLL.h>
4#include <Foundation/Communication/Event.h>
5#include <Foundation/Math/Declarations.h>
6
8class plPreferences;
9
11{
12 enum class Type
13 {
14 RotationSnapChanged,
15 ScaleSnapChanged,
16 TranslationSnapChanged
17 };
18
19 Type m_Type;
20};
21
22class PL_EDITORFRAMEWORK_DLL plSnapProvider
23{
24public:
25 static void Startup();
26 static void Shutdown();
27
28 static plAngle GetRotationSnapValue();
29 static float GetScaleSnapValue();
30 static float GetTranslationSnapValue();
31
32 static void SetRotationSnapValue(plAngle angle);
33 static void SetScaleSnapValue(float fPercentage);
34 static void SetTranslationSnapValue(float fUnits);
35
37 static void SnapTranslation(plVec3& value);
38
40 static void SnapTranslationInLocalSpace(const plQuat& qRotation, plVec3& ref_vTranslation);
41
42 static void SnapRotation(plAngle& ref_rotation);
43
44 static void SnapScale(float& ref_fScale);
45 static void SnapScale(plVec3& ref_vScale);
46
47 static plVec3 GetScaleSnapped(const plVec3& vScale);
48
50
51private:
52 static void EditorEventHandler(const plEditorAppEvent& e);
53 static void PreferenceChangedEventHandler(plPreferences* pPreferenceBase);
54
55 static plAngle s_RotationSnapValue;
56 static float s_fScaleSnapValue;
57 static float s_fTranslationSnapValue;
58 static plEventSubscriptionID s_UserPreferencesChanged;
59};
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
Definition Event.h:177
Base class for all preferences.
Definition Preferences.h:17
Definition SnapProvider.h:23
Definition EditorApp.moc.h:35
Definition SnapProvider.h:11