[ODE] StackOverflowException due to dJointAttach

Hristo Hristov hhristov at delin.org
Fri Dec 1 05:35:50 MST 2006


darkrunic at aol.com wrote:
> Hi all,
>  
> I'm having a bit of a strange error here, which I've tracked down to
> dJointAttach (at least, I think I have.  When I comment it out I don't
> have the problem, though dJointAttach might just be the catalyst).
>  
> For testing, I've created a 10x10 'grid' of spheres and then I apply
> some force to one of them into the others and watch the chain reaction. 
> Besides the fact that I'm getting some seemingly excessive torque on my
> first sphere (still have some parameter tweaking to do), everything
> seems to be going okay...  that is, until I get about 30 seconds into
> the simulation, where I get a StackOverflowException (which, from what
> I've read, can be caused by excessive nested method calls?).  Here's the
> contents of my NearCallback method, maybe I'm just doing something
> stupid that one of you can point out to me.  Thanks for any input!
>  
> void CollisionCallBack(void* data, dGeomID o1, dGeomID o2)
> {
>     int maxContacts = 1;
>     dContactGeom* contacts = new dContactGeom[maxContacts];
>    
>     if (dCollide(o1, o2, maxContacts, contacts, sizeof(dContactGeom)) > 0)
>     {
>         for (int i = 0; i < maxContacts; i++)
>         {
>             dContact currentContact;
>             currentContact.geom = contacts[i];
>            
>             dJointAttach(dJointCreateContact(space->worldId, 0,
> &currentContact), dGeomGetBody(o1), dGeomGetBody(o2));
>         }
>     }

      delete [] contacts;
> }
> ------------------------------------------------------------------------
> *Check out the new AOL*
> <http://pr.atwola.com/promoclk/1615326657x4311227241x4298082137/aol?redir=http%3A%2F%2Fwww%2Eaol%2Ecom%2Fnewaol>.
> Most comprehensive set of free safety and security tools, free access to
> millions of high-quality videos from across the web, free AOL Mail and more.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode



More information about the ODE mailing list