BsCSliderJoint.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsSliderJoint.h"
  6. #include "BsCJoint.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Components-Core
  10. * @{
  11. */
  12. /**
  13. * @copydoc SliderJoint
  14. *
  15. * Wraps SliderJoint as a Component.
  16. */
  17. class BS_CORE_EXPORT CSliderJoint : public CJoint
  18. {
  19. public:
  20. CSliderJoint(const HSceneObject& parent);
  21. /** @copydoc SliderJoint::getPosition */
  22. inline float getPosition() const;
  23. /** @copydoc SliderJoint::getSpeed */
  24. inline float getSpeed() const;
  25. /** @copydoc SliderJoint::getLimit */
  26. inline LimitLinearRange getLimit() const;
  27. /** @copydoc SliderJoint::setLimit */
  28. inline void setLimit(const LimitLinearRange& limit);
  29. /** @copydoc SliderJoint::setFlag */
  30. inline void setFlag(SliderJoint::Flag flag, bool enabled);
  31. /** @copydoc SliderJoint::hasFlag */
  32. inline bool hasFlag(SliderJoint::Flag flag) const;
  33. /** @name Internal
  34. * @{
  35. */
  36. /** Returns the slider joint that this component wraps. */
  37. SliderJoint* _getInternal() const { return static_cast<SliderJoint*>(mInternal.get()); }
  38. /** @} */
  39. /************************************************************************/
  40. /* COMPONENT OVERRIDES */
  41. /************************************************************************/
  42. protected:
  43. friend class SceneObject;
  44. /** @copydoc CJoint::createInternal */
  45. SPtr<Joint> createInternal() override;
  46. SliderJoint::Flag mFlag = (SliderJoint::Flag)0;
  47. LimitLinearRange mLimit;
  48. /************************************************************************/
  49. /* RTTI */
  50. /************************************************************************/
  51. public:
  52. friend class CSliderJointRTTI;
  53. static RTTITypeBase* getRTTIStatic();
  54. RTTITypeBase* getRTTI() const override;
  55. protected:
  56. CSliderJoint() {} // Serialization only
  57. };
  58. /** @} */
  59. }