Function Ragdolize(mesh:TEntity) Global ppos:TVec3 ppos = EntityPosition(mesh,1) body:Tentity=FindChild(mesh,"Bip01") pelvis:Tentity=FindChild(mesh,"Bip01 Pelvis") spine:Tentity=FindChild(mesh,"Bip01 Spine") spine1:Tentity=FindChild(mesh,"Bip01 Spine1") spine2:Tentity=FindChild(mesh,"Bip01 Spine2") neck:Tentity=FindChild(mesh,"Bip01 Neck") head:Tentity=FindChild(mesh,"Bip01 Head") LClavicle:Tentity=FindChild(mesh,"Bip01 L Clavicle") LUpperArm:Tentity=FindChild(mesh,"Bip01 L UpperArm") LForearm:Tentity=FindChild(mesh,"Bip01 L Forearm") LHand:Tentity=FindChild(mesh,"Bip01 L Hand") RClavicle:Tentity=FindChild(mesh,"Bip01 R Clavicle") RUpperArm:Tentity=FindChild(mesh,"Bip01 R UpperArm") RForearm:Tentity=FindChild(mesh,"Bip01 R Forearm") RHand:Tentity=FindChild(mesh,"Bip01 R Hand") LThigh:Tentity=FindChild(mesh,"Bip01 L Thigh") LCalf:Tentity=FindChild(mesh,"Bip01 L Calf") LFoot:Tentity=FindChild(mesh,"Bip01 L Foot") LToe:Tentity=FindChild(mesh,"Bip01 L Toe0") RThigh:Tentity=FindChild(mesh,"Bip01 R Thigh") RCalf:Tentity=FindChild(mesh,"Bip01 R Calf") RFoot:Tentity=FindChild(mesh,"Bip01 R Foot") RToe:Tentity=FindChild(mesh,"Bip01 R Toe0") bodyp:tbody=createbodysphere(.35) positionentity bodyp,entityposition(body,1) setbodymass bodyp,1.0 entitytype bodyp,1 'rotateentity(bodyp, vec3(0,0,0)) 'positionentity(bodyp, vec3(0,0,0)) entityparent body,bodyp setbodymass bodyp,1 SetBodyElasticity bodyp,0 pelvisp:tbody=createbodysphere(.35) positionentity pelvisp,entityposition(pelvis,1) setbodymass pelvisp,1.0 entitytype pelvisp,1 'rotateentity(pelvisp, vec3(0,0,0)) 'positionentity(pelvisp, vec3(0,0,0)) entityparent pelvis,pelvisp setbodymass pelvisp,1 SetBodyElasticity pelvisp,0 spinep:tbody=createbodysphere(.35) positionentity spinep,entityposition(spine,1) setbodymass spinep,1.0 entitytype spinep,1 'rotateentity(spinep, vec3(0,0,0)) 'positionentity(spinep, vec3(0,0,0)) entityparent spine,spinep setbodymass spinep,1 SetBodyElasticity spinep,0 spinep1:tbody=createbodysphere(.35) positionentity spinep1,entityposition(spine1,1) setbodymass spinep1,1.0 entitytype spinep1,1 'rotateentity(spinep1, vec3(0,0,0)) 'positionentity(spinep1, vec3(0,0,0)) entityparent spine1,spinep1 setbodymass spinep1,1 SetBodyElasticity spinep1,0 spinep2:tbody=createbodysphere(.35) positionentity spinep2,entityposition(spine2,1) setbodymass spinep2,1.0 entitytype spinep2,1 'rotateentity(spinep2, vec3(0,0,0)) 'positionentity(spinep2, vec3(0,0,0)) entityparent spine2,spinep2 setbodymass spinep2,1 SetBodyElasticity spinep2,0 neckp:tbody=createbodysphere(.35) positionentity neckp,entityposition(neck,1) setbodymass neckp,1.0 entitytype neckp,1 'rotateentity(neckp, vec3(0,0,0)) 'positionentity(neckp, vec3(0,0,0)) entityparent neck,neckp setbodymass neckp,1 SetBodyElasticity neckp,0 headp:tbody=createbodysphere(.35) positionentity headp,entityposition(head,1) setbodymass headp,1.0 entitytype headp,1 'rotateentity(headp, vec3(0,0,0)) 'positionentity(headp, vec3(0,0,0)) entityparent head,headp setbodymass headp,1 SetBodyElasticity headp,0 ' LEFT HAND lclaviclep:tbody=createbodysphere(.35) positionentity lclaviclep,entityposition(lclavicle,1) setbodymass lclaviclep,1.0 entitytype lclaviclep,1 'rotateentity(lclaviclep, vec3(0,0,0)) 'positionentity(lclaviclep, vec3(0,0,0)) entityparent lclavicle,lclaviclep setbodymass lclaviclep,1 SetBodyElasticity lclaviclep,0 lupperarmp:tbody=createbodysphere(.35) positionentity lupperarmp,entityposition(lupperarm,1) setbodymass lupperarmp,1.0 entitytype lupperarmp,1 'rotateentity(lupperarmp, vec3(0,0,0)) 'positionentity(lupperarmp, vec3(0,0,0)) entityparent lupperarm,lupperarmp setbodymass lupperarmp,1 SetBodyElasticity lupperarmp,0 lforearmp:tbody=createbodysphere(.35) positionentity lforearmp,entityposition(lforearm,1) setbodymass lforearmp,1.0 entitytype lforearmp,1 'rotateentity(lforearmp, vec3(0,0,0)) 'positionentity(lforearmp, vec3(0,0,0)) entityparent lforearm,lforearmp setbodymass lforearmp,1 SetBodyElasticity lforearmp,0 lhandp:tbody=createbodysphere(.35) positionentity lhandp,entityposition(lhand,1) setbodymass lhandp,1.0 entitytype lhandp,1 'rotateentity(lhandp, vec3(0,0,0)) 'positionentity(lhandp, vec3(0,0,0)) entityparent lhand,lhandp setbodymass lhandp,1 SetBodyElasticity lhandp,0 ' RIGHT HAND rclaviclep:tbody=createbodysphere(.35) positionentity rclaviclep,entityposition(rclavicle,1) setbodymass rclaviclep,1.0 entitytype rclaviclep,1 'rotateentity(rclaviclep, vec3(0,0,0)) 'positionentity(rclaviclep, vec3(0,0,0)) entityparent rclavicle,rclaviclep setbodymass rclaviclep,1 SetBodyElasticity rclaviclep,0 rupperarmp:tbody=createbodysphere(.35) positionentity rupperarmp,entityposition(rupperarm,1) setbodymass rupperarmp,1.0 entitytype rupperarmp,1 'rotateentity(rupperarmp, vec3(0,0,0)) 'positionentity(rupperarmp, vec3(0,0,0)) entityparent rupperarm,rupperarmp setbodymass rupperarmp,1 SetBodyElasticity rupperarmp,0 rforearmp:tbody=createbodysphere(.35) positionentity rforearmp,entityposition(rforearm,1) setbodymass rforearmp,1.0 entitytype rforearmp,1 'rotateentity(rforearmp, vec3(0,0,0)) 'positionentity(rforearmp, vec3(0,0,0)) entityparent rforearm,rforearmp setbodymass rforearmp,1 SetBodyElasticity rforearmp,0 rhandp:tbody=createbodysphere(.35) positionentity rhandp,entityposition(rhand,1) setbodymass rhandp,1.0 entitytype rhandp,1 'rotateentity(rhandp, vec3(0,0,0)) 'positionentity(rhandp, vec3(0,0,0)) entityparent rhand,rhandp setbodymass rhandp,1 SetBodyElasticity rhandp,0 ' LEFT LEG LThighp:tbody=createbodysphere(.35) positionentity LThighp,entityposition(LThigh,1) setbodymass LThighp,1.0 entitytype LThighp,1 'rotateentity(LThighp, vec3(0,0,0)) 'positionentity(LThighp, vec3(0,0,0)) entityparent LThigh,LThighp setbodymass LThighp,1 SetBodyElasticity LThighp,0 LCalfp:tbody=createbodysphere(.35) positionentity LCalfp,entityposition(LCalf,1) setbodymass LCalfp,1.0 entitytype LCalfp,1 'rotateentity(LCalfp, vec3(0,0,0)) 'positionentity(LCalfp, vec3(0,0,0)) entityparent LCalf,LCalfp setbodymass LCalfp,1 SetBodyElasticity LCalfp,0 Lfootp:tbody=createbodysphere(.35) positionentity LCalfp,entityposition(Lfoot,1) setbodymass Lfootp,1.0 entitytype Lfootp,1 'rotateentity(Lfootp, vec3(0,0,0)) 'positionentity(Lfootp, vec3(0,0,0)) entityparent Lfoot,Lfootp setbodymass Lfootp,1 SetBodyElasticity Lfootp,0 Ltoep:tbody=createbodysphere(.35) positionentity LCalfp,entityposition(Ltoe,1) setbodymass Ltoep,1.0 entitytype Ltoep,1 'rotateentity(Ltoep, vec3(0,0,0)) 'positionentity(Ltoep, vec3(0,0,0)) entityparent Ltoe,Ltoep setbodymass Ltoep,1 SetBodyElasticity Ltoep,0 ' RIGHT LEG RThighp:tbody=createbodysphere(.35) positionentity RThighp,entityposition(RThigh,1) setbodymass RThighp,1.0 entitytype RThighp,1 'rotateentity(RThighp, vec3(0,0,0)) 'positionentity(RThighp, vec3(0,0,0)) entityparent RThigh,RThighp setbodymass RThighp,1 SetBodyElasticity RThighp,0 RCalfp:tbody=createbodysphere(.35) positionentity RCalfp,entityposition(RCalf,1) setbodymass RCalfp,1.0 entitytype RCalfp,1 'rotateentity(RCalfp, vec3(0,0,0)) 'positionentity(RCalfp, vec3(0,0,0)) entityparent RCalf,RCalfp setbodymass RCalfp,1 SetBodyElasticity RCalfp,0 Rfootp:tbody=createbodysphere(.35) positionentity RCalfp,entityposition(Rfoot,1) setbodymass Rfootp,1.0 entitytype Rfootp,1 'rotateentity(Rfootp, vec3(0,0,0)) 'positionentity(Rfootp, vec3(0,0,0)) entityparent Rfoot,Rfootp setbodymass Rfootp,1 SetBodyElasticity Rfootp,0 Rtoep:tbody=createbodysphere(.35) positionentity RCalfp,entityposition(Rtoe,1) setbodymass Rtoep,1.0 entitytype Rtoep,1 'rotateentity(Rtoep, vec3(0,0,0)) 'positionentity(Rtoep, vec3(0,0,0)) entityparent Rtoe,Rtoep setbodymass Rtoep,1 SetBodyElasticity Rtoep,0 'CreateJointHinge( bodyp, pelvisp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( pelvisp, spinep, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( pelvisp, spinep, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( spinep, spinep1, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( spinep1, spinep2, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) 'Head CreateJointHinge( spinep2, neckp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( neckp, headp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) 'Left hand CreateJointHinge( neckp, lclaviclep, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( lclaviclep, lupperarmp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( lupperarmp, lforearmp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( lforearmp, lhandp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) 'Right hand CreateJointHinge( neckp, rclaviclep, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( rclaviclep, rupperarmp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( rupperarmp, rforearmp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( rforearmp, rhandp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) 'Left leg CreateJointHinge( spinep, Lthighp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( LThighp, LCalfp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( LCalfp, LFootp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( LFootp, LToep, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) 'Right leg CreateJointHinge( spinep, Rthighp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( RThighp, RCalfp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( RCalfp, RFootp, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) CreateJointHinge( RFootp, RToep, vec3(ppos.x,ppos.y,ppos.z), vec3(0,0,0 )) EndFunction