Remove redundant computing in p variable
This commit is contained in:
parent
bebee39768
commit
147f240a05
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user