HingeJoint

    A hinge between two 3D PhysicsBodies.

    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 .

    Properties

    bool ( Flag flag ) const
    get_param ( param ) const
    voidset_flag ( flag, bool enabled )
    void ( Param param, value )

    Enumerations

    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 angular_limit/enable is true.
    • PARAM_LIMIT_LOWER = 2 —- The minimum rotation. Only active if is true.
    • PARAM_LIMIT_BIAS = 3 —- The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
    • 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 Param enum.

    enum Flag:

    • FLAG_USE_LIMIT = 0 —- If true, the hinges maximum and minimum rotation, defined by and angular_limit/upper has effects.
    • FLAG_ENABLE_MOTOR = 1 —- When activated, a motor turns the hinge.
    • FLAG_MAX = 2 —- Represents the size of the enum.
    • float angular_limit/bias
    Default0.3
    Setterset_param(value)
    Getterget_param()

    The speed with which the rotation across the axis perpendicular to the hinge gets corrected.


    • angular_limit/enable
    Defaultfalse
    Setterset_flag(value)
    Getterget_flag()

    • float angular_limit/lower

    The minimum rotation. Only active if is true.


    Default
    Setterset_param(value)
    Getterget_param()

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


    • float angular_limit/softness
    Default0.9
    Setterset_param(value)
    Getterget_param()

    • angular_limit/upper
    Default90.0

    The maximum rotation. Only active if angular_limit/enable is true.


    • motor/enable

    When activated, a motor turns the hinge.


    Default1.0
    Setterset_param(value)
    Getterget_param()

    Maximum acceleration for the motor.


    • motor/target_velocity
    Default1.0
    Setterset_param(value)
    Getterget_param()

    Default0.3
    Setterset_param(value)
    Getterget_param()

    The speed with which the two bodies get pulled together when they move in different directions.

    Method Descriptions

    • get_flag ( Flag flag ) const

    Returns the value of the specified flag.


    • get_param ( Param param ) const

    Returns the value of the specified parameter.


    • void set_flag ( flag, bool enabled )

    If true, enables the specified flag.


    • void set_param ( param, float value )

    Sets the value of the specified parameter.