Jump to content

[SOLVED] Creating a new node


photo

Recommended Posts

Posted

Trying to create a new node code side and its complaining that it cant find a constructor with 0 arguments, but I have seen several examples of constructing a new node (image_atlas.h, and a post on the forum) that do not have any parameters.   Is that code outdated and the Node constructor now has multiple parameters?  Or perhaps I am not including?  I tried giving it a single string argument as well as one forum post shows, but this didn't work either.

 

"ExternClass::get_constructor(): can't find constructor with 0 arguments"

Posted

The function library is up to date, so you can refer to it if in doubt. Please, post a minimal test scene, otherwise we'll have no clue what's happening.

Posted

You can repro the issue by adding a single line to the Player Character constructor.

 

C:\Unigine evaluation\data\demos\shooter\scripts\player\player_character.h

 

Add the line 

Node newnode = new Node();
 
to the function
PlayerCharacter(mat4 transform,string property_name) {
 
and you will get the same compile error.
Posted

Maybe caused by the fact that Node is general base class. Try NodeDummy instead.

Posted

NodeDummy does in fact compile...

Does that mean that C:\Unigine evaluation\data\core\scripts\image_atlas.h 

only complies because its in the core folder?

 

Is there a list somewhere of which objects are inaccessible for construction?

Posted

No, totally different thing: ImageAtlas defines it's own internal ImageAtlas:: Node class.

Posted

So, is there a list of which objects are inaccessible for construction?

Posted

No, but this should be more or less Node, Object, Shape, Stream base classes.  

×
×
  • Create New...