Raytest Timing

aleradish
Posts: 22
Joined: Thu Mar 05, 2009 9:41 pm

Raytest Timing

Post by aleradish »

Hi,

I'm making for my thesis some experiment on the performance of the Bullet Raytest on btCollisionWorld..
I have different raytest timing in the various tables that give me different raytest time from differents position of raytest. :shock: The average of raytest in different position of raytest are different.
I check that I didn't make any mistakes in my code... but it seems ok. I thought that It can be raytest method that have to check different number of elements in differents position in my scene. It can be true or.. it's a problem in mode that I use bullet or in my program?

Thank you
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Raytest Timing

Post by Erwin Coumans »

This is to be expected. The Bullet raycast methods use an iterative method to raycast against convex and convex shapes. In some cases (in particular when a ray nearly misses/hits) it might cost more iterations to get to a solution.

Convex collision shapes can have a collision margin, and ray tests take this into account, to be consistent with the regular collision detection. See also Bullet/Demos/Raytracer where the ray tracer (using rayTest method) produces rounded corners due to the collision margin:
shapes.jpg
Of course a dedicated, optimized ray-triangle will be faster than Bullet iterative method, but it will not support collision margins on arbitrary convex shapes.
What kind of collision shapes are you testing against exactly?
Thanks,
Erwin
You do not have the required permissions to view the files attached to this post.
aleradish
Posts: 22
Joined: Thu Mar 05, 2009 9:41 pm

Re: Raytest Timing

Post by aleradish »

I made a system that uses differents kind of bounding Volume. I have a Ogre3D scene and automatically get the entities of the 3d engine and put them into bullet with spheric BV, OBB, AABB. Then I make for my thesis different kind of Raytest, with different number of rays.. and I need, for each of these BV shape the Time and Accuracy.

But for Example, the time that I get are very strange. For example.. Only for single raytest on AABB i get the differents time (for each evaluations) that goes from 0.01 ms to 0.420ms. For Sphere raytest on center of BV, it goes from 0.089 to 0.22 . I've noted that the first value is always so low in ms.

I check for any my mistake but I didn't found anything. I tried now, to use instead of ogre timer the time.h time of c++ and is not a problem of ogre timer because the results are about the same.

Is not a problem for me...for my thesis if I arrive to understand why there are these differences ..

Do you think that these values have to vary only for kind of btCollisionObject? when I make raytest, are always checked the same number of object or this number vary in various position of raytest or a different number?
Do you think those results are understable for your knowledge of Physic Engine?

Thank you so so much... :) it's very important for me..