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

Function physicsframe

source/src/physics.cpp:779–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777int physsteps = 0, physframetime = PHYSFRAMETIME, lastphysframe = 0;
778
779void physicsframe() // optimally schedule physics frames inside the graphics frames
780{
781 int diff = lastmillis - lastphysframe;
782 if(diff <= 0) physsteps = 0;
783 else
784 {
785 extern int gamespeed;
786 physframetime = clamp((PHYSFRAMETIME*gamespeed)/100, 1, PHYSFRAMETIME);
787 physsteps = (diff + physframetime - 1)/physframetime;
788 lastphysframe += physsteps * physframetime;
789 if(!multiplayer(NULL) && physsteps > 1000) physsteps = 1000;
790 }
791}
792
793VAR(physinterp, 0, 1, 1);
794

Callers 1

updateworldFunction · 0.85

Calls 1

multiplayerFunction · 0.85

Tested by

no test coverage detected