ragdoll_clear 0

// p0 = point 0
// p1 = point 1
// cog = center of gravity
// rb = rigid body

// Where an argument lists <axis> it means a literal x, y, z, -x, -y, or -z

// Bones
// Format is:
// ragdoll_bone <def> <joint name (p0)> <child name (p1)> <radius> <cog lerp> <mass>
//     <friction> <parent bone> <mirror> <geom type>

ragdoll_bone 0 j_mainroot    j_neck      5.0  0.5  3.0  0.3  -1   0   capsule
ragdoll_bone 0 j_neck        j_head      3.5  0.5  0.3  0.3   0   0   capsule

ragdoll_bone 0 j_shoulder_le j_elbow_le  2.5  0.5  0.6  0.3   0   0   capsule
ragdoll_bone 0 j_elbow_le    j_wrist_le  2.5  0.5  0.45 0.3   2   0   capsule

ragdoll_bone 0 j_shoulder_ri j_elbow_ri  2.5  0.5  0.6  0.3   0   1   capsule
ragdoll_bone 0 j_elbow_ri    j_wrist_ri  2.5  0.5  0.45 0.3   4   1   capsule

ragdoll_bone 0 j_hip_le      j_knee_le   3.0  0.5  0.8  0.3   0   0   capsule
ragdoll_bone 0 j_knee_le     j_ankle_le  2.8  0.5  0.6  0.3   6   0   capsule

ragdoll_bone 0 j_hip_ri      j_knee_ri   3.0  0.5  0.8  0.3   0   1   capsule
ragdoll_bone 0 j_knee_ri     j_ankle_ri  2.8  0.5  0.6  0.3   8   1   capsule


// Hit location
// Format is:
// ragdoll_hitloc_mapping <def> <bone> <hitloc>
ragdoll_hitloc_mapping 0 1 helmet
ragdoll_hitloc_mapping 0 1 head
ragdoll_hitloc_mapping 0 1 neck
ragdoll_hitloc_mapping 0 0 torso_upper
ragdoll_hitloc_mapping 0 0 torso_lower
ragdoll_hitloc_mapping 0 4 right_arm_upper
ragdoll_hitloc_mapping 0 2 left_arm_upper
ragdoll_hitloc_mapping 0 5 right_arm_lower
ragdoll_hitloc_mapping 0 3 left_arm_lower
ragdoll_hitloc_mapping 0 5 right_hand
ragdoll_hitloc_mapping 0 3 left_hand
ragdoll_hitloc_mapping 0 8 right_leg_upper
ragdoll_hitloc_mapping 0 6 left_leg_upper
ragdoll_hitloc_mapping 0 9 right_leg_lower
ragdoll_hitloc_mapping 0 7 left_leg_lower
ragdoll_hitloc_mapping 0 9 right_foot
ragdoll_hitloc_mapping 0 7 left_foot
ragdoll_hitloc_mapping 0 5 gun


// Self collision pairs
// Format is:
// ragdoll_selfpair <def> <bone 0> <bone 1>
ragdoll_selfpair 0 0 3
ragdoll_selfpair 0 0 5	// Forearms vs. torso

ragdoll_selfpair 0 0 7 
ragdoll_selfpair 0 0 9	// Shins vs. torso

ragdoll_selfpair 0 3 7
ragdoll_selfpair 0 3 9

ragdoll_selfpair 0 5 7
ragdoll_selfpair 0 5 9	// Forearms vs. shins

ragdoll_selfpair 0 3 6
ragdoll_selfpair 0 3 8

ragdoll_selfpair 0 5 6
ragdoll_selfpair 0 5 8	// Forearms vs. thighs

ragdoll_selfpair 0 1 3
ragdoll_selfpair 0 1 5	// Neck/head vs. forearms

ragdoll_selfpair 0 3 5	// Forearms
ragdoll_selfpair 0 7 9  // Shins
ragdoll_selfpair 0 8 6	// thighs

// Joint format is:
// ragdoll_joint <def> <bone index> <type> <axis> <low limit> <hi limit>
ragdoll_joint 0  1  swivel	// Neck	0

ragdoll_joint 0  2  swivel	// l shoulder
ragdoll_joint 0  3  hinge	// l elbow

ragdoll_joint 0  4  swivel	// r shoulder
ragdoll_joint 0  5  hinge	// r elbow

ragdoll_joint 0  6  swivel	// l hip 5
ragdoll_joint 0  7  hinge	// l knee

ragdoll_joint 0  8  swivel	// r hip
ragdoll_joint 0  9  hinge	// r knee

// Limit format is:
// ragdoll_limit <def> <joint> <axis> <friction> <min angle> <max angle>

// Neck angles
ragdoll_limit 0 0  x  60.0  -50.0 50.0	// Head turn
ragdoll_limit 0 0  y  60.0  -45.0 45.0
ragdoll_limit 0 0  z  60.0  -20.0 30.0

