FT collision part3: cleanup.

This commit is contained in:
Muzychenko Andrey committed 2023-03-05 14:16:07 +03:00
1 parent ba470e8727
commit 4b86fe2aa7
16 files changed
+144 -202

No files matched your search

+4 -1
View File
@@ -211,7 +211,10 @@ void DebugOverlay::DrawBallInfo()
SDL_SetRenderDrawColor(winmain::Renderer, 0, 0, 255, 255);
auto pt1 = proj::xform_to_2d(ballPosition);
SDL_RenderDrawCircle(winmain::Renderer, pt1.X, pt1.Y, 10);
vector2 radVec1 = { 0, ballPosition.Y }, radVec2 = { ball->Radius, ballPosition.Y };
auto radVec1I = proj::xform_to_2d(radVec1), radVec2I = proj::xform_to_2d(radVec2);
auto radI = std::sqrt(maths::magnitudeSq(vector2i{ radVec1I.X - radVec2I.X ,radVec1I.Y - radVec2I.Y }));
SDL_RenderDrawCircle(winmain::Renderer, pt1.X, pt1.Y, static_cast<int>(std::round(radI)));
auto nextPos = ballPosition;
maths::vector_add(nextPos, maths::vector_mul(ball->Direction, ball->Speed / 10.0f));