HingeJoint()

Syntax

Result = HingeJoint(#Joint, EntityID, PivotX, PivotY, PivotZ, AxisX, AxisY, AxisZ, EntityID2, PivotX2, PivotY2, PivotZ2, AxisX2, AxisY2, AxisZ2)
Description
Creates a new hinge joint between the two given entities. Hinge can be used to simulate door, moving bridge etc.

Parameters

#Joint The number to identify the new joint. #PB_Any can be used to auto-generate this number.
EntityID The first entity id associated to the joint. To get a valid entity id, use EntityID().
PivotX, PivotY, PivotZ The coordinates of the first pivot point for the joint. Relative to the center of the first entity.
AxisX, AxisY, AxisZ The orientation of the axis for the joint.
EntityID2 The second entity id associated to the joint. To get a valid entity id, use EntityID().
PivotX2, PivotY2, PivotZ2 The coordinates of the second pivot point for the joint. Relative to the center of the second entity.
AxisX2, AxisY2, AxisZ2 The orientation of the axis for the joint.

Return value

Returns zero if the joint can't be created. If #PB_Any is used as '#Joint' parameter, the new joint number will be returned as 'Result'.

Remarks

GetJointAttribute() and SetJointAttribute() can be used with the following attribute to change the joint behavior:
  #PB_HingeJoint_LowerLimit : Lower limit of the joint
  #PB_HingeJoint_UpperLimit : Upper limit of the joint

See Also

FreeJoint(), GetJointAttribute(), SetJointAttribute(), EnableHingeJointAngularMotor()

Supported OS

All

<- GetJointAttribute() - Joint Index - HingeJointMotorTarget() ->