I think that it is the only way to do it in the default plugin. With physX3 plugin you can use scene queries to check if you hit something (But you still need a loop).