mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-01-21 15:07:22 +01:00
307 lines
12 KiB
ReStructuredText
307 lines
12 KiB
ReStructuredText
|
:github_url: hide
|
||
|
|
||
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||
|
.. DO NOT EDIT THIS FILE, but the HingeJoint.xml source instead.
|
||
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||
|
|
||
|
.. _class_HingeJoint:
|
||
|
|
||
|
HingeJoint
|
||
|
==========
|
||
|
|
||
|
**Inherits:** :ref:`Joint<class_Joint>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
|
||
|
A hinge between two 3D PhysicsBodies.
|
||
|
|
||
|
Description
|
||
|
-----------
|
||
|
|
||
|
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 :ref:`Generic6DOFJoint<class_Generic6DOFJoint>`.
|
||
|
|
||
|
Properties
|
||
|
----------
|
||
|
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`angular_limit/bias<class_HingeJoint_property_angular_limit/bias>` | ``0.3`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` | ``false`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` | ``-90.0`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`angular_limit/relaxation<class_HingeJoint_property_angular_limit/relaxation>` | ``1.0`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`angular_limit/softness<class_HingeJoint_property_angular_limit/softness>` | ``0.9`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` | ``90.0`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`motor/enable<class_HingeJoint_property_motor/enable>` | ``false`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`motor/max_impulse<class_HingeJoint_property_motor/max_impulse>` | ``1.0`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`motor/target_velocity<class_HingeJoint_property_motor/target_velocity>` | ``1.0`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
| :ref:`float<class_float>` | :ref:`params/bias<class_HingeJoint_property_params/bias>` | ``0.3`` |
|
||
|
+---------------------------+-------------------------------------------------------------------------------------+-----------+
|
||
|
|
||
|
Methods
|
||
|
-------
|
||
|
|
||
|
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`get_flag<class_HingeJoint_method_get_flag>` **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** |const| |
|
||
|
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`float<class_float>` | :ref:`get_param<class_HingeJoint_method_get_param>` **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const| |
|
||
|
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_flag<class_HingeJoint_method_set_flag>` **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)** |
|
||
|
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`set_param<class_HingeJoint_method_set_param>` **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)** |
|
||
|
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
|
||
|
Enumerations
|
||
|
------------
|
||
|
|
||
|
.. _enum_HingeJoint_Param:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_BIAS:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_LIMIT_UPPER:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_LIMIT_LOWER:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_LIMIT_BIAS:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_LIMIT_SOFTNESS:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_LIMIT_RELAXATION:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_MOTOR_TARGET_VELOCITY:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_MOTOR_MAX_IMPULSE:
|
||
|
|
||
|
.. _class_HingeJoint_constant_PARAM_MAX:
|
||
|
|
||
|
enum **Param**:
|
||
|
|
||
|
- **PARAM_BIAS** = **0** --- The speed with which the two bodies get pulled together when they move in different directions.
|
||
|
|
||
|
- **PARAM_LIMIT_UPPER** = **1** --- The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
|
||
|
|
||
|
- **PARAM_LIMIT_LOWER** = **2** --- The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
|
||
|
|
||
|
- **PARAM_LIMIT_BIAS** = **3** --- The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
|
||
|
|
||
|
- **PARAM_LIMIT_SOFTNESS** = **4**
|
||
|
|
||
|
- **PARAM_LIMIT_RELAXATION** = **5** --- The lower this value, the more the rotation gets slowed down.
|
||
|
|
||
|
- **PARAM_MOTOR_TARGET_VELOCITY** = **6** --- Target speed for the motor.
|
||
|
|
||
|
- **PARAM_MOTOR_MAX_IMPULSE** = **7** --- Maximum acceleration for the motor.
|
||
|
|
||
|
- **PARAM_MAX** = **8** --- Represents the size of the :ref:`Param<enum_HingeJoint_Param>` enum.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _enum_HingeJoint_Flag:
|
||
|
|
||
|
.. _class_HingeJoint_constant_FLAG_USE_LIMIT:
|
||
|
|
||
|
.. _class_HingeJoint_constant_FLAG_ENABLE_MOTOR:
|
||
|
|
||
|
.. _class_HingeJoint_constant_FLAG_MAX:
|
||
|
|
||
|
enum **Flag**:
|
||
|
|
||
|
- **FLAG_USE_LIMIT** = **0** --- If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` has effects.
|
||
|
|
||
|
- **FLAG_ENABLE_MOTOR** = **1** --- When activated, a motor turns the hinge.
|
||
|
|
||
|
- **FLAG_MAX** = **2** --- Represents the size of the :ref:`Flag<enum_HingeJoint_Flag>` enum.
|
||
|
|
||
|
Property Descriptions
|
||
|
---------------------
|
||
|
|
||
|
.. _class_HingeJoint_property_angular_limit/bias:
|
||
|
|
||
|
- :ref:`float<class_float>` **angular_limit/bias**
|
||
|
|
||
|
+-----------+------------------+
|
||
|
| *Default* | ``0.3`` |
|
||
|
+-----------+------------------+
|
||
|
| *Setter* | set_param(value) |
|
||
|
+-----------+------------------+
|
||
|
| *Getter* | get_param() |
|
||
|
+-----------+------------------+
|
||
|
|
||
|
The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_angular_limit/enable:
|
||
|
|
||
|
- :ref:`bool<class_bool>` **angular_limit/enable**
|
||
|
|
||
|
+-----------+-----------------+
|
||
|
| *Default* | ``false`` |
|
||
|
+-----------+-----------------+
|
||
|
| *Setter* | set_flag(value) |
|
||
|
+-----------+-----------------+
|
||
|
| *Getter* | get_flag() |
|
||
|
+-----------+-----------------+
|
||
|
|
||
|
If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` has effects.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_angular_limit/lower:
|
||
|
|
||
|
- :ref:`float<class_float>` **angular_limit/lower**
|
||
|
|
||
|
+-----------+-----------+
|
||
|
| *Default* | ``-90.0`` |
|
||
|
+-----------+-----------+
|
||
|
|
||
|
The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_angular_limit/relaxation:
|
||
|
|
||
|
- :ref:`float<class_float>` **angular_limit/relaxation**
|
||
|
|
||
|
+-----------+------------------+
|
||
|
| *Default* | ``1.0`` |
|
||
|
+-----------+------------------+
|
||
|
| *Setter* | set_param(value) |
|
||
|
+-----------+------------------+
|
||
|
| *Getter* | get_param() |
|
||
|
+-----------+------------------+
|
||
|
|
||
|
The lower this value, the more the rotation gets slowed down.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_angular_limit/softness:
|
||
|
|
||
|
- :ref:`float<class_float>` **angular_limit/softness**
|
||
|
|
||
|
+-----------+------------------+
|
||
|
| *Default* | ``0.9`` |
|
||
|
+-----------+------------------+
|
||
|
| *Setter* | set_param(value) |
|
||
|
+-----------+------------------+
|
||
|
| *Getter* | get_param() |
|
||
|
+-----------+------------------+
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_angular_limit/upper:
|
||
|
|
||
|
- :ref:`float<class_float>` **angular_limit/upper**
|
||
|
|
||
|
+-----------+----------+
|
||
|
| *Default* | ``90.0`` |
|
||
|
+-----------+----------+
|
||
|
|
||
|
The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_motor/enable:
|
||
|
|
||
|
- :ref:`bool<class_bool>` **motor/enable**
|
||
|
|
||
|
+-----------+-----------------+
|
||
|
| *Default* | ``false`` |
|
||
|
+-----------+-----------------+
|
||
|
| *Setter* | set_flag(value) |
|
||
|
+-----------+-----------------+
|
||
|
| *Getter* | get_flag() |
|
||
|
+-----------+-----------------+
|
||
|
|
||
|
When activated, a motor turns the hinge.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_motor/max_impulse:
|
||
|
|
||
|
- :ref:`float<class_float>` **motor/max_impulse**
|
||
|
|
||
|
+-----------+------------------+
|
||
|
| *Default* | ``1.0`` |
|
||
|
+-----------+------------------+
|
||
|
| *Setter* | set_param(value) |
|
||
|
+-----------+------------------+
|
||
|
| *Getter* | get_param() |
|
||
|
+-----------+------------------+
|
||
|
|
||
|
Maximum acceleration for the motor.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_motor/target_velocity:
|
||
|
|
||
|
- :ref:`float<class_float>` **motor/target_velocity**
|
||
|
|
||
|
+-----------+------------------+
|
||
|
| *Default* | ``1.0`` |
|
||
|
+-----------+------------------+
|
||
|
| *Setter* | set_param(value) |
|
||
|
+-----------+------------------+
|
||
|
| *Getter* | get_param() |
|
||
|
+-----------+------------------+
|
||
|
|
||
|
Target speed for the motor.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_property_params/bias:
|
||
|
|
||
|
- :ref:`float<class_float>` **params/bias**
|
||
|
|
||
|
+-----------+------------------+
|
||
|
| *Default* | ``0.3`` |
|
||
|
+-----------+------------------+
|
||
|
| *Setter* | set_param(value) |
|
||
|
+-----------+------------------+
|
||
|
| *Getter* | get_param() |
|
||
|
+-----------+------------------+
|
||
|
|
||
|
The speed with which the two bodies get pulled together when they move in different directions.
|
||
|
|
||
|
Method Descriptions
|
||
|
-------------------
|
||
|
|
||
|
.. _class_HingeJoint_method_get_flag:
|
||
|
|
||
|
- :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** |const|
|
||
|
|
||
|
Returns the value of the specified flag.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_method_get_param:
|
||
|
|
||
|
- :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
|
||
|
|
||
|
Returns the value of the specified parameter.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_method_set_flag:
|
||
|
|
||
|
- void **set_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
|
||
|
|
||
|
If ``true``, enables the specified flag.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_HingeJoint_method_set_param:
|
||
|
|
||
|
- void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
|
||
|
|
||
|
Sets the value of the specified parameter.
|
||
|
|
||
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
||
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
||
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|