[ODE] get triangle index of a trimesh

Jaroslav Sinecky sinecky at telefonica.net
Sun Apr 23 07:56:32 MST 2006


It didn't get it over to the maillist, I guess it's still waiting for 
approval, because it exceeded size of 10kB, or something like that. I 
didn't bother because there was a better proposal - adding feedback 
field in the contact struct and Geoff Carlton was going to send a patch 
for that, which didn't happen yet.
Nevermind, I can change my code to store the index in feedback field, 
which is really minor change and apply it to svn.
Or Geoff, will you send your code?

Ettore Pancini wrote:
> quite strangely i can't find the original mail from Sinecky Jaroslav
> neither in the archives nor in my inbox. someone has this patch?
>
>     ----- Original Message -----
>     *From:* vicente conejeros <mailto:vicenteconejeros at hotmail.com>
>     *To:* ODE mailing_list <mailto:ode at q12.org>
>     *Sent:* Friday, March 10, 2006 21:05
>     *Subject:* Re: [ODE] get triangle index of a trimesh
>
>     thanks :D
>
>         ----- Original Message -----
>         *From:* Jaroslav Sinecky <mailto:sinecky at telefonica.net>
>         *To:* adastra at inorbit.com <mailto:adastra at inorbit.com> ;
>         vicente conejeros <mailto:vicenteconejeros at hotmail.com>
>         *Cc:* ODE mailing_list <mailto:ode at q12.org>
>         *Sent:* Friday, March 10, 2006 10:21 AM
>         *Subject:* RE: [ODE] get triangle index of a trimesh
>
>         So here goes the patch, maybe someone finds it useful or you
>         can include it in unstable. It's pretty simple: after dCollide
>         returns, call
>          
>         int triIndex = dGeomTriMeshGetTouchedTriangle(g1, contactIndex);
>          
>         where contactIndex is the index in the list of returned
>         contacts and g1 is the Trimesh geom involved in the collision.
>          
>         disclaimer:
>         - Not implemented for ray or plane colliding with trimesh.
>         Suppose should be similarily easy to implement though.
>         - There is static buffer (64) to hold indexes. I believe if
>         this overflows, it shouldn't crash, just some asserts will
>         come out.
>         - It's not completely robust, for example if you send
>         contactIndex not consistent with immediately preceding
>         dCollide call, result is undefined
>          
>         Performance impact should be negligible though.
>          
>          
>         Cheers,
>         Jaroslav
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>   


More information about the ODE mailing list