HingeJoint.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="HingeJoint" inherits="Joint" version="3.4">
  3. <brief_description>
  4. A hinge between two 3D PhysicsBodies.
  5. </brief_description>
  6. <description>
  7. A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. See also [Generic6DOFJoint].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_flag" qualifiers="const">
  13. <return type="bool">
  14. </return>
  15. <argument index="0" name="flag" type="int" enum="HingeJoint.Flag">
  16. </argument>
  17. <description>
  18. Returns the value of the specified flag.
  19. </description>
  20. </method>
  21. <method name="get_param" qualifiers="const">
  22. <return type="float">
  23. </return>
  24. <argument index="0" name="param" type="int" enum="HingeJoint.Param">
  25. </argument>
  26. <description>
  27. Returns the value of the specified parameter.
  28. </description>
  29. </method>
  30. <method name="set_flag">
  31. <return type="void">
  32. </return>
  33. <argument index="0" name="flag" type="int" enum="HingeJoint.Flag">
  34. </argument>
  35. <argument index="1" name="enabled" type="bool">
  36. </argument>
  37. <description>
  38. If [code]true[/code], enables the specified flag.
  39. </description>
  40. </method>
  41. <method name="set_param">
  42. <return type="void">
  43. </return>
  44. <argument index="0" name="param" type="int" enum="HingeJoint.Param">
  45. </argument>
  46. <argument index="1" name="value" type="float">
  47. </argument>
  48. <description>
  49. Sets the value of the specified parameter.
  50. </description>
  51. </method>
  52. </methods>
  53. <members>
  54. <member name="angular_limit/bias" type="float" setter="set_param" getter="get_param" default="0.3">
  55. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  56. </member>
  57. <member name="angular_limit/enable" type="bool" setter="set_flag" getter="get_flag" default="false">
  58. If [code]true[/code], the hinges maximum and minimum rotation, defined by [member angular_limit/lower] and [member angular_limit/upper] has effects.
  59. </member>
  60. <member name="angular_limit/lower" type="float" setter="_set_lower_limit" getter="_get_lower_limit" default="-90.0">
  61. The minimum rotation. Only active if [member angular_limit/enable] is [code]true[/code].
  62. </member>
  63. <member name="angular_limit/relaxation" type="float" setter="set_param" getter="get_param" default="1.0">
  64. The lower this value, the more the rotation gets slowed down.
  65. </member>
  66. <member name="angular_limit/softness" type="float" setter="set_param" getter="get_param" default="0.9">
  67. </member>
  68. <member name="angular_limit/upper" type="float" setter="_set_upper_limit" getter="_get_upper_limit" default="90.0">
  69. The maximum rotation. Only active if [member angular_limit/enable] is [code]true[/code].
  70. </member>
  71. <member name="motor/enable" type="bool" setter="set_flag" getter="get_flag" default="false">
  72. When activated, a motor turns the hinge.
  73. </member>
  74. <member name="motor/max_impulse" type="float" setter="set_param" getter="get_param" default="1.0">
  75. Maximum acceleration for the motor.
  76. </member>
  77. <member name="motor/target_velocity" type="float" setter="set_param" getter="get_param" default="1.0">
  78. Target speed for the motor.
  79. </member>
  80. <member name="params/bias" type="float" setter="set_param" getter="get_param" default="0.3">
  81. The speed with which the two bodies get pulled together when they move in different directions.
  82. </member>
  83. </members>
  84. <constants>
  85. <constant name="PARAM_BIAS" value="0" enum="Param">
  86. The speed with which the two bodies get pulled together when they move in different directions.
  87. </constant>
  88. <constant name="PARAM_LIMIT_UPPER" value="1" enum="Param">
  89. The maximum rotation. Only active if [member angular_limit/enable] is [code]true[/code].
  90. </constant>
  91. <constant name="PARAM_LIMIT_LOWER" value="2" enum="Param">
  92. The minimum rotation. Only active if [member angular_limit/enable] is [code]true[/code].
  93. </constant>
  94. <constant name="PARAM_LIMIT_BIAS" value="3" enum="Param">
  95. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  96. </constant>
  97. <constant name="PARAM_LIMIT_SOFTNESS" value="4" enum="Param">
  98. </constant>
  99. <constant name="PARAM_LIMIT_RELAXATION" value="5" enum="Param">
  100. The lower this value, the more the rotation gets slowed down.
  101. </constant>
  102. <constant name="PARAM_MOTOR_TARGET_VELOCITY" value="6" enum="Param">
  103. Target speed for the motor.
  104. </constant>
  105. <constant name="PARAM_MOTOR_MAX_IMPULSE" value="7" enum="Param">
  106. Maximum acceleration for the motor.
  107. </constant>
  108. <constant name="PARAM_MAX" value="8" enum="Param">
  109. Represents the size of the [enum Param] enum.
  110. </constant>
  111. <constant name="FLAG_USE_LIMIT" value="0" enum="Flag">
  112. If [code]true[/code], the hinges maximum and minimum rotation, defined by [member angular_limit/lower] and [member angular_limit/upper] has effects.
  113. </constant>
  114. <constant name="FLAG_ENABLE_MOTOR" value="1" enum="Flag">
  115. When activated, a motor turns the hinge.
  116. </constant>
  117. <constant name="FLAG_MAX" value="2" enum="Flag">
  118. Represents the size of the [enum Flag] enum.
  119. </constant>
  120. </constants>
  121. </class>