Ray query mask type sufficient?

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Lax
Hobgoblin
Posts: 583
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 50

Ray query mask type sufficient?

Post by Lax »

Hello all,

I'm using ray scene query masks intensively in my projects. I know that its possible to have 32 different types.

More precisely setQueryMask takes a 32bit unsigned int, so the values can go up to 1<<31

But I'm now starting to encounter issues, as I'm using query masks for categories, like house, car, object etc. so 32 types are not sufficient.

I wonder, if it would be possible for Ogre2.x to go up using unsigned long (64bit) for masks, so that more different types could be queried.
Or is there another trick, how to pack more types?

What do you think?

Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

hyyou
Gremlin
Posts: 173
Joined: Wed Feb 03, 2016 2:24 am
x 17
Contact:

Re: Ray query mask type sufficient?

Post by hyyou »

Probably not the answer you are looking for ....

I love to query such thing from Physic-specific library e.g. Bullet, instead.
http://bulletphysics.org/mediawiki-1.5. ... ng_RayTest

It is a free library like Ogre and has the feature (>32 ray test) that you want.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1279
Contact:

Re: Ray query mask type sufficient?

Post by dark_sylinc »

hyyou is probably right. Such detail is asking for a more specialized library.

There is still something you can do though.
SceneQuery::mFirstRq and SceneQuery::mLastRq are public variables and you can modify them. This lets you constrain the search to particular groups of RenderQueues; thus you could use this to extend what the visibility flags mean depending on the render queue you're on.

However altering the RenderQueue in which an object lives affects render order, which may impact performance (either positively, negatively, or the change is negligible) or visual correctness (e.g. transparent objects should be rendered back to front)
Lax
Hobgoblin
Posts: 583
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 50

Re: Ray query mask type sufficient?

Post by Lax »

Hi,

hm sounds a bit of complicated and hacky for me. I naively thought, that changing the query mask data type from unsigned int to unsigned long would be sufficient...

Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

Post Reply