Hello
I got a problem with this example picking function from the manual. If i click on the node that is ‘clickable’ alias tagged, it works properly. But when i click on empty space it asserts with the following error:
Here is the function, its a 1:1 copy of the function myFunction from the manual:
def mouse1Clicked(self):
mpos = base.mouseWatcherNode.getMouse()
self.pickerRay.setFromLens(base.camNode, mpos.getX(), mpos.getY())
base.cTrav.traverse(render)
if self.collisionHandler.getNumEntries > 0:
self.collisionHandler.sortEntries() # Damit das vorderste als erstes erkannt wird
pickedObj = self.collisionHandler.getEntry(0).getIntoNodePath()
pickedObj = pickedObj.findNetTag('pickableTag')
if not pickedObj.isEmpty():
print "clicked"
Akta