no contact with terrain heightfield

So I have my terrain heightfield, and I spawn some dynamic boxes in the air but they just fall straight through the terrain. The scene filterShader isn’t getting triggered at all by the heightfield, it only seems to trigger for dynamic<->dynamic collisions.

What could I be missing? Do heightfields use some other filtershader somewhere else or is something else filtering it out?

I also get no trace results from the terrain, and the only way I know it’s actually there is that I can see it in the visual debugger

Did you initialize the heightfield feature? This is done automatically with PxCreatePhysics() but not with PxCreateaBasePhysics(). If you use the base initialisation route, you have to.explicitly register some features e.g. heightfields, articulations.

Yes I’m using PxCreatePhysics(). The heightfield seems to be created ok in the debugger, and as you can see in the screenshot it is showing the terrain in the physx visual debugger, its just not colliding or tracing.

Found my problem, I was setting

not noticing that doing so cleared the esimulation and query flags

Great! Yeah, there are 2 flag-setting methods in PhysX: a “setFlag” method, which takes a flag and a bool which you can use to activate/deactivate a particular flag, and then a “setFlags” method which allows you to set the set of enabled flags all at once; the latter is potentially a little faster if you are setting/clearing multiple flags but the individual setFlag methods are potentially less error-prone.

Sorry you’re undergoing a traumatic experience updating from PhysX 2.8.4 to 4.0. Hopefully the end result will be worth it :)