Closed GoogleCodeExporter closed 9 years ago
The only way we could guarantee reproducable (deterministic) results is by
removing
all objects from the dynamics world and re-inserting them in exactly the same
order.
And don't forget to reset the randseed generator, by calling
btSequentialImpulseConstraintSolver::reset
It will be very difficult to get reproducable results otherwise: all the other
cached
structures, such as overlapping pairs and btPersistentManifolds needs to be
cleared
and re-ordered too. For example: if you want to keep the overlapping pairs, you
need
to use the btSortedPairCache, to maintain a consistent ordering.
But we can accept the contribution, if it helps you.
Original comment by erwin.coumans
on 30 Oct 2008 at 5:43
Yes, I already remove all objects from the dynamics world, re-insert them
afterwards, and reset the random
seed. But the simulation is still not deterministic due to the linked list of
free handles in btAxisSweep3. After a
simulation and removal of all objects, the linked list is NOT in its initial
state (where each handle points to its
subsequent handle in memory), but is some permutation of this order. Therefore,
for a deterministic simulation
with btAxisSweep3, one has to do the steps which you mentioned, but one
additionally has to either create a new
btAxisSweep3 or to reset its pool. The latter is done by my patch. It seems to
work, i.e., my simulations are
deterministic now.
Original comment by ol...@arcor.de
on 31 Oct 2008 at 6:29
Good point, the linked-list needs to be reset indeed.
It has been fixed in the latest trunk:
http://code.google.com/p/bullet/source/detail?r=1448
Thanks again for the great contribution!
Erwin
Original comment by erwin.coumans
on 4 Nov 2008 at 9:37
Original issue reported on code.google.com by
ol...@arcor.de
on 30 Oct 2008 at 10:02Attachments: