BsCSliderJoint.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /** @cond INTERNAL */
  34. /** Returns the slider joint that this component wraps. */
  35. SliderJoint* _getInternal() const { return static_cast<SliderJoint*>(mInternal.get()); }
  36. /** @endcond */
  37. /************************************************************************/
  38. /* COMPONENT OVERRIDES */
  39. /************************************************************************/
  40. protected:
  41. friend class SceneObject;
  42. /** @copydoc CJoint::createInternal */
  43. SPtr<Joint> createInternal() override;
  44. SliderJoint::Flag mFlag = (SliderJoint::Flag)0;
  45. LimitLinearRange mLimit;
  46. /************************************************************************/
  47. /* RTTI */
  48. /************************************************************************/
  49. public:
  50. friend class CSliderJointRTTI;
  51. static RTTITypeBase* getRTTIStatic();
  52. RTTITypeBase* getRTTI() const override;
  53. protected:
  54. CSliderJoint() {} // Serialization only
  55. };
  56. /** @} */
  57. }