Anyways, there seems to be some sort of bug in doing this with triggers and dynamic bodies. If the trigger is set as a trigger volume OR manually rejects contacts in the contact callback, then NewtonBodyGetContactJoint() will only return contacts with static (mass == 0) bodies. However, if the trigger is NOT a trigger volume and does NOT reject any contacts (that is, other bodies can bounce off the trigger), then NewtonBodyGetContactJoint() returns all of the contacts, including both static and dynamic (mass > 0) ones. Obviously, though, if bodies need to bounce off the triggers to be detected then the triggers aren't very useful

I haven't tested doing this inside a callback, only outside of NewtonUpdate(). I can't move my code into a callback because of thread safety.