Hello Everyone,
I am working on a game which has a bridge that carries some objects. The bridge consists of solid objects connected by revolute joints. I want the bridge to break, when the weight of all the objects is too high. The way I check for that is by traversing all the joints, running GetReactionForce on each and if any of the values exceeds given threshold, I delete the joint.
I adjusted the threshold experimentally and everything works great, until I install the game on a different device. In that case the exact same code reports totally different results for GetReactionForce(). Here's sample code:
revoluteReactionForce = revoluteBridgeJoints[i]->GetReactionForce(dt);
CCLOG(@"Reaction force: %f, delta time %f", revoluteReactionForce.Length(), dt);
And here are the results:
On iPad 2 I get this:
Reaction force: 5.546707, delta time 0.016756
iPhone (non-retina) simulator:
Reaction force: 0.761167, delta time 0.016640
iPod (2nd gen):
Reaction force: 0.840120, delta time 0.016700
The above results were generated for the exact same number of identical objects sitting on the bridge (I modified my code so there are no variations affecting the measurements).
Why am I seeing such a huge difference between the iPad2 and the iPhone/iPod? Timestep is practically the same for all of them.
Please help!
Thanks,
George
I am working on a game which has a bridge that carries some objects. The bridge consists of solid objects connected by revolute joints. I want the bridge to break, when the weight of all the objects is too high. The way I check for that is by traversing all the joints, running GetReactionForce on each and if any of the values exceeds given threshold, I delete the joint.
I adjusted the threshold experimentally and everything works great, until I install the game on a different device. In that case the exact same code reports totally different results for GetReactionForce(). Here's sample code:
revoluteReactionForce = revoluteBridgeJoints[i]->GetReactionForce(dt);
CCLOG(@"Reaction force: %f, delta time %f", revoluteReactionForce.Length(), dt);
And here are the results:
On iPad 2 I get this:
Reaction force: 5.546707, delta time 0.016756
iPhone (non-retina) simulator:
Reaction force: 0.761167, delta time 0.016640
iPod (2nd gen):
Reaction force: 0.840120, delta time 0.016700
The above results were generated for the exact same number of identical objects sitting on the bridge (I modified my code so there are no variations affecting the measurements).
Why am I seeing such a huge difference between the iPad2 and the iPhone/iPod? Timestep is practically the same for all of them.
Please help!
Thanks,
George