HingeJoint.xml 5.1 KB

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