From: Timothy S. <ti...@st...> - 2004-10-08 11:05:20
|
Hello, I've finally been able to get OSG and PyOSG built and installed. On Sat, 2004-10-02 at 22:33, brett hartshorn wrote: > I have ported tutorial2.py and tutorial3.py to use PyOSG as the renderer,= i thought > that someone may want to include them in CVS because i think it might be = another good > example.=20 They're pretty cool. I have two suggestions, if you're interested: 1. In tutorial2_osg.py, start with the camera further away from the blocks and facing them. 2. In tutoiral3_osg.py, add a little more light and colour the base plane. > Also attached is the file named tutorial3_osg_segfault.py. This file wil= l crash when you > run it because it seems that if more than 34 bodies collide at once (at l= east on the first > frame if they are all intersecting), then pyODE will crash by segmentatio= n fault. After testing it on my computer, it segfaults if here are more than 68 objects. I've done some looking but I can't work out what's causing it. The segfault occurs in world.step() or world.quickStep(). My investigation found two potential problems: 1. Body.setMass() takes a Mass object argument. It doesn't keep a reference to it but uses its dMass Mass._mass for dBodySetMass(dBodyID, const dMass *mass). If the Mass object is deallocated, ODE could still try to access it. 2. ContactJoint uses Contact objects for ODE calls without keeping references. ODE might still try to access it even if the Contact object has been deallocated. I'm not entirely sure if the above points are correct because none of the tutorials ever crash even though they could by the above mechanisms. Also, fixing them doesn't fix the segfault problem above. What do you think? --=20 Timothy Stranex <ti...@st...> |