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

Function predictplayer

source/src/clientgame.cpp:539–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537VARP(smoothdist, 0, 8, 16);
538
539void predictplayer(playerent *d, bool move)
540{
541 d->o = d->newpos;
542 d->o.z += d->eyeheight;
543 d->yaw = d->newyaw;
544 d->pitch = d->newpitch;
545 if(move)
546 {
547 moveplayer(d, 1, false);
548 d->newpos = d->o;
549 d->newpos.z -= d->eyeheight;
550 }
551 float k = 1.0f - float(lastmillis - d->smoothmillis)/smoothmove;
552 if(k>0)
553 {
554 d->o.add(vec(d->deltapos).mul(k));
555 d->yaw += d->deltayaw*k;
556 if(d->yaw<0) d->yaw += 360;
557 else if(d->yaw>=360) d->yaw -= 360;
558 d->pitch += d->deltapitch*k;
559 }
560}
561
562void moveotherplayers()
563{

Callers 1

moveotherplayersFunction · 0.85

Calls 4

moveplayerFunction · 0.85
vecClass · 0.85
mulMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected