MCPcopy Create free account
hub / github.com/demoth/jake2 / AddPlayerBeams

Method AddPlayerBeams

client/src/main/java/jake2/client/CL_tent.java:1293–1520  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1291 * =================
1292 */
1293 static void AddPlayerBeams() {
1294 float d;
1295 //entity_t ent = new entity_t();
1296 float yaw, pitch;
1297 float forward;
1298 float len, steps;
1299 int framenum = 0;
1300 float model_length;
1301
1302 float hand_multiplier;
1303 frame_t oldframe;
1304 player_state_t ps, ops;
1305
1306 // PMM
1307 if (ClientGlobals.hand != null) {
1308 if (ClientGlobals.hand.value == 2)
1309 hand_multiplier = 0;
1310 else if (ClientGlobals.hand.value == 1)
1311 hand_multiplier = -1;
1312 else
1313 hand_multiplier = 1;
1314 } else {
1315 hand_multiplier = 1;
1316 }
1317 // PMM
1318
1319 // update beams
1320 beam_t[] b = cl_playerbeams;
1321 for (int i = 0; i < MAX_BEAMS; i++) {
1322
1323 if (b[i].model == null || b[i].endtime < ClientGlobals.cl.time)
1324 continue;
1325
1326 if (cl_mod_heatbeam != null && (b[i].model == cl_mod_heatbeam)) {
1327
1328 // if coming from the player, update the start position
1329 if (b[i].entity == ClientGlobals.cl.playernum + 1) // entity 0 is the
1330 // world
1331 {
1332 // set up gun position
1333 // code straight out of CL_AddViewWeapon
1334 ps = ClientGlobals.cl.frame.playerstate;
1335 int j = (ClientGlobals.cl.frame.serverframe - 1)
1336 & Defines.UPDATE_MASK;
1337 oldframe = ClientGlobals.cl.frames[j];
1338
1339 if (oldframe.serverframe != ClientGlobals.cl.frame.serverframe - 1
1340 || !oldframe.valid)
1341 oldframe = ClientGlobals.cl.frame; // previous frame was
1342 // dropped or involid
1343
1344 ops = oldframe.playerstate;
1345 for (j = 0; j < 3; j++) {
1346 b[i].start[j] = ClientGlobals.cl.refdef.vieworg[j]
1347 + ops.gunoffset[j] + ClientGlobals.cl.lerpfrac
1348 * (ps.gunoffset[j] - ops.gunoffset[j]);
1349 }
1350 Math3D.VectorMA(b[i].start,

Callers 1

AddTEntsMethod · 0.95

Calls 14

VectorMAMethod · 0.95
VectorCopyMethod · 0.95
VectorAddMethod · 0.95
VectorSubtractMethod · 0.95
VectorLengthMethod · 0.95
VectorScaleMethod · 0.95
AngleVectorsMethod · 0.95
VectorEqualsMethod · 0.95
MonsterPlasma_ShellMethod · 0.95
HeatbeamMethod · 0.95
VectorNormalizeMethod · 0.95
randMethod · 0.95

Tested by

no test coverage detected