Attaches a PhysX child element. Using this command creates a default createJointExt - SphereJoint joint between the two vehicles, passed to the command. It also creates a logical coupling between them, which, for example, is useful for brakes on trailers.
V2.12+: Once a child object is attached, its locality is switched to that of the parent. In earlier versions, this locality change did not happen, and could cause errors (which could be circumvented by invoking the setTowParent first).
|Syntax:||parent attachChild child|
|Syntax:||[parent, child] attachChild jointParameters (V1.44+)|
truck attachChild trailer
Connection between truck and trailer with motorized and limited joint:
jointType = "6DOFJoint"; fromPose = ; toPose = ; misc = ; dofs = [2,1,1,0,0,0]; swing1Limit = [0,1]; swing2Limit = [0,1]; limits = [ ,,swing1Limit,swing2Limit]; twistDrive = [0,1000,0.01]; drives = [twistDrive]; jointDesc = [limits,drives,dofs]; MyJoint = [TRUCK,TRAILER] attachChild [jointType,fromPose,toPose,misc,jointDesc];
|See also:||detachChild, childAttached, parentAttached, createJointExt|