Box2d step function giving different result on different dev

Discuss issues specific the Java port of Box2D
Khubaib
Posts: 13
Joined: Sat Jul 12, 2014 12:44 pm

Box2d step function giving different result on different dev

Postby Khubaib » Sun Feb 01, 2015 2:15 am

I have made a physics based game using Processing and Eclipse that is using Box2d. My game is working fine on PC and my Samsung s3 but the physics simulation is too slow on LG G2 (although G2 is running at 60fps while S3 at 45-50fps). I am stepping Box2d as: box2d.step((float) (1.0 / frameRate * 1.4), (int) frameRate / 8, (int) frameRate / 8); Kindly tell me what can I do to run the simulation smoothly on every device?

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Box2d step function giving different result on different

Postby irresistible force » Mon Feb 02, 2015 4:48 am

Is the value of 'framerate' a constant number, the same on each device?

Khubaib
Posts: 13
Joined: Sat Jul 12, 2014 12:44 pm

Re: Box2d step function giving different result on different

Postby Khubaib » Sat Feb 07, 2015 4:21 am

no its not constant. Its constantly changing

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Box2d step function giving different result on different

Postby irresistible force » Sat Feb 07, 2015 11:45 am

How about making it constant?


Return to “Java”



Who is online

Users browsing this forum: No registered users and 1 guest