Node able to have more than one parent?

Hello,



Is it possible for a jME Node to have more than one parent?

Obviously I don't know how to attach an image.  Someone please tell me how?

a) maybe you can use a sharednode. not everything works with a sharednode (couldn't get keyframe animations run using it), so this attempt might fail.

b) why don't you simply change the parent? do you need to render both versions at the same time?

Having two root nodes for the same scene would not work, spatial only has a reference to a single parent object.

Instead you need to render the same scene twice, use two RenderPasses with different enforced GLSLShaderObjectStates.

HamsterofDeath said:

a) maybe you can use a sharednode.
b) do you need to render both versions at the same time?

I'll try sharenode ... didn't know about it.
Momoko_Fan said:

Having two root nodes for the same scene would not work, spatial only has a reference to a single parent object.
Instead you need to render the same scene twice, use two RenderPasses with different enforced GLSLShaderObjectStates.


I'd rather not have to modify the scene graph ... if possible ... rather having different parts of the scene graph traversed depending upon cull traversal masks.

Thanks!!!  I'm still coming up to speed on jME ... trying to map functionality from other engines I've used.

SharedNode doesn't seem to work for me.

create 2 shared nodes and attach the scene to both (there is a constructor for this), not the other way round. this is how i spam plants and trees in my game.

Works like a charm!!!  I'm even able to use different shaders for each SharedNode.  MUCH THANKS!!!

yay, i successfully helped someone! horray! :smiley: :smiley: :smiley:

I'll try to return the favor to someone else :wink:



Right now I'm still translating features from other engine's I've used … e.g. character animation and blending.