BsCDistanceJoint.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 "BsDistanceJoint.h"
  6. #include "BsCJoint.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Components-Core
  10. * @{
  11. */
  12. /**
  13. * @copydoc DistanceJoint
  14. *
  15. * Wraps DistanceJoint as a Component.
  16. */
  17. class BS_CORE_EXPORT CDistanceJoint : public CJoint
  18. {
  19. public:
  20. CDistanceJoint(const HSceneObject& parent);
  21. /** @copydoc DistanceJoint::getDistance */
  22. inline float getDistance() const;
  23. /** @copydoc DistanceJoint::getMinDistance */
  24. inline float getMinDistance() const;
  25. /** @copydoc DistanceJoint::setMinDistance */
  26. inline void setMinDistance(float value);
  27. /** @copydoc DistanceJoint::getMaxDistance */
  28. inline float getMaxDistance() const;
  29. /** @copydoc DistanceJoint::setMaxDistance */
  30. inline void setMaxDistance(float value);
  31. /** @copydoc DistanceJoint::getTolerance */
  32. inline float getTolerance() const;
  33. /** @copydoc DistanceJoint::setTolerance */
  34. inline void setTolerance(float value);
  35. /** @copydoc DistanceJoint::getSpring */
  36. inline Spring getSpring() const;
  37. /** @copydoc DistanceJoint::setSpring */
  38. inline void setSpring(const Spring& value);
  39. /** @copydoc DistanceJoint::setFlag */
  40. inline void setFlag(DistanceJoint::Flag flag, bool enabled);
  41. /** @copydoc DistanceJoint::hasFlag */
  42. inline bool hasFlag(DistanceJoint::Flag flag) const;
  43. /** @cond INTERNAL */
  44. /** Returns the distance joint that this component wraps. */
  45. DistanceJoint* _getInternal() const { return static_cast<DistanceJoint*>(mInternal.get()); }
  46. /** @endcond */
  47. /************************************************************************/
  48. /* COMPONENT OVERRIDES */
  49. /************************************************************************/
  50. protected:
  51. friend class SceneObject;
  52. /** @copydoc CJoint::createInternal */
  53. SPtr<Joint> createInternal() override;
  54. float mMinDistance = 0.0f;
  55. float mMaxDistance = 0.0f;
  56. float mTolerance = 0.25f;
  57. Spring mSpring;
  58. DistanceJoint::Flag mFlag = (DistanceJoint::Flag)0;
  59. /************************************************************************/
  60. /* RTTI */
  61. /************************************************************************/
  62. public:
  63. friend class CDistanceJointRTTI;
  64. static RTTITypeBase* getRTTIStatic();
  65. RTTITypeBase* getRTTI() const override;
  66. protected:
  67. CDistanceJoint() {} // Serialization only
  68. };
  69. /** @} */
  70. }