Interface to a physics joint.
A joint is a physical coupling between two actors or between an actor and the world.
For more background information about the concepts involved in physics joints, see also the PhysX documentation.
Constructors and accessors
Other related reference items
Related help topics
d6_drive ( self, drive ) : number, number, number, booleanReturns the drive parameters for the specified D6 joint drive.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
drive : | The degree of freedom for which the drive parameters should be retrieved. Is one of the D6Drive enum values: X, Y, Z, TWIST, SWING or SLERP. |
number |
The drive stiffness. |
number |
The drive damping. |
number |
The drive force limit. |
boolean |
Specify if the drive is an acceleration or a force/torque. |
d6_drive_position ( self ) : stingray.Quaternion, stingray.Vector3Returns the positional driving targets.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The orientation the drive is currently targeting for the second actor's frame, defined relative to the first actor's frame. | |
The position the drive is currently targeting for the center of the second actor's frame, defined relative to the first actor's frame. |
d6_drive_velocity ( self ) : stingray.Vector3, stingray.Vector3Returns the linear & angular driving velocity targets.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
The drive target linear velocity. | |
The drive target angular velocity. |
d6_linear_limit_config ( self ) : table? |
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
table? |
Returns the linear limit for this D6 joint. D6 joints linear limits are configured with lower and upper limit values in meters. Like all other joint types, this table may also have the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
d6_motion ( self, d6axis ) : stingray.Joint.D6MotionReturns the motion type of the specified degree of freedom for this joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
d6axis : | The D6Axis (degree of freedom) for which the motion flag should be retrieved. |
The D6Motion mode currently set for the specified DoF. |
Other related reference items
d6_swing_limit_config ( self ) : table? |
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
table? |
Returns the swing limit parameter for this D6 joint. D6 joints swing limits are configured with yAngle and zAngle limit values in radians. Like all other joint types, this table may also have the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
d6_swing_y_angle ( self ) : numberReturns the current D6 Joint Y swing value.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current D6 joint Y swing value, in radians. |
d6_swing_z_angle ( self ) : numberReturns the current D6 Joint Z swing value.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current D6 joint Z swing value, in radians. |
d6_twist ( self ) : numberReturns the current D6 Joint twist value.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current D6 joint twist value, in radians. |
d6_twist_limit_config ( self ) : table? |
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
table? |
Returns the twist limit parameters for this D6 joint. D6 joints twist limits are configured with lower and upper limit values in radians. Like all other joint types, this table may also have the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
distance_distance ( self ) : numberReturns the current Joint distance.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current joint distance, in meters. |
distance_joint_flags ( self ) : numberReturns the currently raised motion flags for this Distance joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The combination of DistanceFlag enum values that are currently raised. |
distance_joint_flag_enabled ( self, flag ) : booleanReturns the specified motion flag activation status for this Distance joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
flag : | One of the DistanceFlag enum values: MAX_DISTANCE_ENABLED, MIN_DISTANCE_ENABLED or SPRING_ENABLED. |
boolean |
The current status of the specified flag for this joint. |
limit_config ( self ) : table?Gets the joint limit configuration.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
table? |
Returns the limit parameters for the joint. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Can be used for all joint types except D6 -- for D6 joints, use the d6_xxx_limit_config(...) functions.
The parameters in the returned table depend on the Joint type. See setup_limit() for details.
limit_enabled ( self ) : booleanReturns whether or not the limit is enabled for this joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
boolean |
The current limit activation status for this joint. |
Suitable only for SPHERICAL, REVOLUTE & PRISMATIC joints. For D6 joints use d6_motion(), and for DISTANCE joints use [distance_joint_flag()].
prismatic_position ( self ) : numberReturns the current PRISMATIC Joint distance along the X axis of the first actor's frame.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current PRISMATIC Joint distance along the X axis, in meters. |
prismatic_velocity ( self ) : numberReturns the current PRISMATIC Joint velocity along the X axis of the first actor's frame.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current PRISMATIC Joint velocity along the X axis, in meters per second. |
revolute_angle ( self ) : numberReturns the current REVOLUTE Joint angle value.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current REVOLUTE Joint angle value, in radians. |
revolute_drive_force_limit ( self ) : numberReturns the drive force limit for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The drive force limit for this revolute joint. |
revolute_drive_gear_ratio ( self ) : numberReturns the current drive gear ratio for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current drive gear ratio for this revolute joint. |
revolute_drive_velocity ( self ) : numberReturns the drive velocity target for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The target velocity currently set for the drive on this revolute joint. |
revolute_joint_flags ( self ) : numberReturns the currently raised motion flags for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The combination of RevoluteFlag enum values which are currently raised. |
revolute_joint_flag_enabled ( self, flag ) : booleanReturns the specified motion flag activation status for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
flag : | One of the RevoluteFlag enum values: LIMIT_ENABLED, DRIVE_ENABLED or DRIVE_FREESPIN. |
boolean |
The current status of the specified flag for this joint. |
revolute_velocity ( self ) : numberReturns the current REVOLUTE Joint angular velocity value.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. |
number |
The current REVOLUTE Joint angular velocity value, in radians per second. |
setup_d6_linear_limit ( self, parameters )Sets the linear limit for this D6 joint, but doesn't activate it.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
parameters : | table | A (key, value) lua table defining the limit parameters. |
This function does not return any values. |
D6 joints linear limits are configured with lower and upper limit values in meters. Like all other joint types, you can also set up the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance.
setup_d6_swing_limit ( self, parameters )Sets the swing limit parameter for this D6 joint, but doesn't activate it.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
parameters : | table | A (key, value) lua table defining the limit parameters. |
This function does not return any values. |
D6 joints swing limits are configured with yAngle and zAngle limit values in radians. Like all other joint types, you can also set up the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance.
setup_d6_twist_limit ( self, parameters )Sets the twist limit parameters for this D6 joint, but doesn't activate it.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
parameters : | table | A (key, value) lua table defining the limit parameters. |
This function does not return any values. |
D6 joints twist limits are configured with lower and upper limit values in radians. Like all other joint types, you can also set up the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance.
setup_limit ( self, parameters )Sets the limits for the joint, but doesn't activate them.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
parameters : | table | A (key, value) lua table defining the limit parameters. |
This function does not return any values. |
This function is suitable for all joint types except D6 -- set up D6 joints using the set_d6_xxx_limit(...) functions.
The parameter set depends on the Joint type you are configuring.
All joint types also support the following shared parameters: restitution, bounceThreshold, stiffness, damping and contactDistance.
Other related reference items
set_break_force ( self, force, torque )Sets the force and torque required to break a joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
force : | number | Force required to break the joint. |
torque : | number | Torque required to break the joint. |
This function does not return any values. |
set_d6_drive ( self, drive, stiffness, damping, force_limit, is_acceleration )Setup the drive parameters for the given drive.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
drive : | The degree of freedom on which the drive should be configured. Is one of the D6Drive enum values: X, Y, Z, TWIST, SWING or SLERP. | |
stiffness : | number | The drive stiffness. |
damping : | number | The drive damping. |
force_limit : | number | The drive force limit. |
is_acceleration : | boolean? | Optional. Specify if the drive is an acceleration or a force/torque. Default is false, i.e. using force/torque. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
This function does not return any values. |
set_d6_drive_position ( self, q, p )Sets the positional driving target.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
q : | The orientation to be targeted by the drives for the second actor's frame, defined relative to the first actor's frame. | |
p : | The position to be targeted by the drives for the center of the second actor's frame, defined relative to the first actor's frame. |
This function does not return any values. |
set_d6_drive_velocity ( self, linear, angular )Sets the velocity driving targets.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
linear : | The linear velocity target for drives. | |
angular : | The angular velocity target for drives. |
This function does not return any values. |
set_d6_motion ( self, d6axis, motion )Sets the motion type to the specified degree of freedom.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
d6axis : | The D6Axis (degree of freedom) on which the motion flag should be set. | |
motion : | The D6Motion mode to apply on the specified DoF. |
This function does not return any values. |
Other related reference items
set_distance_joint_flags ( self, flags )Sets the motion flags for this Distance joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
flags : | number | Any combination of DistanceFlag enum values: MAX_DISTANCE_ENABLED, IN_DISTANCE_ENABLED and SPRING_ENABLED. |
This function does not return any values. |
set_distance_joint_flag_enabled ( self, flag, do_enable )Setups the specified motion flag activation status for this Distance joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
flag : | One of the DistanceFlag enum values: MAX_DISTANCE_ENABLED, MIN_DISTANCE_ENABLED or SPRING_ENABLED. | |
do_enable : | boolean | true to raise the flag, false to turn it down. |
This function does not return any values. |
set_limit_enabled ( self, do_enable )Determines whether or not the limit should be enabled for this joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
do_enable : | boolean | Use true to enable the limit for this Joint, or false to disable it. |
This function does not return any values. |
Suitable only for SPHERICAL, REVOLUTE & PRISMATIC joints. For D6 joints use set_d6_motion(), and for DISTANCE joints use [set_distance_joint_flag()].
set_revolute_drive_force_limit ( self, limit )Sets the drive force limit for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
limit : | number | The drive force limit for this revolute joint. |
This function does not return any values. |
set_revolute_drive_gear_ratio ( self, ratio )Sets the drive gear ratio for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
ratio : | number | The drive gear ratio for this revolute joint. |
This function does not return any values. |
set_revolute_drive_velocity ( self, velocity )Sets the drive velocity target for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
velocity : | number | The drive velocity target for this revolute joint. |
This function does not return any values. |
set_revolute_joint_flags ( self, flags )Sets the specified motion flags for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
flags : | number | Any combination of RevoluteFlag enum values: LIMIT_ENABLED, DRIVE_ENABLED and DRIVE_FREESPIN. |
This function does not return any values. |
set_revolute_joint_flag_enabled ( self, flag, do_enable )Setups the specified motion flag activation status for this REVOLUTE joint.
|
self : | Specifies the object instance that this function will act on. You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation. | |
flag : | The flag to be raised or turn off. Must be one of the RevoluteFlag enum values: LIMIT_ENABLED, DRIVE_ENABLED or DRIVE_FREESPIN. | |
do_enable : | boolean | true to raise the flag, false to turn it down. |
This function does not return any values. |