Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualN01

Posted 10 September 2013 - 06:21 AM

OK - well this looks right now.

One quick thing to test is whether your game's accumulation of time is correct. So in your loop you can just print out the total time you've passed to PhysX, and as the game runs, check whether it is counting up in seconds (i.e. compare it with a watch):
 

        ...

If the time printed out is slow, then you need to check the timing code.

 

If the time printed out is fine, then I'm pretty sure PhysX is doing the right thing - just that you have some scaling problems. I'm still not sure from your posts (including #13) how you're determining that the simulation is running slower than expected. If you're looking at the time it takes for a falling object to move the size of a human sized object - you need to be sure that your "human sized object" is really about 2m big. 

 

Since you set gravity to 9.81 m/s that implies your distance unit is metres, and your time unit is seconds. if not - then you need to use a different gravity value.

 

Feel free to upload a pvd capture and I'll take a look...

 

 

i tried outputting elapsed time through printf and it does output realtime seconds quite perfectly. so i guess, timestepping is fine.

i just determine it visually, objects fall and interact to slowly.  i guess, problem is scaling. because in my scene, 1 unit is like 5-6cm and objects have corresponding weight. if i increase gravity, it doesn't go well. objects start shaking on the ground. and if i re-scale my scene by a factor of 0.05f(1/20), speed gets normal. although it seems like precision for smaller objects is lost. if i shoot a dense sphere with high velocity at a small object, it most likely will just pass through, it just feels a bit off.

 

it says "Error You aren't permitted to upload this kind of file", so i uploaded PVD clip here:

http://rghost.net/private/48672806/63f9e682ffa0f7a14746166f83a12cd0

it demonstrates test scene without any re-scaling, so it's slow-mo, and i just fly around for a bit, shooting spheres.


#1N01

Posted 10 September 2013 - 06:21 AM

OK - well this looks right now.

One quick thing to test is whether your game's accumulation of time is correct. So in your loop you can just print out the total time you've passed to PhysX, and as the game runs, check whether it is counting up in seconds (i.e. compare it with a watch):
 

        while(mAccumulator > mStepSize) {
            mAccumulator -= mStepSize;
            mScene->simulate(mStepSize);
            mScene->fetchResults(true);

            static float physXTime = 0.0f;
            physXTime += mStepSize;
            printf("%f\n", physXTime);
            }

If the time printed out is slow, then you need to check the timing code.

 

If the time printed out is fine, then I'm pretty sure PhysX is doing the right thing - just that you have some scaling problems. I'm still not sure from your posts (including #13) how you're determining that the simulation is running slower than expected. If you're looking at the time it takes for a falling object to move the size of a human sized object - you need to be sure that your "human sized object" is really about 2m big. 

 

Since you set gravity to 9.81 m/s that implies your distance unit is metres, and your time unit is seconds. if not - then you need to use a different gravity value.

 

Feel free to upload a pvd capture and I'll take a look...

 

 

i tried outputting elapsed time through printf and it does output realtime seconds quite perfectly. so i guess, timestepping is fine.

i just determine it visually, objects fall and interact to slowly.  i guess, problem is scaling. because in my scene, 1 unit is like 5-6cm and objects have corresponding weight. if i increase gravity, it doesn't go well. objects start shaking on the ground. and if i re-scale my scene by a factor of 0.05f(1/20), speed gets normal. although it seems like precision for smaller objects is lost. if i shoot a dense sphere with high velocity at a small object, it most likely will just pass through, it just feels a bit off.

 

it says "Error You aren't permitted to upload this kind of file", so i uploaded PVD clip here:

http://rghost.net/private/48672806/63f9e682ffa0f7a14746166f83a12cd0

it demonstrates test scene without any re-scaling, so it's slow-mo, and i just fly around for a bit, shooting spheres.


PARTNERS