Panda PhysX

Not a bug, but the way PhysX is implemented. You should use a static triangle mesh instead, like in the sample. The triangle mesh can be just two triangles, but usually you want to have an uneven ground. Or a heightfield mesh.

This is because you probably start the ray INSIDE the character’s shape. So the character’s shap is the first shape the ray hits, with distance 0.
There are several options:

  • start the ray outside the capsule
  • use shape groups and a PhysMask32 to disable/enable specific shape groups.
  • use raycastAll, and skip the raycast hit with the own character’s shape. Cave: the raycast hit’s are not guaranteed to be sorted. Not recommended.
  • Not yet supported is the way more powerful 128-bit masking system. This would be a third option.

enn0x