diff --git a/README.md b/README.md index 217d056..375d5b2 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ Per spostare l'intera scena si tiene premuto il tasto centrale del mouse. - Modificato lower_body per gestire la trasparenza della gamba più lontana - Ridimensionato bacino per migiore visualizzazione +## Nella versione v0.8 +- Aggiunta oscillazione bacino +- Aggiustato calcolo posizione con clock dedicato + # Per compilare: cmake --build diff --git a/build/bin/mainV8.exe b/build/bin/mainV8.exe index 1c40564..fc112fe 100644 Binary files a/build/bin/mainV8.exe and b/build/bin/mainV8.exe differ diff --git a/src/collections/methods/lower_body.cpp b/src/collections/methods/lower_body.cpp index 9dfb02d..72d37ad 100644 --- a/src/collections/methods/lower_body.cpp +++ b/src/collections/methods/lower_body.cpp @@ -80,14 +80,6 @@ void Lower_Body::update(sf::Clock cl){ float sxAcc = sx->getZ_Acc() ; float dxAcc = dx->getZ_Acc() ; - //float totAcc = sxAcc + dxAcc; - //t->body.setTanAcc({0,totAcc,0}); // non funziona, cambio sistema - - /* Posso considerare lo spostamento come A*sin(alpha)*/ - /* Mi calcolo le velocità totali sull'asse z */ - - //printf("Acc: %f\n", dxAcc); - int64_t Dtime = cl.getElapsedTime().asMicroseconds(); if (prevT == 0) prevT = Dtime; float dt = (float(Dtime) / 1000000.0) - (float(prevT) / 1000000.0); @@ -95,20 +87,11 @@ void Lower_Body::update(sf::Clock cl){ float tmpVelS = sxAcc*dt; float tmpVelD = dxAcc*dt; - - //printf("Vel: %f\n", tmpVelD); - - float tmpPosD = tmpVelD *dt *500 + velD * 500 * dt; float tmpPosS = tmpVelS * 500 *dt + velS * 500 * dt; - - //printf("DPos: %f\n\n", tmpPosD); - velD += tmpVelD; velS += tmpVelS; - posD += tmpPosD; - posS += tmpPosS; // PosD + PosS + Z = 0 float alpha = atan(tmpPosD/60.0 - tmpPosS/60); //il 60 è il raggio (dimesione del bacino) @@ -116,12 +99,9 @@ void Lower_Body::update(sf::Clock cl){ //applico smoothing e ritorno a zero velD -= velD * fabs(alpha); velS -= velS * fabs(alpha) ; - - printf("Svel: %f\n", velS); - printf("Dvel: %f\n\n", velD); - + t->body.setRot({alpha,0,0}); auto tPos = t->body.getPos(); - //t->body.setPos({tPos[0],tPos[1],tPos[2]+posD-posS}); + } \ No newline at end of file