mouse picking - performance question

Nudel

08-01-2007 18:21:09

I was wondering, what would be the best way to realise mouse picking for every object in an ogre scene. Creating a nxOgre scene with all entities of the ogre scene solely for the purpose of picking objects just doesnt sound right to me. I dont know how good it works speed wise, if every object in the scene is a static body, but it would mean 2x as much meshes in the memory. And because the bodies in the mouse pick scene would have to be static bodies, id have to recreate them in the mouse pick scene whenever they move in another nxOgre or an ogre scene.
Doing an ogre raycast first to get all objects according to their bounding boxes and only create a nxogre scene with those does not seem to be the best solution either, as you may have to load quite a lot of objects on a mouse click.

betajaen

08-01-2007 19:37:56

I wouldn't worry about speed.

I'm pretty sure when PhysX raycasts, it quickly raycasts down to the bounding box/sphere level, if it gets anything then it get's it down to the polygon level. But since that system is used all the time, the code is very fast.

I'd worry about accuracy myself, and NxOgre is the most accurate.