[fixed]Cameras showing up in collisions
[fixed]Cameras showing up in collisions
Should isVisible return true for the scene camera? I can't see why it should but maybe someone knows a reason?
Maybe we could add:
if (IsVisible && getType != ESNT_CAMERA)
return IsVisible;
return IsVisibile;
Or is there a better patch to ignore cameras in the code that sets this flag?
Maybe we could add:
if (IsVisible && getType != ESNT_CAMERA)
return IsVisible;
return IsVisibile;
Or is there a better patch to ignore cameras in the code that sets this flag?
Re: ISceneNode:: isVisible returning true for cameras
It's a little tricky as isVisible() is not exactly defined in Irrlicht. For most nodes it has 2 meanings - register this node for rendering _and_ call OnRegisterSceneNode for children. For the default Irrlicht camera it only has the second meaning as registration depends on the camera being the active camera instead. Thought custom cameras can decide to do different.
I think just returning the IsVisible flag makes most sense. Why you want/need a change?
I think just returning the IsVisible flag makes most sense. Why you want/need a change?
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: ISceneNode:: isVisible returning true for cameras
Thanks, that´s good to know!
I added the code above to have the camera return not visible and everything seems to work fine.
Could it be the camera isn't registering now? What would be the effects?
I added the code above to have the camera return not visible and everything seems to work fine.
Could it be the camera isn't registering now? What would be the effects?
Re: ISceneNode:: isVisible returning true for cameras
No, what I meant to write above is - the camera is the one node that doesn't use this for registering itself (the active scenecamera is always registered instead). It only uses it for registering it's children (same as other nodes - if you make a node invisible then all it's children are invisible as well).
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: ISceneNode:: isVisible returning true for cameras
Okay thanks for that. But usually cameras don't have children right? I mean why would they?
Re: ISceneNode:: isVisible returning true for cameras
One place where I know it's used: Put a mesh at the camera positions in 3d-editors.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [no bug]ISceneNode:: isVisible returning true for camera
But for that a call to get activecamera would do, no?
Okay so maybe rather than doing the check in all call to is visible, I could add an isVisible function to ICameraSceneNode, would be more efficient and flexible?
Okay so maybe rather than doing the check in all call to is visible, I could add an isVisible function to ICameraSceneNode, would be more efficient and flexible?
Re: [no bug]ISceneNode:: isVisible returning true for camera
I don't think you understood what I meant. In 3D editors you can have a lot of cameras placed all over the scene. And you want to see them all at once - so you attach a node with a mesh below them. And yeah - there are other ways.
But I still don't understand something - what problem are you actually having with this? I don't get yet where this causes trouble for you.
But I still don't understand something - what problem are you actually having with this? I don't get yet where this causes trouble for you.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [no bug]ISceneNode:: isVisible returning true for camera
Okay so with editors there are cameras for all the views, and they can be switched to, but are cameras rendered, like in Blender, as a sort of outline camera?
During hits where you have a point in 3D space and a vector, calling the usual function... what's its name,... even though I have one camera, it finds the camera first each time, so I thought I would just have it invisible, then I get the correct node in the line.
I guess I could use mask bits, but I wanted to find any node in the line, apart from the camera.
During hits where you have a point in 3D space and a vector, calling the usual function... what's its name,... even though I have one camera, it finds the camera first each time, so I thought I would just have it invisible, then I get the correct node in the line.
I guess I could use mask bits, but I wanted to find any node in the line, apart from the camera.
Re: [no bug]ISceneNode:: isVisible returning true for camera
Cameras have no geometry, but maybe they get hit by their bounding-box in some functions. Please try to find out that function's name, maybe it can be solved in another way :-)
edit: You can also work with node-id's to exclude nodes. But shouldn't be necessary for cameras.
edit: You can also work with node-id's to exclude nodes. But shouldn't be necessary for cameras.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [no bug]ISceneNode:: isVisible returning true for camera
I call getSceneNodeFromScreenCoordinatesBB(), that function then calls another ending in BB which hits the camera.
I tried to hit the skydome but tracing through found that it has no bounding box. The idea is to be able to detect whatever object was hit.
Why would a camera without geometry have a bounding box? Or am I missing something?
I tried to hit the skydome but tracing through found that it has no bounding box. The idea is to be able to detect whatever object was hit.
Why would a camera without geometry have a bounding box? Or am I missing something?
Re: [no bug]ISceneNode:: isVisible returning true for camera
Don't know yet - I'll have to write a test-case and debug it myself.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [no bug]ISceneNode:: isVisible returning true for camera
I see - it returns the bounding-box of the frustum. Which is kinda pointless as one can get that already from the frustum and it messes up this situation. But changing it now might break existing code. *sigh*... maintaining code is frustrating.
edit: *doublesigh* - it was different originally, but changed a few years ago without a single comment in the log as to why it might have been necessary to change it.
edit: *doublesigh* - it was different originally, but changed a few years ago without a single comment in the log as to why it might have been necessary to change it.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [no bug]ISceneNode:: isVisible returning true for camera
OK, I've added a few changes in svn trunk (r5094) which should make this work for you. The camera has now an empty boundingbox and the collision functions ignore empty boundingboxes. I'm rather surprised no one complained about this before - it's a rather strange default behavior.
I hope those changes don't break code. It's pretty crazy - someone even wrote a few tests for exactly that behavior. But again they are all without any explanation as to _why_ this behavior would make any sense. So maybe there was a good reason - but I really can't see it. I mean who expects camera-frustum boundingboxes to show up in node-collisions?
I hope those changes don't break code. It's pretty crazy - someone even wrote a few tests for exactly that behavior. But again they are all without any explanation as to _why_ this behavior would make any sense. So maybe there was a good reason - but I really can't see it. I mean who expects camera-frustum boundingboxes to show up in node-collisions?
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [fixed]Cameras showing up in collisions
I always just set the cameras to debugobjects and then not collide against them