Closed GoogleCodeExporter closed 9 years ago
"The order is depends on the values of the proxies' m_uniqueId members, which
is nondeterministic"
How is the value of m_uniqueId nondeterministic?
As long as you add the objects to the world in the same order, it should be
deterministic, right?
Do you have some reproduction case to show this problem?
Thanks a lot,
Erwin
Original comment by erwin.coumans
on 19 Feb 2011 at 7:19
I don't know about other broadphases, but in the case of btAxisSweep the
m_uniqueId field is an index into the m_pHandles array. Handles in the array
are allocated from a last-in-first-out linked list of free array indices
(m_firstFreeHandle/Handle::SetNextFree()/Handle::GetNextFree()). Therefore, to
get repeatable values of m_uniqueId from one simulation run to the next, it's
necessary to either destroy and recreate the broadphase or ensure that objects
are removed from the collision world in the reverse order of their being added
to it.
So, I'm not sure if it was entirely fair of me to call that behaviour
'non-deterministic', but it does seem like an unnecessary trap for people who
are interested in a determistic simulation.
Are you still interested in a test case? If so, I can provide one.
Original comment by neph...@gmail.com
on 23 Feb 2011 at 3:57
It is indeed necessary to destroy and re-create the broadphase. We are not
making the change for Bullet 2.x anymore.
We are now focussing on Bullet 3.x at http://github.com/erwincoumans/bullet3
and make sure it will be deterministic/reproducing same results.
Original comment by erwin.coumans
on 12 Sep 2013 at 10:36
Original issue reported on code.google.com by
neph...@gmail.com
on 18 Feb 2011 at 10:57Attachments: