MCPcopy Create free account
hub / github.com/assaultcube/AC / renderhudmodel

Method renderhudmodel

source/src/weapon.cpp:1044–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1042VARP(righthanded, 0, 1, 1); // flowtron 20090727
1043
1044void weapon::renderhudmodel(int lastaction, int index)
1045{
1046 playerent *p = owner;
1047 vec unitv;
1048 float dist = worldpos.dist(p->o, unitv);
1049 unitv.div(dist);
1050
1051 weaponmove wm;
1052 if(!intermission || !ispaused) wm.calcmove(unitv, lastaction, p);
1053 defformatstring(path)("weapons/%s", info.modelname);
1054 bool emit = (wm.anim&ANIM_INDEX)==ANIM_GUN_SHOOT && (lastmillis - lastaction) < flashtime();
1055 rendermodel(path, wm.anim|ANIM_DYNALLOC|(righthanded==index ? ANIM_MIRROR : 0)|(emit ? ANIM_PARTICLE : 0), 0, -1, wm.pos, 0, p->yaw+90, p->pitch+wm.k_rot, 40.0f, wm.basetime, NULL, NULL, 1.28f);
1056}
1057
1058void weapon::updatetimers(int millis)
1059{

Callers 1

drawhudgunFunction · 0.80

Calls 3

rendermodelFunction · 0.85
distMethod · 0.80
calcmoveMethod · 0.80

Tested by

no test coverage detected