Hi,
I have a problem : my collision solid are not at the right position, they shift their position the more they are distant from the center.
See the picture :
http://img594.imageshack.us/img594/6408/screenshot2010102701143.png
The sphere should be at the same place as the plants.
Here is my code :
self.forest = render.attachNewNode("Forest Root")
self.nbFood = randint(self.minNbFood, self.maxNbFood)
for i in range(self.nbFood):
t = loader.loadModel("models/shrubbery")
t.reparentTo(self.forest)
t.setScale(0.1)
t.setPos(
(randint(0, self.floorSize-1) - (self.floorSize / 2)) * self.flagSize,
(randint(0, self.floorSize-1) - (self.floorSize / 2)) * self.flagSize,
0)
tColl = CollisionSphere(
t.getX(),
t.getY(),
t.getZ()),
10)
tCollNodePath = t.attachNewNode(CollisionNode('tCollNodePath'))
tCollNodePath.node().addSolid(tColl)
tCollNodePath.show()
Hopping someone can help me.
Thank you.