mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-17 22:38:38 +01:00
Incorporate Gravity property into calculation of acceleration due to newtonian gravity
This commit is contained in:
parent
a50b172999
commit
6b85231f23
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user