Hi!
I want the car in my game to drive over uneven terrain. For now I added this line in the code of my street.egg file:
<CoordinateSystem> { Z-Up }
<Group> character {
<Dart> { 1 }
<Group> "Scene Root" {
<Group> street {
<Collide> { Polyset keep descend }
<VertexPool> street.verts {
<Vertex> 0 {
-91419.6 5516.13 -543.893
<Normal> { 0 0 1 }
}
...
is the street now imported twice? one time as a geometry node and one time as a collision node?
for my car i am using a collision ray for now. but unfortunatly no collisions are detected.
To initialize the car as my fromObject i took basicly the code of the roaming ralph tutorial for now.
def enableCollisionHandler(self):
self.cTrav = CollisionTraverser()
self.carGroundRay = CollisionRay()
self.carGroundRay.setOrigin(0,0,1000)
self.carGroundRay.setDirection(0,0,-1)
self.carGroundCol = CollisionNode('carRay')
self.carGroundCol.addSolid(self.carGroundRay)
self.carGroundCol.setFromCollideMask(BitMask32.bit(0))
self.carGroundCol.setIntoCollideMask(BitMask32.allOff())
self.carGroundColNp = self.carMain.attachNewNode(self.carGroundCol)
self.carGroundHandler = CollisionHandlerQueue()
self.cTrav.addCollider(self.carGroundColNp, self.carGroundHandler)
# Uncomment this line to see the collision rays
self.carGroundColNp.show()
#Uncomment this line to show a visual representation of the
#collisions occuring
self.cTrav.showCollisions(render)
print self.cTrav.getNumColliders()
In the mainLoop I added this code to check if collisions are detected:
self.cTrav.traverse(render)
print self.carGroundHandler.getNumEntries()
Unfortunatly there are no entries of any collsisions in this list… Does anybody know what I made wrong?