Hello Sajjadul,

Sajjadul Islam wrote:
> Thanks for the code snippet. it did compile and ran. I made some stupid 
> mistakes. Now the the application that i m trying to develop crushes 
> with some key press event.
> 
> So i am trying to elaborate the design issue to you so that you can help 
> me think in a right way.
> 
> I want to choose one of the 3 different types of lights with key-press 
> event and generate GPU shader for three different types of lights.
> 
> 1. I have a root scene and has 4 children ; DirectLight, PointLight, 
> SpotLight and Beacon node. Each light has the corresponding core and 
> each of their beacon refer to  the Beacon node
>    which contains the transformation core.
> 
> 2. While creating the scene graph i have set a particular node to be the 
> children of one of the light nodes which is subject to change with  the 
> key press event to illuminate that node
>     with different lights.
> 
> 3. That particular node is actually a loaded object using the 
> SceneFileHandler. And i m applying the GPU shader to that using 
> SwitchMaterial.
> 
> 
> When i want to choose different light with key press event the program 
> crashes with  the following error:
> 
> [EMAIL PROTECTED]:~/myOpenSG/shader$ ./shadeMe
> WARNING:  SHLChunk: link status:  Link successful. The GLSL vertex 
> shader will run in hardware. The GLSL fragment shader will run in hardware.
> spot light crash 0
> shadeMe: /usr/local/include/OpenSG/OSGNodeImpl.inl:86: osg::NodePtr 
> osg::Node::getChild(osg::UInt32): Assertion `(childIndex < 
> _mfChildren.size())' failed.
> Aborted (core dumped)

hm, as the assertion says, you are trying to access a child that is not 
there. You will have to examine your code to find out why it is not 
there even though you expect it to be.
Maybe you made that particular child a child of some other Node? Then it 
would have been removed from its previous parent as Nodes can have at 
most one parent at a time.

> Another issue about RefPtr<>. Consider the following scenario:
> 
> 
> RefPtr<NodePtr> utahTransformNode;
> 
> /*
> create a global transform pointer
> that will be updated in the display
> function
> */
> RefPtr<TransformPtr> utahTransformCore;
> 
> /* The above variables are in the global scope*/
> 
> utahTransformNode = makeCoredNode<Transform>(utahTransformCore;);
> 
> I have error while compiling. Even though i worked around the compiler 
> error. I would like to know what is conceptually wrong here.
> The error says:
> 
> No matching function call.

Hm, can you send the complete error message please, normally they say 
something like: "No matching function call for <some function>". The 
interesting part is the <some function> because it shows what the 
prototype of the function that the compiler wants to call is and usually 
gives a decent hint of what went wrong.

        Thanks, 
                Carsten


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to