Why I have SetSyncRate (10000,0)? I have a GeForce 770 GTX and wanted to know, how far I could push the graphics card and which objects will have a huge impact and which not.
Physics will stop or is very slow, but if SetSyncRate (1000,0) is set, it works fine. Framerate is about 2200 Frames in this setting.
Maybe this was the same problem like here
https://forum.thegamecreators.com/thread/217190
My code
// Project: phytest_FL
// Created: 2016-10-04
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "phytest_FL" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 1000, 0 ) // 30fps instead of 60 to save battery
Create3DPhysicsWorld()
plane = CreateObjectPlane(100,100)
SetObjectRotation(plane,90,0,0)
Create3DPhysicsStaticBody(plane)
SetObjectShapeBox(plane)
box = CreateObjectBox(20,10,10)
SetObjectColor(box,100,100,200,255)
SetObjectPosition(box,0,80,0)
Create3DPhysicsDynamicBody( box)
SetObjectShapeBox(box)
SetCameraPosition(1,GetCameraX(1),GetCameraY(1)+50,GetCameraZ(1)-100)
SetCameraRotation(1,GetCameraAngleX(1)-15,GetCameraAngleY(1),GetCameraAngleZ(1))
do
Print( Str(ScreenFPS(),2) )
Step3DPhysicsWorld()
Sync()
loop
A trick, that worked for be able to set the Synchrate to 2000 frames is
i=i+1
if mod(i,2)=0
Step3DPhysicsWorld()
EndIf
But this still shows, that the physics is not able to calculate itself exactly if the changes maybe to tiny.