BsHandleSliderSphere.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2017 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "Handles/BsHandleSlider.h"
  6. #include "Math/BsSphere.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Handles
  10. * @{
  11. */
  12. /**
  13. * Handle slider represented by a sphere collider. The slider doesn't allow dragging (it doesn't report a delta value
  14. * like other sliders) but can be used for picking (selection) purposes.
  15. */
  16. class BS_ED_EXPORT HandleSliderSphere : public HandleSlider
  17. {
  18. public:
  19. /**
  20. * Constructs a new sphere slider.
  21. *
  22. * @param[in] radius Radius of the collider sphere.
  23. * @param[in] fixedScale If true the handle slider will always try to maintain the same visible area in the
  24. * viewport regardless of distance from camera.
  25. * @param[in] layer Layer that allows filtering of which sliders are interacted with from a specific camera.
  26. */
  27. HandleSliderSphere(float radius, bool fixedScale, UINT64 layer);
  28. ~HandleSliderSphere();
  29. /** @copydoc HandleSlider::intersects */
  30. bool intersects(const Vector2I& screenPos, const Ray& ray, float& t) const override;
  31. /** @copydoc HandleSlider::handleInput */
  32. void handleInput(const SPtr<Camera>& camera, const Vector2I& inputDelta) override;
  33. protected:
  34. Sphere mSphereCollider;
  35. };
  36. /** @} */
  37. }