BsCSliderJoint.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. /** @copydoc CJoint::getLocalTransform */
  47. void getLocalTransform(JointBody body, Vector3& position, Quaternion& rotation) override;
  48. SLIDER_JOINT_DESC mDesc;
  49. /************************************************************************/
  50. /* RTTI */
  51. /************************************************************************/
  52. public:
  53. friend class CSliderJointRTTI;
  54. static RTTITypeBase* getRTTIStatic();
  55. RTTITypeBase* getRTTI() const override;
  56. protected:
  57. CSliderJoint(); // Serialization only
  58. };
  59. /** @} */
  60. }