Bodies that don't fall after removing the floor. Sticky wall

toglia

31-07-2008 22:28:38

Hey!

I have been noticing that sometimes my bodies when touching a wall don't fall if I remove the floor they're on. I know it has to do with the sleep option but its happens rarely.

I´m thinking maybe I could WakeUp these bodies after I remove the floor, but I don't really know if this solves the problem cause its very unusual.

The other thing I thought is that maybe these bodies don't collide efficiently and they penetrate the wall making them harder to fall.

What do you guys think?

betajaen

31-07-2008 22:32:04

PhysX doesn't expect static actors to be destroyed during the life-time of the Scene - only at the end; it's a way of optimisation and making it uber fast. So you'll have to wake them up before or after you destroy the static actor.

[Edit]

It's explained a bit better in the PhysX Documentation CHM.

Once the static actor is created, do not do anything with it. Even though operations such as changing the position, adding more shapes, or even deleting the static actor are not explicitly forbidden, they are not recommended for two reasons: 1) the SDK assumes that static actors are indeed static, and does all sorts of optimizations that rely on this property. Changing the static actor may force time consuming re-computation of such data structures, and 2) the code driving dynamic actors and joints is written with the assumption that static actors will not move or be deleted for the duration of the simulation, which permits a number of optimizations for this very common scenario. For example, moving a static actor out from under a stack of sleeping boxes will not wake these up, thus they will levitate in midair. Even if they are woken up, the collision response between moving static and dynamic actors is of low quality.

So in short. If your planning to remove a lot of floors; use Kinematic actors for them.

toglia

31-07-2008 22:57:04

Just to be sure, is it:
new SphereShape(1,"material:bounce, kinematic: yes")
on NxOgre 0.9? :oops:

betajaen

31-07-2008 23:15:04

No. It's an actor param.

toglia

31-07-2008 23:15:14

Ok I hadn't understood your message... My floors are not static, and to get them out of the way I rotate them, but some spheres on top of the floor that touch the wall don't fall after that, they seem like stuck to the wall although the wall is 90 totally vertical and static...