Panda Bullet

The object which has been hit by the ray can be accessed via “getNode”. When testing for a single hit (rayTestClosest):

result = mgr.rayTestClosest(...)
node = result.getNode()

And when testing for all hits (rayTestAll):

result = mgr.rayTestAll(...)
for hit in result:
    node = hit.getNode()

The returned object is one of the libpandabullet nodes, e. g. BulletRigidBodyNode.

To get the type of this node you can use the standard Python “type()” method, and you can also use the PandaNode tags or python tags to store additional information on the node when creating it.