Class reference

ConeTwistJoint3D

Inherits Joint3D

A physics joint that connects two 3D physics bodies in a way that simulates a ball-and-socket joint.

Description

A physics joint that connects two 3D physics bodies in a way that simulates a ball-and-socket joint. The twist axis is initiated as the X axis of the ConeTwistJoint3D. Once the physics bodies swing, the twist axis is calculated as the middle of the X axes of the joint in the local space of the two physics bodies. Useful for limbs like shoulders and hips, lamps hanging off a ceiling, etc.

Properties

float bias = 0.3

The speed with which the swing or twist will take place. The higher, the faster.

float relaxation = 1.0

Defines, how fast the swing- and twist-speed-difference on both sides gets synced.

float softness = 0.8

The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint.

float swing_span = 0.7853982

Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected along the swing axis. Could be defined as looseness in the ConeTwistJoint3D. If below 0.05, this behavior is locked.

float twist_span = 3.1415927

Twist is the rotation around the twist axis, this value defined how far the joint can twist. Twist is locked if below 0.05.

Methods

float get_param(int param) const

Returns the value of the specified parameter.

void set_param(int param, float value)

Sets the value of the specified parameter.

Constants

PARAM_SWING_SPAN = 0

Enum: Param

Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected along the swing axis. Could be defined as looseness in the ConeTwistJoint3D. If below 0.05, this behavior is locked.

PARAM_TWIST_SPAN = 1

Enum: Param

Twist is the rotation around the twist axis, this value defined how far the joint can twist. Twist is locked if below 0.05.

PARAM_BIAS = 2

Enum: Param

The speed with which the swing or twist will take place. The higher, the faster.

PARAM_SOFTNESS = 3

Enum: Param

The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint.

PARAM_RELAXATION = 4

Enum: Param

Defines, how fast the swing- and twist-speed-difference on both sides gets synced.

PARAM_MAX = 5

Enum: Param

Represents the size of the Param enum.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.