BsCSliderJoint.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 "Physics/BsSliderJoint.h"
  6. #include "Components/BsCJoint.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components-Core
  10. * @{
  11. */
  12. /**
  13. * @copydoc SliderJoint
  14. *
  15. * @note Wraps SliderJoint as a Component.
  16. */
  17. class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:SliderJoint) CSliderJoint : public CJoint
  18. {
  19. public:
  20. CSliderJoint(const HSceneObject& parent);
  21. /** @copydoc SliderJoint::getPosition */
  22. BS_SCRIPT_EXPORT(n:Position,pr:getter)
  23. float getPosition() const;
  24. /** @copydoc SliderJoint::getSpeed */
  25. BS_SCRIPT_EXPORT(n:Speed,pr:getter)
  26. float getSpeed() const;
  27. /** @copydoc SliderJoint::getLimit */
  28. BS_SCRIPT_EXPORT(n:Limit,pr:getter)
  29. LimitLinearRange getLimit() const;
  30. /** @copydoc SliderJoint::setLimit */
  31. BS_SCRIPT_EXPORT(n:Limit,pr:setter)
  32. void setLimit(const LimitLinearRange& limit);
  33. /** @copydoc SliderJoint::setFlag */
  34. BS_SCRIPT_EXPORT(n:SetFlag)
  35. void setFlag(SliderJointFlag flag, bool enabled);
  36. /** @copydoc SliderJoint::hasFlag */
  37. BS_SCRIPT_EXPORT(n:HasFlag)
  38. bool hasFlag(SliderJointFlag flag) const;
  39. /** @name Internal
  40. * @{
  41. */
  42. /** Returns the slider joint that this component wraps. */
  43. SliderJoint* _getInternal() const { return static_cast<SliderJoint*>(mInternal.get()); }
  44. /** @} */
  45. /************************************************************************/
  46. /* COMPONENT OVERRIDES */
  47. /************************************************************************/
  48. protected:
  49. friend class SceneObject;
  50. /** @copydoc CJoint::createInternal */
  51. SPtr<Joint> createInternal() override;
  52. /** @copydoc CJoint::getLocalTransform */
  53. void getLocalTransform(JointBody body, Vector3& position, Quaternion& rotation) override;
  54. SLIDER_JOINT_DESC mDesc;
  55. /************************************************************************/
  56. /* RTTI */
  57. /************************************************************************/
  58. public:
  59. friend class CSliderJointRTTI;
  60. static RTTITypeBase* getRTTIStatic();
  61. RTTITypeBase* getRTTI() const override;
  62. protected:
  63. CSliderJoint(); // Serialization only
  64. };
  65. /** @} */
  66. }