BsCHingeJoint.h 2.3 KB

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