diff --git a/C++ProjectTemplate.wasm b/C++ProjectTemplate.wasm index cab8f5b..74fe153 100755 Binary files a/C++ProjectTemplate.wasm and b/C++ProjectTemplate.wasm differ diff --git a/main.cpp b/main.cpp index 235ff6e..cc1ab57 100644 --- a/main.cpp +++ b/main.cpp @@ -66,6 +66,7 @@ public: AddLine({76,68},{132,68},5); AddLine({4,12},{4,60},5); AddLine({140,12},{140,60},5); + ConsoleCaptureStdOut(true); return true; } @@ -127,9 +128,13 @@ public: } } + if(GetKey(F1).bPressed){ + ConsoleShow(F1); + } + Clear(BLACK); - float stable=0.01f; + float stable=0.05f; int simulationUpdates=4; int maxSimulationSteps=15; float simElapsedTime=fElapsedTime/(float)simulationUpdates; @@ -183,11 +188,11 @@ public: Ball*fakeBall=new Ball(); fakeBall->radius=l.radius; fakeBall->mass=b.mass*0.8f; - fakeBall->pos=closestPoint; + fakeBall->pos={closestPoint.x,closestPoint.y}; fakeBall->vel={-b.vel.x,-b.vel.y}; fakeBalls.push_back(fakeBall); collidingPairs.push_back({&b,fakeBall}); - float overlap=1.f*(dist-b.radius-fakeBall->radius); + float overlap=1.1f*(dist-b.radius-fakeBall->radius); b.pos.x-=overlap*(b.pos.x-fakeBall->pos.x)/dist; b.pos.y-=overlap*(b.pos.y-fakeBall->pos.y)/dist; }