Hi, I'm writing a game where some objects are falling from top, and they have polygon shapes, each shape consists about 10-20 points.
Those object should have some constant position at start so I have to create all of them in game load. I did some optimizations and
I am setting active false to objects which are not visible on the screen, it helped a lot in some old devices(like iPhone 3gs or 3g).
but still has some jerky movement.. if physics are not enabled it's working perfectly..
Falling objects are kinematic and I'm calculating their positions manually(cos they can;t be done easily with only physic forces)
so this is what I have done:
Is there any better solution for optimizing physics calculations?
Thanks, George.
Those object should have some constant position at start so I have to create all of them in game load. I did some optimizations and
I am setting active false to objects which are not visible on the screen, it helped a lot in some old devices(like iPhone 3gs or 3g).
but still has some jerky movement.. if physics are not enabled it's working perfectly..
Falling objects are kinematic and I'm calculating their positions manually(cos they can;t be done easily with only physic forces)
so this is what I have done:
Code:
if (object->isVisible())
object->getBody()->setActive(true);
else
object->getBody()->setActive(false);
object->getBody()->setActive(true);
else
object->getBody()->setActive(false);
Is there any better solution for optimizing physics calculations?
Thanks, George.