I recently started testing out all the collision detect things and I came across a problem. Whenever I search for the collision wall its fine but when I make it visible I get a weird error saying:
Self.walls.node<>.setIntoCollideMask<BitMask32.bit<0>>
AssertionError: !is_empty<> at line 269 of c:\p\panda3d-1.5.4\panda\src\pgraph\nodePath.I
press any key to continue ...
My main code is: (When you unquote the things in the middle it stops working)
import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import CollisionTraverser,CollisionNode
from pandac.PandaModules import CollisionHandlerQueue,CollisionRay
from pandac.PandaModules import AmbientLight,DirectionalLight
from pandac.PandaModules import Vec3,Vec4,BitMask32
import sys
class world(DirectObject):
def __init__(self):
self.title = OnscreenText(text="CarTest (esc to exit)",
style=1, fg=(1,1,1,1),
pos=(0.87,-0.95), scale = .07)
self.accept("escape", sys.exit)
base.disableMouse()
base.camera.setPosHpr(0, -92.02, 66.49, 0, 324.16, 0)
self.loadModels()
dlight = DirectionalLight('my dlight')
mainLight = render.attachNewNode(dlight)
render.setLight(mainLight)
mainLight.lookAt(self.map)
self.walls = self.map.find("**/mapWall")
self.walls.node().setIntoCollideMask(BitMask32.bit(0))
self.walls.show()
def loadModels(self):
self.map = loader.loadModel("models/map")
self.map.reparentTo(render)
self.map.setPosHpr(0, 0, 0, 0, 0, 0)
w = world()
run()
and, I know this is getting pretty long, my model code, only the part with the collision, is:
<Group> map {
<Collide> mapWall { Polyset keep descend }
<Transform> {
<Matrix4> {
-41.655731 0.000000 0.000000 0.000000
0.000000 -41.655731 0.000000 0.000000
0.000000 0.000000 -41.655731 0.000000
0.000000 0.000000 0.000000 1.000000
}
}
<VertexPool> map {
<Vertex> 0 {
41.655762 41.655731 0.000000
}
<Vertex> 1 {
40.814232 41.655731 0.000000
}
<Vertex> 2 {
Thank you for taking the time to look at this.
Everyone here is always helpful
P.S. Thanks for the help because Im new and only 13.