BsCD6Joint.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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/BsD6Joint.h"
  6. #include "Components/BsCJoint.h"
  7. namespace bs
  8. {
  9. /** @addtogroup Components-Core
  10. * @{
  11. */
  12. /**
  13. * @copydoc D6Joint
  14. *
  15. * @note Wraps D6Joint as a Component.
  16. */
  17. class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:D6Joint) CD6Joint : public CJoint
  18. {
  19. public:
  20. CD6Joint(const HSceneObject& parent);
  21. /** @copydoc D6Joint::getMotion */
  22. BS_SCRIPT_EXPORT(n:GetMotion)
  23. D6JointMotion getMotion(D6JointAxis axis) const;
  24. /** @copydoc D6Joint::setMotion */
  25. BS_SCRIPT_EXPORT(n:SetMotion)
  26. void setMotion(D6JointAxis axis, D6JointMotion motion);
  27. /** @copydoc D6Joint::getTwist */
  28. BS_SCRIPT_EXPORT(n:Twist,pr:getter)
  29. Radian getTwist() const;
  30. /** @copydoc D6Joint::getSwingY */
  31. BS_SCRIPT_EXPORT(n:SwingY,pr:getter)
  32. Radian getSwingY() const;
  33. /** @copydoc D6Joint::getSwingZ */
  34. BS_SCRIPT_EXPORT(n:SwingZ,pr:getter)
  35. Radian getSwingZ() const;
  36. /** @copydoc D6Joint::getLimitLinear */
  37. BS_SCRIPT_EXPORT(n:LimitLinear,pr:getter)
  38. LimitLinear getLimitLinear() const;
  39. /** @copydoc D6Joint::setLimitLinear */
  40. BS_SCRIPT_EXPORT(n:LimitLinear,pr:setter)
  41. void setLimitLinear(const LimitLinear& limit);
  42. /** @copydoc D6Joint::getLimitTwist */
  43. BS_SCRIPT_EXPORT(n:LimitTwist,pr:getter)
  44. LimitAngularRange getLimitTwist() const;
  45. /** @copydoc D6Joint::setLimitTwist */
  46. BS_SCRIPT_EXPORT(n:LimitTwist,pr:setter)
  47. void setLimitTwist(const LimitAngularRange& limit);
  48. /** @copydoc D6Joint::getLimitSwing */
  49. BS_SCRIPT_EXPORT(n:LimitSwing,pr:getter)
  50. LimitConeRange getLimitSwing() const;
  51. /** @copydoc D6Joint::setLimitSwing */
  52. BS_SCRIPT_EXPORT(n:LimitSwing,pr:setter)
  53. void setLimitSwing(const LimitConeRange& limit);
  54. /** @copydoc D6Joint::getDrive */
  55. BS_SCRIPT_EXPORT(n:GetDrive)
  56. D6JointDrive getDrive(D6JointDriveType type) const;
  57. /** @copydoc D6Joint::setDrive */
  58. BS_SCRIPT_EXPORT(n:SetDrive)
  59. void setDrive(D6JointDriveType type, const D6JointDrive& drive);
  60. /** @copydoc D6Joint::getDrivePosition */
  61. BS_SCRIPT_EXPORT(n:DrivePosition,pr:getter)
  62. Vector3 getDrivePosition() const;
  63. /** @copydoc D6Joint::getDriveRotation */
  64. BS_SCRIPT_EXPORT(n:DriveRotation,pr:getter)
  65. Quaternion getDriveRotation() const;
  66. /** @copydoc D6Joint::setDriveTransform */
  67. BS_SCRIPT_EXPORT(n:SetDriveTransform)
  68. void setDriveTransform(const Vector3& position, const Quaternion& rotation);
  69. /** @copydoc D6Joint::getDriveLinearVelocity */
  70. BS_SCRIPT_EXPORT(n:DriveLinearVelocity,pr:getter)
  71. Vector3 getDriveLinearVelocity() const;
  72. /** @copydoc D6Joint::getDriveAngularVelocity */
  73. BS_SCRIPT_EXPORT(n:DriveAngularVelocity,pr:getter)
  74. Vector3 getDriveAngularVelocity() const;
  75. /** @copydoc D6Joint::setDriveVelocity */
  76. BS_SCRIPT_EXPORT(n:SetDriveVelocity)
  77. void setDriveVelocity(const Vector3& linear, const Vector3& angular);
  78. /** @name Internal
  79. * @{
  80. */
  81. /** Returns the D6 joint that this component wraps. */
  82. D6Joint* _getInternal() const { return static_cast<D6Joint*>(mInternal.get()); }
  83. /** @} */
  84. /************************************************************************/
  85. /* COMPONENT OVERRIDES */
  86. /************************************************************************/
  87. protected:
  88. friend class SceneObject;
  89. /** @copydoc CJoint::createInternal */
  90. SPtr<Joint> createInternal() override;
  91. D6_JOINT_DESC mDesc;
  92. /************************************************************************/
  93. /* RTTI */
  94. /************************************************************************/
  95. public:
  96. friend class CD6JointRTTI;
  97. static RTTITypeBase* getRTTIStatic();
  98. RTTITypeBase* getRTTI() const override;
  99. protected:
  100. CD6Joint(); // Serialization only
  101. };
  102. /** @} */
  103. }