optimized triangle lists?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Sean H.
Posts: 21
Joined: Mon Aug 06, 2007 12:25 am

optimized triangle lists?

Post by Sean H. »

Im going through the api looking at the triangleselector documentation and Im seeing this for selecting triangles based on bounding box:

"Please note that unoptimized triangle selectors also may return triangles, which are not in the specific box at all. "

what is the difference between optimized and unoptimized triangle selectors?
Sean H.
Posts: 21
Joined: Mon Aug 06, 2007 12:25 am

Post by Sean H. »

still waiting on a reply to this one. :roll:

was this already discussed somewhere else? should I even worry about this?

I really just want to know if the methods for selecting triangles are reliable.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

All it means is that some of the selectors don't do what the function requirements say it does. For example...

Code: Select all

virtual void irr::scene::ITriangleSelector::getTriangles  (  core::triangle3df *  triangles,  
  s32  arraySize,  
  s32 &  outTriangleCount,  
  const core::aabbox3d< f32 > &  box,  
  const core::matrix4 *  transform = 0 
 )  [pure virtual] 
 
   Gets all triangles which lie within a specific bounding box. Please note that unoptimized triangle selectors also may return triangles, which are not in the specific box at all. 

Parameters:
 box,:  Only triangles which are in this axis aligned bounding box will be written into the array.  
The parameters description for box says that the method only returns triangles that are inside the box. The note is a disclaimer that says not all triangle selectors do this. So from your perspective, this means that you get to go through and test the returned triangles to see if they are in the box, right after you call the method that is supposed to do that for you.

Travis
Sean H.
Posts: 21
Joined: Mon Aug 06, 2007 12:25 am

Post by Sean H. »

well it's fine if the triangle selector method returns a few triangles which aren't in the box. at the very least Ill get a smaller subset of triangles to test against. I just hope the method won't miss triangles which really are inside the box.

thanks for the help vitek.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

well it's fine if the triangle selector method returns a few triangles which aren't in the box.
Just FYI, it probably won't be just a few extra triangles. Depending on the function you are calling some of the selectors return every one of their triangles.

The bounding box and plain selector return all triangles, even if the box is miles away from the nearest vertex. The terrain selector and the oct tree selector are more friendly.

Travis
Sean H.
Posts: 21
Joined: Mon Aug 06, 2007 12:25 am

Post by Sean H. »

hmmm... well that just sucks.
Post Reply