Remove redundant computing in p variable

This commit is contained in:
Władysław Kuczerenko 2024-06-28 15:57:56 +02:00
parent bebee39768
commit 147f240a05
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ void computeBallsCollision() {
float kz = ball1.vz - ball2.vz;
// Obliczanie impulsu wymiany
float p = 2.0f * (nx * kx + ny * ky + nz * kz) / 2.0f; // Zakładając równe masy (m1 = m2 = 1.0f)
float p = nx * kx + ny * ky + nz * kz;
// Aktualizacja prędkości kulek
ball1.vx -= p * nx;