I am a PHP/Python programmer, and a long time game modder. I have been working with game engines right back to Doom. Now generally I do the art part, but I have become curious about playing with some open source engines, and when I noticed a python binding for irrlicht, I got all excited and started hacking at it. Now before you start with all the, use C++ its better; or python is slow, or any number of those variations. I like python. Hell, I wish there was a PHP binding, now that would be cool. But anyway, I am going to play with this by using Python. I just don't want to get back into C++, I hated it when I worked on a Half Life mod, I am certain I would hate it now. With all that said and out of the way, I am hoping someone can shed some light on a problem I seem to be experiencing.
I have this code below, that is supposed to generate a collision selector from the bsp octree. I then apply the collision selector response animator to a FPS camera, setting some parameters; attaching it at the end.
When I run this code, I get the map loaded and rendered. I get my camera, which I can control. I get some collision detection. I can still walk through walls, but I do not seem to fall through floors. Its a little more complex than that, but in short the collision detection does not work. I have compiled the c++ tutorial, and of course it works.. this python version of the base part of it should work, but does not. I think its got something to do with a flaw in the python binding. I would post it on the Yammo forums, but the registration seems to be broken. Any one have an idea, or has anyone been able to make collision detection work properly under Venom?
Code: Select all
mainmap = venom.LoadMesh( "map.bsp" )
mapNode = venom.AddOctTreeNode( mainmap )
selector = venom.CreateOctTreeSelector( mapNode, mainmap )
venom.SetSelector( mapNode, selector )
venom.SetNodeID( mapNode, 1 )
venom.SetPosition( mapNode, ( -1370.0, -130.0, -1400.0 ) )
cam = venom.AddFPSCamera( )
FPSCollision = venom.CreateCollAnimator( selector, cam)
venom.SetCollAnimatorRadius( FPSCollision, ( 30, 50, 30))
venom.SetCollAnimatorGravity( FPSCollision, ( 0, -1000, 0))
venom.SetCollAnimatorPosition( FPSCollision, ( 0, 50, 0))
venom.AttachAnimator( cam, FPSCollision)