BsScriptSceneHandles.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptObject.h"
  4. #include "BsVector2I.h"
  5. namespace BansheeEngine
  6. {
  7. /** Interop class between C++ & CLR for SceneHandles. */
  8. class BS_SCR_BED_EXPORT ScriptSceneHandles : public ScriptObject <ScriptSceneHandles>
  9. {
  10. public:
  11. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "SceneHandles")
  12. private:
  13. ScriptSceneHandles(MonoObject* object, EditorWidgetBase* parentWidget, const SPtr<Camera>& camera);
  14. ~ScriptSceneHandles();
  15. /**
  16. * @brief Checks is the pointer currently within the provided window, and if it is not
  17. * the cursor is wrapped in such a way so that it is returned to within the window bounds.
  18. *
  19. * @return How far was the cursor moved due to wrapping. This will be (0, 0) if the cursor is within
  20. * window bounds initially.
  21. */
  22. Vector2I wrapCursorToWindow() const;
  23. EditorWidgetBase* mParentWidget;
  24. SPtr<Camera> mCamera;
  25. Vector2I mMouseDeltaCompensate;
  26. /************************************************************************/
  27. /* CLR HOOKS */
  28. /************************************************************************/
  29. static void internal_Create(MonoObject* managedInstance, ScriptEditorWindow* parentWindow, ScriptCamera* camera);
  30. static void internal_Draw(ScriptSceneHandles* thisPtr);
  31. static void internal_BeginInput();
  32. static void internal_EndInput();
  33. static void internal_UpdateInput(ScriptSceneHandles* thisPtr, Vector2I* inputPos, Vector2I* inputDelta);
  34. static void internal_TrySelect(ScriptSceneHandles* thisPtr, Vector2I* inputPos);
  35. static bool internal_IsActive(ScriptSceneHandles* thisPtr);
  36. static void internal_ClearSelection(ScriptSceneHandles* thisPtr);
  37. };
  38. }