BsHandleSliderLine.h 873 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsHandleSlider.h"
  4. #include "BsCapsule.h"
  5. #include "BsSphere.h"
  6. namespace BansheeEngine
  7. {
  8. class BS_ED_EXPORT HandleSliderLine : public HandleSlider
  9. {
  10. public:
  11. HandleSliderLine(const Vector3& direction, float length, bool fixedScale);
  12. ~HandleSliderLine();
  13. bool intersects(const Ray& ray, float& t) const;
  14. void handleInput(const CameraHandlerPtr& camera, const Vector2I& inputDelta);
  15. float getDelta() const { return mDelta; }
  16. protected:
  17. void activate(const CameraHandlerPtr& camera, const Vector2I& pointerPos) { mStartPosition = getPosition(); }
  18. void reset() { mDelta = 0.0f; }
  19. static const float CAPSULE_RADIUS;
  20. static const float SPHERE_RADIUS;
  21. Vector3 mDirection;
  22. float mLength;
  23. float mDelta;
  24. Vector3 mStartPosition;
  25. Capsule mCapsuleCollider;
  26. Sphere mSphereCollider;
  27. };
  28. }