[ODE] Ray - TriMesh collision Problem - Help request

Shamyl Zakariya shamyl at zakariya.net
Thu Feb 8 08:03:03 MST 2007

How are you retrieving the ray-trimesh contacts?

When I first implemented something like this I had special case code  
in my general purpose nearCallback which detected if one geom was a  
ray, and then gathered up the contacts and forwarded them to the  
"owner" of the ray, which was referenced through the ray's void *  
data field. I missed a lot of contacts, ostensibly at random, when I  
did this.

I went to an alternate approach where rays aren't added to the  
world's collision space and manually perform collision detection.  
This has worked very reliably for me. That being said, it may not be  
the best way to do this. A lot of ODE usage is experimenting with  
your fingers crossed :p


I hope this helps.

shamyl at zakariya.net
   "Our response to being bored and rich is not to discard
   possessions and live more simply, but to buy more stuff
   to reduce the space in which we might contemplate
   our shame."

On Feb 8, 2007, at 9:19 AM, Pawel Kmiotek wrote:

> Yes tried befort to change the number of contacts but it changed  
> nothing :(.
> Nevertheless thank very much you for interest. I apreciate it.
>>>> Hello !
>>>> I have problems with Ray vs Trimesh collision.
>>>> I'm tring to implement a sensor ( range finder ) based on rays.
> Thus I
>>>> only detect collisions but do nothing about it.
>>>> Below there are links to screenshots represent correct collision
> detection and incorect one.
>>>> The almost-cube building is a Box while the more-rectangular one  
>>>> is a
>>>> TriMesh. As you can see collision with box always produces correct
> collisions, while trimesh not.
>>>> I've used OgreOde with ODE-0.7 and 0DE-0.8-rc1. I hoped that
> version 0.8
>>>>  will bring me a resolution but nothing of that kind. I have also
> found
>>>> in the mailing list archives comment:
>>>>  "The GIMPACT code seems to work, there is only an issue left with:
>>>> dGeomTriMeshDataBuildSimple
>>>> which as far as I know is not solved yet"
>>>> (http://ode.org/pipermail/ode/2007-January/021323.html)
>>>> OgreOde uses mentioned funtion to create a trimesh. May it be a
> source
>>>> of my problems ?
>>>> http://www.prinel.pl/Good-From-Above.jpg
>>>> http://www.prinel.pl/Good-From-Below.jpg
>>>> http://www.prinel.pl/Bad-From-Above.jpg
>>>> http://www.prinel.pl/Bad-From-Below.jpg
>>>> Maybe the following problem were already covered somewhere but I
> haven't
>>>> found any relevant information.
>>>> I would be grateful for any piece of advice how to solve the  
>>>> problem.
>>>> Best regards,
>>>> Pawel
>> Hi !
>>> Is there anybody who can bring some light to the aforementioned
> problem
>>> ? I would really appreciated it. It is really important to me  
>>> since it
>>> is the crucial part of my project.
>>> Since my english if far cry from being perfet my description may be
> not
>>> clear engough. If so, please let me know and I'll rewrite it
> putting it
>>> in different words. If there are, in your opinion, any details  
>>> missing
>>> please let me know I'll provide them.
>>> Best regards,
>>> Pawel
> Could it be that you have not set a sufficient number of contacts  
> on the
> trimesh? It seems that a
> number of rays do work as expected.
> (I have never used Rays in ODE, I'm not sure if the number of contacts
> could be a cause.)
> Martijn
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://mooshika.org/mailman/listinfo/ode

More information about the ODE mailing list