Jump to content

  • Log In with Google      Sign In   
  • Create Account


MrRowl

Member Since 01 Jan 2004
Offline Last Active Aug 14 2014 02:55 PM

Posts I've Made

In Topic: PhysX - PxRigidDynamic clip through other actors (CCD enabled)

04 March 2014 - 03:52 AM

OK great - having looked for just a few minutes:

 

1. The way the box falls, it doesn't look like CCD is enabled - are you sure it's enabled in the filter shader as well as the scene and dynamic actor (I can see the flag is these two)? However, this is not the cause of the problem. 

 

2. Your box looks like it's about 50 units across. The contactOffset value is 0.02 which is tiny, in proportion. I'd suggest setting contactOffset to 1. But I don't think this will solve the problem. 

 

3. The scene is reporting gravity as (0,0,0) (and the object has eDISABLE_GRAVITY) - is that right? So you're applying gravity manually? I don't see why you shouldn't - a constant force shouldn't cause penetration problems... but maybe it is.

 

4. PVD doesn't report the tolerancesScale length/mass values - but it does say the "normal" speed is 10 units/s. When your box falls it his the ground at about 909 units/s

 

I would:

 

1. Disable CCD for the moment - it hasn't been reliable in the past (though is probably fine now)

 

2. Make sure the PxTolerancesScale is set correctly

 

3. If that doesn't work, see whether it's due to disabling gravity and applying the gravitational force manually (if this is it, it sounds like a PhysX bug).


In Topic: PhysX - PxRigidDynamic clip through other actors (CCD enabled)

03 March 2014 - 04:30 PM

Make sure the PxTolerancesScale values are sensible when you create your scene - as fanwars suggests.

 

Make sure your iteration counts are OK - e.g. 4 for position iterations is sensible, and 2 for velocity (penetration correction). Though what you're seeing is so bad that I don't think it's this.

 

Also make sure that the shape contactOffset and restOffset are sensible for your units, on all shapes, static and dynamic (but again, I don't think it's this).

 

If you can upload a short PVD capture I'll take a look...


In Topic: Advanced Character Controller based on PhysX 3.2.4

17 September 2013 - 09:53 AM

I haven't had a chance to download your code or study the video in detail (though with a brief look it seems good!), so please excuse me if I missed something you've already done/described, but here are a couple of features that aren't mentioned in your list, and are quite important:

 

1. Ability to push dynamic objects (optional)

2. Ability to be pushed by dynamic objects (optional)

3. Ability to step over small objects...

4. Without being able to climb really steep slopes (I'm not sure how it is at the moment, but I've certainly seen problems with vanilla PhysX CC where if you enable stepping the the slope limiting is badly broken)

5. Ability to enable a "stick to floor" mode for transition between slopes. So - if you're running along a flat surface approaching a slope down, then you shouldn't go airborne as you transition onto the slope - unless the transition is greater than some authored angle.

 

Anyway - I hope some of these might be interesting things to think about if you haven't done them already.

 

Cheers - Danny


In Topic: PhysX - Scene scaling, object size, timestep and gravity inconsistency.

10 September 2013 - 08:23 AM


i did the latter, found precise scaling factor for the scene and rescaled while passing to PhysX. it shouldn't couse trouble in future(unlike other option), less fiddly and i already had this option programmed into my engine.

 

The objects in the PVD doesn't look like they've had this scaling. Gravity in the scene is 9.81 - which means you're using metres as your distance unit. Yet the box in the scene is 24m long - and similarly the capsules - if this is supposed to be a road with debris(?) it's absolutely huge, and no wonder everything moves in a way that looks like it's in slow motion.


In Topic: PhysX - Scene scaling, object size, timestep and gravity inconsistency.

10 September 2013 - 07:25 AM


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.

 

OK - well if 1 unit is, say 0.05m, then you need to set gravity to 9.81 / 0.05, and get rid of your time scaling.

 

That's not all though - you need to:

 

1. Pass in an appropriate set of scales when you create the physics SDK, since the defaults will be inappropriate. Look up physx::PxTolerancesScale

 

2. Increase the contact offset on the shapes you create - by a factor of 1/0.05. 

 

The second thing should get rid of the jittering. 

 

You also need to consider what density you want, and what your mass units are. If you want mass in kg, then you will have pretty weird densities, because you'll have a factor of 20^3.

 

A better option is to work in metres, kg and seconds - either by converting your source/game assets, or by scaling whenever you pass things across the PhysX API.

 

One general thing though - it really is (in my experience) worth trying to be quite precise when dealing with physics simulation. Even just to use a physics SDK you need to have a reasonable understanding of physics (what's the difference between force and impulse etc), and be quite careful - otherwise you may hack things into working, but in the future (e.g. if you change the timestep) it can all come back to haunt you! 

 

I'll try to have a look at the PVD later...


PARTNERS