Actually I have two things here:
-
I am using Bullet queries and the only result I have from the collisions is a node, not a NodePath. To be precise, it’s a BulletRigidBodyNode. But I need to get access to the NodePath and I don’t want to store it in the pythonTag. So here’s my first problem: I wanted to use NodePath(bulletNode) or NodePath.anyPath(bulletNode) to retrieve the np. However, both functions complain about the type, requiring PandaNode. But BulletRigidBodyNode is a subclass of PandaNode… If there is some type check under the hood maybe it should be changed to allow for subclasses of PandaNode?
-
Ok, so I actually bypassed the above problem by using NodePath(bulletNode.makeCopy()) where makeCopy() returns a PandaNode. I was afraid that the copying would destroy the link to the NodePath but after testing, the position matches that of the original BulletRigidBodyNode. But now, a strange thing: while bulletNode.getBounds() return a nice (round ) sphere, after I get the nodePath with the above method, both nodePath.getBounds() and nodePath.node().getBounds() return an empty bounding volume (it complains when I try to getRadius() of the bounding sphere). I am trying to understand - what is happening here? Is it because of the copying? Does the the retrieved nodePath point only to the copy and not to the original bulletNode?
Or is there a better way of solving my goal from point 1)?