BsScriptSceneHandles.h 1.9 KB

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