slider_joint_bullet.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*************************************************************************/
  2. /* slider_joint_bullet.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef SLIDER_JOINT_BULLET_H
  31. #define SLIDER_JOINT_BULLET_H
  32. #include "joint_bullet.h"
  33. /**
  34. @author AndreaCatania
  35. */
  36. class RigidBodyBullet;
  37. class SliderJointBullet : public JointBullet {
  38. class btSliderConstraint *sliderConstraint;
  39. public:
  40. /// Reference frame is A
  41. SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB);
  42. virtual PhysicsServer::JointType get_type() const { return PhysicsServer::JOINT_SLIDER; }
  43. const RigidBodyBullet *getRigidBodyA() const;
  44. const RigidBodyBullet *getRigidBodyB() const;
  45. const Transform getCalculatedTransformA() const;
  46. const Transform getCalculatedTransformB() const;
  47. const Transform getFrameOffsetA() const;
  48. const Transform getFrameOffsetB() const;
  49. Transform getFrameOffsetA();
  50. Transform getFrameOffsetB();
  51. real_t getLowerLinLimit() const;
  52. void setLowerLinLimit(real_t lowerLimit);
  53. real_t getUpperLinLimit() const;
  54. void setUpperLinLimit(real_t upperLimit);
  55. real_t getLowerAngLimit() const;
  56. void setLowerAngLimit(real_t lowerLimit);
  57. real_t getUpperAngLimit() const;
  58. void setUpperAngLimit(real_t upperLimit);
  59. real_t getSoftnessDirLin() const;
  60. real_t getRestitutionDirLin() const;
  61. real_t getDampingDirLin() const;
  62. real_t getSoftnessDirAng() const;
  63. real_t getRestitutionDirAng() const;
  64. real_t getDampingDirAng() const;
  65. real_t getSoftnessLimLin() const;
  66. real_t getRestitutionLimLin() const;
  67. real_t getDampingLimLin() const;
  68. real_t getSoftnessLimAng() const;
  69. real_t getRestitutionLimAng() const;
  70. real_t getDampingLimAng() const;
  71. real_t getSoftnessOrthoLin() const;
  72. real_t getRestitutionOrthoLin() const;
  73. real_t getDampingOrthoLin() const;
  74. real_t getSoftnessOrthoAng() const;
  75. real_t getRestitutionOrthoAng() const;
  76. real_t getDampingOrthoAng() const;
  77. void setSoftnessDirLin(real_t softnessDirLin);
  78. void setRestitutionDirLin(real_t restitutionDirLin);
  79. void setDampingDirLin(real_t dampingDirLin);
  80. void setSoftnessDirAng(real_t softnessDirAng);
  81. void setRestitutionDirAng(real_t restitutionDirAng);
  82. void setDampingDirAng(real_t dampingDirAng);
  83. void setSoftnessLimLin(real_t softnessLimLin);
  84. void setRestitutionLimLin(real_t restitutionLimLin);
  85. void setDampingLimLin(real_t dampingLimLin);
  86. void setSoftnessLimAng(real_t softnessLimAng);
  87. void setRestitutionLimAng(real_t restitutionLimAng);
  88. void setDampingLimAng(real_t dampingLimAng);
  89. void setSoftnessOrthoLin(real_t softnessOrthoLin);
  90. void setRestitutionOrthoLin(real_t restitutionOrthoLin);
  91. void setDampingOrthoLin(real_t dampingOrthoLin);
  92. void setSoftnessOrthoAng(real_t softnessOrthoAng);
  93. void setRestitutionOrthoAng(real_t restitutionOrthoAng);
  94. void setDampingOrthoAng(real_t dampingOrthoAng);
  95. void setPoweredLinMotor(bool onOff);
  96. bool getPoweredLinMotor();
  97. void setTargetLinMotorVelocity(real_t targetLinMotorVelocity);
  98. real_t getTargetLinMotorVelocity();
  99. void setMaxLinMotorForce(real_t maxLinMotorForce);
  100. real_t getMaxLinMotorForce();
  101. void setPoweredAngMotor(bool onOff);
  102. bool getPoweredAngMotor();
  103. void setTargetAngMotorVelocity(real_t targetAngMotorVelocity);
  104. real_t getTargetAngMotorVelocity();
  105. void setMaxAngMotorForce(real_t maxAngMotorForce);
  106. real_t getMaxAngMotorForce();
  107. real_t getLinearPos();
  108. void set_param(PhysicsServer::SliderJointParam p_param, real_t p_value);
  109. real_t get_param(PhysicsServer::SliderJointParam p_param) const;
  110. };
  111. #endif