Issue with scene graph

Hello everyone,

I’ve been trying to fix this one issue for a long time now, but I always resorted to workarounds. However I’m at a dead end now. That’s why I am asking you for help.
I am currently trying to “simulate” our solar system in OpenGL + GLEW + SDL + ImGUI + Windows. I’ve created my very own framework to work with.
The scene graph contains a root element of the type “Node”. Every object of the class “Node” has a pointer to a parent and a vector of the type “Node”, which are supposed to be the children. Actually everything is working. I am recursively iterating though the scene graph and my planets do what they are supposed to do. However I need the world transform matrix of each planet for ImGui and my Camera Class. But the matrices are not being returned correctly. I even know where the issue is, so the picture below is going to show my function that recursively iterates through my scene graph

600dd3e2403caf3d0784cb189b43e594

In line 97 I am only making a copy when iterating in the for loop. Instead it should be “(Node& itChild : it.getChildrenList())”. This makes it impossible to get the correct world transform matrices since I am not actually using the children but a copy. However if I change it to reference, the sun will spin like crazy and all the other planets are not visible. It seems like the transforms are not being applied to the planets correctly anymore. I want to create a little window where you can press on a button labeled with the planet’s name and then the camera is supposed to follow the planet around the solarsystem. Kind of like a third person camera.
If possible I want you to look at my node.hpp and node.cpp file and tell me what I have to change. I’m going to add the files to this post’s attachments!
Any help is highly appreciated!

hi newb
this is an old post but, if you still need help:
There seems to be a spelling-error in
if(lit.getChildrenList().empty()){…}
that would be relatable to the problem at hand.
About the rotation-velocity of the sun: you may have to add a timer to make sure that different gpu’s & framerates doesn’t present the movements in different speeds.

Before I noticed that, I wrote:
I’ve never worked with a scene-graph, but figure that it has something to do with this:
The consept of node and node-tree allows descendants to adopt traits from parents. If you reduce a node to a 3d-point … it has position and orientation. Your system don’t have the same dependancy on the parent as would a skeleton with joints.

My penny’s worth …