[maybe bug] SceneCollisionManager and invisible nodes

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
userdima
Posts: 22
Joined: Wed Jun 04, 2008 8:30 pm

[maybe bug] SceneCollisionManager and invisible nodes

Post by userdima »

Hey, should the function getSceneNodeAndCollisionPointFromRay skip invisible nodes? There
is the check for visibility, but it could only work for the node itself, not for its' children.

file CSceneCollisionManager.cpp

Code: Select all

 
if (selector && current->isVisible() &&
(noDebugObjects ? !current->isDebugObject() : true) &&
(bits==0 || (bits != 0 && (current->getID() & bits))))
 
I'm not sure if it is actually a bug, and if it is, I dont understand, why anybody haven't
found it already? :)

We just need to use the isTrulyVisible function here and if not dont call the recursive
function, because any af its children would not be visible.
Last edited by userdima on Wed Dec 21, 2011 5:48 pm, edited 1 time in total.
Sorry for my english, I'm from belarus!
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [not sure] SceneCollisionManager and invisible nodes

Post by CuteAlien »

No, colliding against invisible nodes is something you need in many games. I'm sure you've notice the invisible walls in many games, especially RPG's. Also often there is invisible collision geometry which is simpler than the real world-geometry (for speed reasons). Work with id's instead if you need to exclude nodes.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
userdima
Posts: 22
Joined: Wed Jun 04, 2008 8:30 pm

Re: [not sure] SceneCollisionManager and invisible nodes

Post by userdima »

Oh, ok, never mind then! :) I just thought that if isVisible is actually called here, then invisible nodes should be ommited. Ok, I understand now.
Sorry for my english, I'm from belarus!
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [not a bug] SceneCollisionManager and invisible nodes

Post by CuteAlien »

Ah sorry, you are right isVisible is actually used. OK, so picking nodes can only be done against visible nodes in which case using isTrulyVisible would indeed make more sense. Now I'm just not sure if the problem here is that isTrulyVisible should be used or that isVisible should not be used at all. I think those functions are mainly used for user-selection where regarding visibility indeed might make sense. But anyway - looks on first view indeed like a bug to me ... have to think somewhat about typical use-cases for that. Maybe it also needs another parameter.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply