BsCHingeJoint.h 2.5 KB

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