OS: Win7
SFML: 2.1
Language: C++
IDE: VS2013
I am working on a physics simulation, and when I felt it was quite complete I decided to build a release build but the physics is all messed up. Could it be my FPS that is messing things up? On a slower machine I have a lot lower FPS, that is ranging from 80fps with tracers on in debug to 350 in release with tracers on.
I have this in my code:
window.setFramerateLimit(40);
So I guess my FPS counter is a bit misplaced as well.
Code snippet for FPS.
times = clock.getElapsedTime();
window.clear(bg);
mss.Update();
if (displayInstruction)
DrawInstructions(window);
DrawFPS(window, times, mss.GetBodyCount());
window.display();
clock.restart().asSeconds();
Here below is on image with the "wrong" physics and one image with the correct physics.
Release (wrong),
Debug (correct)The formula I use are the same in both builds it is the gravity law formula. If it matters both builds also uses floats for masses, velocity and such. There is so much code in this so I do not know were to start showing it if it is necessary but since the code works as intended in debug I hope it is a some what easy way to fix this problem. So do anyone have any clue on why this could happen?
Feel free to ask questions if more information is needed since I really do not know what to provide.