BsCDistanceJoint.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. /** @name Internal
  44. * @{
  45. */
  46. /** Returns the distance joint that this component wraps. */
  47. DistanceJoint* _getInternal() const { return static_cast<DistanceJoint*>(mInternal.get()); }
  48. /** @} */
  49. /************************************************************************/
  50. /* COMPONENT OVERRIDES */
  51. /************************************************************************/
  52. protected:
  53. friend class SceneObject;
  54. /** @copydoc CJoint::createInternal */
  55. SPtr<Joint> createInternal() override;
  56. DISTANCE_JOINT_DESC mDesc;
  57. /************************************************************************/
  58. /* RTTI */
  59. /************************************************************************/
  60. public:
  61. friend class CDistanceJointRTTI;
  62. static RTTITypeBase* getRTTIStatic();
  63. RTTITypeBase* getRTTI() const override;
  64. protected:
  65. CDistanceJoint();// Serialization only
  66. };
  67. /** @} */
  68. }