|
Hi everyone,
I'm making an iPad game where you shoot disks with a rubber band. I simulate the throwing of disks via the rubber band by giving them an impulse with ApplyLinearImpulse once you draw the disk on the rubber band and release it.
I want the impulse to be stronger if you drew the rubber band further, so I'm calculating the length in pixels of how much the rubber band was drawn and apply a greater impulse accordingly.
Basically, I use a factor by which I multiply the pixels to get the actual impulse vector (the impulse vector is always up so has x = 0 and y = something). Note that this is a game from above, so I'm using linear damping to simulate the friction fo the disks on the board (set to 2.5).
Once you release the disk it goes to the other side of the board, reaches a position where I reverse its direction speed and stops gradually because of the damping.
The thing is, even though I check the factor, and see that it is 2000 for small rubber band draws and 10000 for large ones, the larger draw still gets the disc less far than the small one. What can be causing this? I'm completely sure this is not related to my logic, but to the engine behaviour, since I debugged and saw the values of the impulse...
Can this be because of the high damping value?
The disks have friction of 2.0, density of 7.0, restitution of 0.5, the damping is 2.5 and the PTM ratio is 32. I'm using a velocity iteration of 6 and a position iteration of 1, and running the engine with a variable time step.
Thanks! Idan
|