// L/R shoulders
ragdoll_limit 0 1  x  80.0   -90.0 90.0	// Shoulder twist
ragdoll_limit 0 1  y  100.0  -45.0 20.0
ragdoll_limit 0 1  z  100.0   0.0 95.0

ragdoll_limit 0 3  x  80.0   -90.0 90.0	// Shoulder twist
ragdoll_limit 0 3  y  100.0  -45.0 20.0
ragdoll_limit 0 3  z  100.0   0.0 95.0

// L/R elbows
ragdoll_limit 0 2  z  60.0   -120.0 -5.0
ragdoll_limit 0 4  z  60.0   -120.0 -5.0

// L/R hips
ragdoll_limit 0 5  x  80.0   -30.0 30.0	// Hip twist
ragdoll_limit 0 5  y  100.0  -25.0 25.0
ragdoll_limit 0 5  z  200.0   0.0 50.0

ragdoll_limit 0 7  x  80.0   -30.0 30.0	// Hip twist
ragdoll_limit 0 7  y  100.0  -25.0 25.0
ragdoll_limit 0 7  z  200.0   0.0 50.0

// L/R knees
ragdoll_limit 0 6  z  100.0   -140.0 2.0
ragdoll_limit 0 8  z  100.0   -140.0 2.0

// Test
ragdoll_clear 1 

// p0 = point 0
// p1 = point 1
// cog = center of gravity
// rb = rigid body

// Where an argument lists <axis> it means a literal x, y, z, -x, -y, or -z

// Bones
// Format is:
// ragdoll_bone <def> <joint name (p0)> <child name (p1)> <radius> <cog lerp> <mass>
//     <friction> <parent bone> <mirror> <geom type>

ragdoll_bone 1 j_mainroot    j_spinelower	4.5  0.5  20.0  0.7  -1   0   capsule
ragdoll_bone 1 j_spinelower  j_spineupper	4.5  0.5  20.0  0.7   0   0   capsule
ragdoll_bone 1 j_spineupper  j_neck		4.5  0.5  20.0  0.7   1   0   capsule
ragdoll_bone 1 j_neck        j_head      	3.6  0.5  5.0  0.6   2   0   capsule

ragdoll_bone 1 j_shoulder_le j_elbow_le  	2.8  0.5  8.0  0.5   2   0   capsule
ragdoll_bone 1 j_elbow_le    j_wrist_le  	2.2  0.5  6.8  0.5   4   0   capsule

ragdoll_bone 1 j_shoulder_ri j_elbow_ri  	2.8  0.5  8.0  0.5   2   1   capsule
ragdoll_bone 1 j_elbow_ri    j_wrist_ri  	2.2  0.5  6.8 0.5   6   1   capsule

ragdoll_bone 1 j_hip_le      j_knee_le   	3.4  0.5  12.0  0.5   0   0   capsule
ragdoll_bone 1 j_knee_le     j_ankle_le  	3.1  0.5  10.0  0.5   8   0   capsule

ragdoll_bone 1 j_hip_ri      j_knee_ri   	3.4  0.5  12.0 0.5   0   1   capsule
ragdoll_bone 1 j_knee_ri     j_ankle_ri  	3.1  0.5  10.0  0.5   10  1   capsule


// Hit location
// Format is:
// ragdoll_hitloc_mapping <def> <bone> <hitloc>
ragdoll_hitloc_mapping 1 3 helmet
ragdoll_hitloc_mapping 1 3 head
ragdoll_hitloc_mapping 1 3 neck
ragdoll_hitloc_mapping 1 2 torso_upper
ragdoll_hitloc_mapping 1 1 torso_lower
ragdoll_hitloc_mapping 1 6 right_arm_upper
ragdoll_hitloc_mapping 1 4 left_arm_upper
ragdoll_hitloc_mapping 1 7 right_arm_lower
ragdoll_hitloc_mapping 1 5 left_arm_lower
ragdoll_hitloc_mapping 1 7 right_hand
ragdoll_hitloc_mapping 1 5 left_hand
ragdoll_hitloc_mapping 1 10 right_leg_upper
ragdoll_hitloc_mapping 1 8 left_leg_upper
ragdoll_hitloc_mapping 1 11 right_leg_lower
ragdoll_hitloc_mapping 1 9 left_leg_lower
ragdoll_hitloc_mapping 1 11 right_foot
ragdoll_hitloc_mapping 1 9 left_foot
ragdoll_hitloc_mapping 1 7 gun


// Self collision pairs
// Format is:
// ragdoll_selfpair <def> <bone 0> <bone 1>
ragdoll_selfpair 1 0 4
ragdoll_selfpair 1 1 4
// ragdoll_selfpair 1 2 4
ragdoll_selfpair 1 8 4
ragdoll_selfpair 1 9 4
ragdoll_selfpair 1 11 4

