Beam scenenode

A forum to store posts deemed exceptionally wise and useful
salligtatorp
Posts: 1
Joined: Thu Oct 21, 2010 5:16 pm
Location: Belgium

Post by salligtatorp »

[EDIT] sorry, figured it out, used wrong materials on the billboards...
Last edited by salligtatorp on Thu Jun 02, 2011 10:32 pm, edited 1 time in total.
vicviper
Posts: 4
Joined: Mon May 26, 2008 10:13 am

Post by vicviper »

Hi

Just checked the code of the Beam scene node, and I noticed there's the bounding box "Box" member object, which is not being initialized anywhere in the code provided.

Should be initialized inside the setLine method, I pressume?

I suspect if that's the case, it's been working for most people because it's being initialised with random values, probably generating a quite large bounding box.
bigbman
Posts: 23
Joined: Thu Nov 04, 2010 6:35 am

Post by bigbman »

Any example or version without textures (just solid/alpha color)?
pippy3
Posts: 155
Joined: Tue Dec 15, 2009 7:32 am

Post by pippy3 »

If you're having trouble with the beam disappearing it's because the backspace culling is incorrectly removing it.


The bounding box is incorrectly set so irrlicht thinks the beam is behind the camera. To fix this change Saudi's solution thusly:

Code: Select all

       void CBeamNode::setLine(core::vector3df start, core::vector3df end, f32 thickness) 
        { 
            m_start = start; 
            m_end = end; 
            m_thickness = thickness; 
			Box.addInternalPoint (start);
			Box.addInternalPoint (end);
        } 
micha3l512
Posts: 1
Joined: Wed Apr 13, 2011 4:40 pm
Location: 224

Post by micha3l512 »

hi i'm pretty new to irrlicht and i'm trying to use this code in an FPS game and i'm not getting any results.
i'm trying to use this as a laser beam for a gun.

i have tried changing the beam scale to make sure that its visible.
but so far i have not gotten anything to display on screen.
Post Reply