HingeJoint()

语法

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

参数

#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 The X coordinate of the pivot point for the joint. Relative to the center of the entity.
PivotY The Y coordinate of the pivot point for the joint. Relative to the center of the entity.
PivotZ The Z coordinate of the pivot point for the joint. Relative to the center of the entity.
AxisX The X orientation of the axis for the joint.
AxisY The Y orientation of the axis for the joint.
AxisZ The Z 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 The X coordinate of the second pivot point for the joint. Relative to the center of the second entity.
PivotY2 The Y coordinate of the second pivot point for the joint. Relative to the center of the second entity.
PivotZ2 The Z coordinate of the second pivot point for the joint. Relative to the center of the second entity.
AxisX2 The X orientation of the axis for the joint.
AxisY2 The Y orientation of the axis for the joint.
AxisZ2 The Z orientation of the axis for the joint.

返回值

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

参阅

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

已支持操作系统

所有

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