20-10-2020, 01:56 PM
(20-10-2020, 01:38 PM)josemendez Wrote: Hard to say what the issue could be at this point. One thing Id' try when loading data is to zero out velocities, since you're still using whatever velocities the particles had at the time of loading the data. This might or might not be the culprit, but zeroing them out is definitely a good idea.
How are you storing the data? I take it that you're also iterating over particles? At which point in the frame do you load/store data?
I tried zeroing the velocities out but it didn't help.
Yes, I iterate over the particles to save them :
Code:
for (int i = 0; i < r.solverIndices.Length; i++) {
str += solver.positions[r.solverIndices[i]].ToString() + " : ";
str += solver.invMasses[r.solverIndices[i]].ToString() + "; ";
}
and I do the loading on fixed update.