ragdoll_selfpair 1 0 5 
ragdoll_selfpair 1 1 5 
ragdoll_selfpair 1 2 5 
ragdoll_selfpair 1 3 5 
ragdoll_selfpair 1 7 5 
ragdoll_selfpair 1 8 5 
ragdoll_selfpair 1 9 5 
ragdoll_selfpair 1 10 5 
ragdoll_selfpair 1 11 5 

ragdoll_selfpair 1 0 6 
ragdoll_selfpair 1 1 6 
// ragdoll_selfpair 1 2 6
ragdoll_selfpair 1 8 6 
ragdoll_selfpair 1 9 6
ragdoll_selfpair 1 10 6

ragdoll_selfpair 1 0 7	
ragdoll_selfpair 1 1 7
ragdoll_selfpair 1 2 7	// Forearms vs. torso
ragdoll_selfpair 1 3 7	// Neck/head vs. forearms
ragdoll_selfpair 1 8 7 
ragdoll_selfpair 1 9 7 
ragdoll_selfpair 1 10 7 
ragdoll_selfpair 1 11 7 

ragdoll_selfpair 1 10 8
ragdoll_selfpair 1 11 8

ragdoll_selfpair 1 10 9
ragdoll_selfpair 1 11 9 


// Joint format is:
// ragdoll_joint <def> <bone index> <type> <axis> <low limit> <hi limit>
ragdoll_joint 1  1  hinge
ragdoll_joint 1  2  hinge	// Spine

ragdoll_joint 1  3  swivel	// Neck	0

ragdoll_joint 1  4  swivel	// l shoulder
ragdoll_joint 1  5  hinge	// l elbow

ragdoll_joint 1  6  swivel	// r shoulder
ragdoll_joint 1  7  hinge	// r elbow

ragdoll_joint 1  8  swivel	// l hip 5
ragdoll_joint 1  9  hinge	// l knee

ragdoll_joint 1  10  swivel	// r hip
ragdoll_joint 1  11  hinge	// r knee

// Limit format is:
// ragdoll_limit <def> <joint> <axis> <friction> <min angle> <max angle>

ragdoll_limit 1 0 z  100.0   -6.0 6.0
ragdoll_limit 1 1 z  100.0   -6.0 6.0

// Neck angles
ragdoll_limit 1 2  x  80.0  -30.0 30.0	// Head turn
ragdoll_limit 1 2  y  80.0  -30.0 30.0
ragdoll_limit 1 2  z  80.0  -10.0 30.0

// L/R shoulders
// ragdoll_limit 1 3  x  80.0  -90.0 90.0	// Shoulder twist
// ragdoll_limit 1 3  y  100.0  -40.0 30.0
// ragdoll_limit 1 3  z  100.0   -160.0 -159.0

ragdoll_limit 1 3  x  95.0  -104.0 100.0	// Shoulder twist
ragdoll_limit 1 3  y  95.0  -90.0 35.0
ragdoll_limit 1 3  z  95.0  -110.0 16.0

ragdoll_limit 1 5  x  95.0  -100.0 104.0	// Shoulder twist
ragdoll_limit 1 5  y  95.0  -35.0 90.0
ragdoll_limit 1 5  z  95.0  -110.0 16.0

// L/R elbows
ragdoll_limit 1 4  z  90.0  -100.0 2.0
ragdoll_limit 1 6  z  90.0  -100.0 2.0

// L/R hips
ragdoll_limit 1 7  x  90.0   -45.0 45.0	// Hip twist
ragdoll_limit 1 7  y  100.0  -30.0 30.0
ragdoll_limit 1 7  z  120.0  -4.0 100.0

ragdoll_limit 1 9  x  90.0  -45.0 45.0	// Hip twist
ragdoll_limit 1 9  y  100.0  -30.0 30.0
ragdoll_limit 1 9  z  120.0   -4.0 100.0

// ragdoll_limit 1 7  x  1.0  0.0 0.0	// Hip twist
// ragdoll_limit 1 7  y  1.0  0.0 0.0
// ragdoll_limit 1 7  z  0.0  0.0 90.0

// L/R knees
ragdoll_limit 1 8   z  130.0  -120.0 3.5
ragdoll_limit 1 10  z  130.0  -120.0 3.5 

ragdoll_baselerp_bone 1 j_head     2000
ragdoll_baselerp_bone 1 j_wrist_le 1000
ragdoll_baselerp_bone 1 j_wrist_ri 1000
ragdoll_baselerp_bone 1 j_ankle_le 1000
ragdoll_baselerp_bone 1 j_ankle_ri 1000
ragdoll_baselerp_bone 1 j_shouldertwist_le 1000 4
ragdoll_baselerp_bone 1 j_shouldertwist_ri 1000 6
ragdoll_baselerp_bone 1 j_hiptwist_le 1000 8 
ragdoll_baselerp_bone 1 j_hiptwist_ri 1000 10 

