This may be a stupid one, but I need your help
here is my simple code to capture the collision to the queue…down below
print self.queue.getNumEntries()
for i in range(self.queue.getNumEntries()):
entry = self.queue.getEntry(i)
path = CollisionEntry.getIntoNodePath(entry)
fPath = CollisionEntry.getFromNodePath(entry)
but, I cannot use getSurfacePoint to capture the point
CollisionEntry.getSurfacePoint(path)
and this is an error I found…
TypeError: descriptor 'getSurfacePoint' requires a 'libpanda.CollisionEntry' object but received a 'libpanda.NodePath'
Another question…
I guess CollisionEntry is static class right? because i cannot create object (instance) from it.
please show me the way…Thannnnnnnnnnnnnkkkkk youuuuuu…
The collisionentry functions are not static functions. Call them on the entry instance:
print self.queue.getNumEntries()
for i in range(self.queue.getNumEntries()):
entry = self.queue.getEntry(i)
path = entry.getIntoNodePath()
fPath = entry.getFromNodePath()
Your surface point request failed because it needs a nodepath where the position must be relative to. Try this:
entry.getSurfacePoint(render)
I replaced path with render, because I take it you want an absolute position. If not, change it back to path.
Thank Yooooooou
i got it
and sorry since i busy all day
…
So,Is there relation between CollisionEntry and CollioionQueue
and I understand that getEntry() function will return the reference of
CollisionEntry right…oh
A CollisionQueue lists all the things colliding in a list of CollisionEntries. By calling getEntry(0), you get the 0th entry in the list of collisions.