BsHandleSliderPlane.h 818 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsHandleSlider.h"
  4. #include "BsRect3.h"
  5. #include "BsVector2.h"
  6. namespace BansheeEngine
  7. {
  8. class BS_ED_EXPORT HandleSliderPlane : public HandleSlider
  9. {
  10. public:
  11. HandleSliderPlane(const Vector3& dir1, const Vector3& dir2, float length, bool fixedScale);
  12. ~HandleSliderPlane();
  13. bool intersects(const Ray& ray, float& t) const;
  14. void handleInput(const CameraHandlerPtr& camera, const Vector2I& inputDelta);
  15. Vector2 getDelta() const { return mDelta; }
  16. protected:
  17. void activate(const CameraHandlerPtr& camera, const Vector2I& pointerPos) { mStartPosition = getPosition(); }
  18. void reset() { mDelta = Vector2::ZERO; }
  19. Vector3 mDirection1;
  20. Vector3 mDirection2;
  21. float mLength;
  22. Rect3 mCollider;
  23. Vector2 mDelta;
  24. Vector3 mStartPosition;
  25. };
  26. }