mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 02:43:58 +02:00
Incorporate Gravity property into calculation of acceleration due to newtonian gravity
This commit is contained in:
@@ -3825,16 +3825,10 @@ void Simulation::UpdateParticles(int start, int end)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Get some gravity from the gravity map
|
//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 += elements[t].Gravity * gravx[(y/CELL)*(XRES/CELL)+(x/CELL)];
|
||||||
pGravX -= gravx[(y/CELL)*(XRES/CELL)+(x/CELL)];
|
pGravY += elements[t].Gravity * gravy[(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)];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user