Incorporate Gravity property into calculation of acceleration due to newtonian gravity

This commit is contained in:
Tamás Bálint Misius 2019-10-16 01:27:48 +02:00
parent a50b172999
commit 6b85231f23
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -3825,16 +3825,10 @@ void Simulation::UpdateParticles(int start, int end)
break;
}
//Get some gravity from the gravity map
if (t==PT_ANAR)
if(t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH && !(elements[t].Properties & TYPE_SOLID))
{
// perhaps we should have a ptypes variable for this
pGravX -= gravx[(y/CELL)*(XRES/CELL)+(x/CELL)];
pGravY -= gravy[(y/CELL)*(XRES/CELL)+(x/CELL)];
}
else if(t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH && !(elements[t].Properties & TYPE_SOLID))
{
pGravX += gravx[(y/CELL)*(XRES/CELL)+(x/CELL)];
pGravY += gravy[(y/CELL)*(XRES/CELL)+(x/CELL)];
pGravX += elements[t].Gravity * gravx[(y/CELL)*(XRES/CELL)+(x/CELL)];
pGravY += elements[t].Gravity * gravy[(y/CELL)*(XRES/CELL)+(x/CELL)];
}
}
else