|
We are trying to unify the asynchronous graphic thread to jbox2d. Because I don't want to copy all the body position ant then send them to graphics is synchronous mode, I have taken a reference to the transform of every body and set it to the relative graphic entity, so the Transform data is share.
But this is not safe!
What can happen: 1. entity are drawn in different physic step, this will probably cause a so small difference at 50/60Hz that nobody will notice, but if graphics run at 30fps it can act weird
2. entity read Transform while it is written, maybe while a variable is inconsistent, so it will "jump" to a strange location for 1 turn
Do you have a better idea? IMHO Transform should implement some method to be easily READ in asynchronous way
|