Quote: "Otherwise 2 timers using the two different methods keep time perfectly together."
I tried it out of curiosity (not to prove anyone wrong!)
In the example below I just grabbed some old code to create a load. By 80 seconds, it was starting to drift slightly. By 130 seconds it was drifting by 0.01 seconds every 10 seconds or so.
// set window properties
SetWindowTitle( "Simple 3D Physics" )
SetWindowSize( 1024, 768, 0 )
SetSyncRate(0,0)
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetScissor(0,0,0,0)
Create3DPhysicsWorld()
Set3DPhysicsGravity(0,-1,0)
CreateObjectBox( 1, 10,10,10 )
Create3DPhysicsStaticBody( 1 )
SetObjectShapeBox(1)
CreateObjectBox( 2, 5,5,5 )
SetObjectPosition( 2, 5.1,30,0 )
Create3DPhysicsDynamicBody( 2 )
SetObjectShapeBox(2)
SetCameraPosition( 1, 0,30,-80 )
SetCameraLookAt( 1, 0,10,0, 0 )
t# = timer()
f# = 0
sync()
do
Print( ScreenFPS() )
inc f#, GetFrameTime()
print ("Timer: " + str(timer() - t#))
print ("Frame-based: " + str(f#))
print("Difference: " + str(timer() - t# - f#))
Step3DPhysicsWorld()
Sync()
loop
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt