Skip to content

Latest commit

 

History

History
303 lines (196 loc) · 11.5 KB

class_hingejoint.rst

File metadata and controls

303 lines (196 loc) · 11.5 KB
github_url:hide

HingeJoint

Inherits: :ref:`Joint<class_Joint>` < :ref:`Spatial<class_Spatial>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

A hinge between two 3D bodies.

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.

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 Param:


enum Flag:

Property Descriptions

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.


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.


Default -90.0

The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is true.


Default 1.0
Setter set_param(value)
Getter get_param()

The lower this value, the more the rotation gets slowed down.


Default 0.9
Setter set_param(value)
Getter get_param()

Default 90.0

The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is true.


Default false
Setter set_flag(value)
Getter get_flag()

When activated, a motor turns the hinge.


Default 1.0
Setter set_param(value)
Getter get_param()

Maximum acceleration for the motor.


Default 1.0
Setter set_param(value)
Getter get_param()

Target speed for the motor.


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

Returns the value of the specified flag.


Returns the value of the specified parameter.


If true, enables the specified flag.


Sets the value of the specified parameter.