BsScriptSceneHandles.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "Math/BsVector2I.h"
  7. namespace bs
  8. {
  9. class ScriptCCamera;
  10. /** @addtogroup ScriptInteropEditor
  11. * @{
  12. */
  13. /** Interop class between C++ & CLR for SceneHandles. */
  14. class BS_SCR_BED_EXPORT ScriptSceneHandles : public ScriptObject <ScriptSceneHandles>
  15. {
  16. public:
  17. SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "SceneHandles")
  18. private:
  19. ScriptSceneHandles(MonoObject* object, EditorWidgetBase* parentWidget, const HCamera& camera);
  20. ~ScriptSceneHandles();
  21. /**
  22. * Checks is the pointer currently within the provided window, and if it is not the cursor is wrapped in such a way
  23. * so that it is returned to within the window bounds.
  24. *
  25. * @return How far was the cursor moved due to wrapping. This will be (0, 0) if the cursor is within window bounds
  26. * initially.
  27. */
  28. Vector2I wrapCursorToWindow() const;
  29. EditorWidgetBase* mParentWidget;
  30. HCamera mCamera;
  31. Vector2I mMouseDeltaCompensate;
  32. /************************************************************************/
  33. /* CLR HOOKS */
  34. /************************************************************************/
  35. static void internal_Create(MonoObject* managedInstance, ScriptEditorWindow* parentWindow, ScriptCCamera* camera);
  36. static void internal_Draw(ScriptSceneHandles* thisPtr);
  37. static void internal_BeginInput();
  38. static void internal_EndInput();
  39. static bool internal_UpdateInput(ScriptSceneHandles* thisPtr, Vector2I* inputPos, Vector2I* inputDelta);
  40. static bool internal_TrySelect(ScriptSceneHandles* thisPtr, Vector2I* inputPos);
  41. static bool internal_IsActive(ScriptSceneHandles* thisPtr);
  42. static void internal_ClearSelection(ScriptSceneHandles* thisPtr);
  43. };
  44. /** @} */
  45. }