e.bone_weapon = gettagindex(e, "tag_weapon");
if(!e.bone_weapon)
e.bone_weapon = gettagindex(e, "bip01 r hand");
- e.bone_aim = 0;
+ e.bone_aim1 = 0;
+ e.bone_aim2 = 0;
+ e.bone_aim1weight = 0;
+ e.bone_aim2weight = 0;
e.fixbone = 0;
if(get_model_parameters(e.model, e.skin))
{
if(get_model_parameters_bone_upperbody)
e.bone_upperbody = gettagindex(e, get_model_parameters_bone_upperbody);
- if(get_model_parameters_bone_weapon)
- e.bone_weapon = gettagindex(e, get_model_parameters_bone_weapon);
- if(get_model_parameters_bone_aim)
- e.bone_aim = gettagindex(e, get_model_parameters_bone_aim);
if(e.bone_upperbody)
e.fixbone = get_model_parameters_fixbone;
+ if(get_model_parameters_bone_weapon)
+ e.bone_weapon = gettagindex(e, get_model_parameters_bone_weapon);
+ if(get_model_parameters_bone_aim1)
+ e.bone_aim1 = gettagindex(e, get_model_parameters_bone_aim1);
+ if(e.bone_aim1)
+ e.bone_aim1weight = get_model_parameters_bone_aim1weight;
+ if(get_model_parameters_bone_aim2)
+ e.bone_aim2 = gettagindex(e, get_model_parameters_bone_aim2);
+ if(e.bone_aim2)
+ e.bone_aim2weight = get_model_parameters_bone_aim2weight;
}
else
dprint("No model parameters for ", e.model, "\n");
skel_set_boneabs(s, e.bone_upperbody, org);
}
- if(e.bone_aim)
+ if(e.bone_aim1)
+ {
+ vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90) * e.bone_aim1weight;
+ vector org = skel_get_boneabs(s, e.bone_aim1);
+ vector ang_cur = fixedvectoangles2(v_forward, v_up);
+ vector ang = AnglesTransform_Multiply(aim, ang_cur);
+ fixedmakevectors(ang);
+ skel_set_boneabs(s, e.bone_aim1, org);
+ }
+
+ if(e.bone_aim2)
{
- vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90);
- vector org = skel_get_boneabs(s, e.bone_aim);
+ vector aim = '1 0 0' * bound(-90, self.v_angle_x, 90) * e.bone_aim2weight;
+ vector org = skel_get_boneabs(s, e.bone_aim2);
vector ang_cur = fixedvectoangles2(v_forward, v_up);
vector ang = AnglesTransform_Multiply(aim, ang_cur);
fixedmakevectors(ang);
- skel_set_boneabs(s, e.bone_aim, org);
+ skel_set_boneabs(s, e.bone_aim2, org);
}
}
get_model_parameters_desc = string_null;
get_model_parameters_bone_upperbody = string_null;
get_model_parameters_bone_weapon = string_null;
- get_model_parameters_bone_aim = string_null;
+ get_model_parameters_bone_aim1 = string_null;
+ get_model_parameters_bone_aim2 = string_null;
+ get_model_parameters_bone_aim1weight = 0;
+ get_model_parameters_bone_aim2weight = 0;
get_model_parameters_fixbone = 0;
if not(m)
get_model_parameters_bone_upperbody = s;
if(c == "bone_weapon")
get_model_parameters_bone_weapon = s;
- if(c == "bone_aim")
- get_model_parameters_bone_aim = s;
+ if(c == "bone_aim1")
+ {
+ get_model_parameters_bone_aim1weight = stof(car(s));
+ get_model_parameters_bone_aim1 = cdr(s);
+ }
+ if(c == "bone_aim2")
+ {
+ get_model_parameters_bone_aim2weight = stof(car(s));
+ get_model_parameters_bone_aim2 = cdr(s);
+ }
if(c == "fixbone")
get_model_parameters_fixbone = stof(s);
}
float get_model_parameters_age;
string get_model_parameters_bone_upperbody;
string get_model_parameters_bone_weapon;
-string get_model_parameters_bone_aim;
+string get_model_parameters_bone_aim1;
+float get_model_parameters_bone_aim1weight;
+string get_model_parameters_bone_aim2;
+float get_model_parameters_bone_aim2weight;
float get_model_parameters_fixbone;
string get_model_parameters_desc;
float get_model_parameters(string mod, float skn); // call with string_null to clear; skin -1 means mod is the filename of the txt file and is to be split