BsCDistanceJoint.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/BsDistanceJoint.h"
  6. #include "Components/BsCJoint.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components-Core
  10. * @{
  11. */
  12. /**
  13. * @copydoc DistanceJoint
  14. *
  15. * @note Wraps DistanceJoint as a Component.
  16. */
  17. class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:DistanceJoint) CDistanceJoint : public CJoint
  18. {
  19. public:
  20. CDistanceJoint(const HSceneObject& parent);
  21. /** @copydoc DistanceJoint::getDistance */
  22. BS_SCRIPT_EXPORT(n:Distance,pr:getter)
  23. float getDistance() const;
  24. /** @copydoc DistanceJoint::getMinDistance */
  25. BS_SCRIPT_EXPORT(n:MinDistance,pr:getter)
  26. float getMinDistance() const;
  27. /** @copydoc DistanceJoint::setMinDistance */
  28. BS_SCRIPT_EXPORT(n:MinDistance,pr:setter)
  29. void setMinDistance(float value);
  30. /** @copydoc DistanceJoint::getMaxDistance */
  31. BS_SCRIPT_EXPORT(n:MaxDistance,pr:getter)
  32. float getMaxDistance() const;
  33. /** @copydoc DistanceJoint::setMaxDistance */
  34. BS_SCRIPT_EXPORT(n:MaxDistance,pr:setter)
  35. void setMaxDistance(float value);
  36. /** @copydoc DistanceJoint::getTolerance */
  37. BS_SCRIPT_EXPORT(n:Tolerance,pr:getter)
  38. float getTolerance() const;
  39. /** @copydoc DistanceJoint::setTolerance */
  40. BS_SCRIPT_EXPORT(n:Tolerance,pr:setter)
  41. void setTolerance(float value);
  42. /** @copydoc DistanceJoint::getSpring */
  43. BS_SCRIPT_EXPORT(n:Spring,pr:getter)
  44. Spring getSpring() const;
  45. /** @copydoc DistanceJoint::setSpring */
  46. BS_SCRIPT_EXPORT(n:Spring,pr:setter)
  47. void setSpring(const Spring& value);
  48. /** @copydoc DistanceJoint::setFlag */
  49. BS_SCRIPT_EXPORT(n:SetFlag)
  50. void setFlag(DistanceJointFlag flag, bool enabled);
  51. /** @copydoc DistanceJoint::hasFlag */
  52. BS_SCRIPT_EXPORT(n:HasFlag)
  53. bool hasFlag(DistanceJointFlag flag) const;
  54. /** @name Internal
  55. * @{
  56. */
  57. /** Returns the distance joint that this component wraps. */
  58. DistanceJoint* _getInternal() const { return static_cast<DistanceJoint*>(mInternal.get()); }
  59. /** @} */
  60. /************************************************************************/
  61. /* COMPONENT OVERRIDES */
  62. /************************************************************************/
  63. protected:
  64. friend class SceneObject;
  65. /** @copydoc CJoint::createInternal */
  66. SPtr<Joint> createInternal() override;
  67. DISTANCE_JOINT_DESC mDesc;
  68. /************************************************************************/
  69. /* RTTI */
  70. /************************************************************************/
  71. public:
  72. friend class CDistanceJointRTTI;
  73. static RTTITypeBase* getRTTIStatic();
  74. RTTITypeBase* getRTTI() const override;
  75. protected:
  76. CDistanceJoint();// Serialization only
  77. };
  78. /** @} */
  79. }