Gonsor
06-12-2008 19:15:51
Well I read some docs and worked through the demos of Bullet and I currently write my own wrapper module for bullet in python.
However, I'm stuck with the debugger but I think, it could be a very basic python mistake.
According to doxygen and all c++ samples I saw, you just need to create a class, which inherits from btIDebugDraw and must at least implement a "drawLine" method.
So this should work:
The debugger is then set to the world by calling "self.world.setDebugDrawer"
This works for me in C++.
However, if I do this in python, the updating method "self.world.stepSimulation" will always fail with a "TypeError: 'NoneType' object is not callable".
I tried adding it to the python-ogre bullet demo and it's the same result -
just add
somewhere before the world.stepSimulation calls in python-ogre/demos/bullet/test01.py
Any ideas?
Best regards,
Gonsor
However, I'm stuck with the debugger but I think, it could be a very basic python mistake.
According to doxygen and all c++ samples I saw, you just need to create a class, which inherits from btIDebugDraw and must at least implement a "drawLine" method.
So this should work:
class DebugDrawer(bullet.btIDebugDraw):
def drawLine(self, lineFrom, lineTo, lineColor):
print "Draw debug line"
The debugger is then set to the world by calling "self.world.setDebugDrawer"
This works for me in C++.
However, if I do this in python, the updating method "self.world.stepSimulation" will always fail with a "TypeError: 'NoneType' object is not callable".
I tried adding it to the python-ogre bullet demo and it's the same result -
just add
class DebugDrawer(bullet.btIDebugDraw):
def drawLine(self, lineFrom, lineTo, lineColor):
print "Draw debug line"
debug = DebugDrawer()
world.setDebugDrawer(debug)
somewhere before the world.stepSimulation calls in python-ogre/demos/bullet/test01.py
Any ideas?
Best regards,
Gonsor