Skip to content

Commit

Permalink
limited planet size
Browse files Browse the repository at this point in the history
  • Loading branch information
Feeeeddmmmeee committed May 1, 2022
1 parent 4fbf06e commit 89ae3f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GravitySim/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void Game::update()
{
if (editingM)
{
tempPlanet->radius = Vector(mousePos - tempPlanet->position).Lenght();
tempPlanet->radius = max(Vector(mousePos - tempPlanet->position).Lenght(), 1);
tempPlanet->mass = pow(tempPlanet->radius, 3) * 3 * DENSITY * PI / 4;
}
else if(!editingV) this->tempPlanet->position = mousePos;
Expand Down

0 comments on commit 89ae3f3

Please sign in to comment.