How to clone a scene node

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
arfgh
Posts: 104
Joined: Sat Aug 26, 2006 6:15 am

How to clone a scene node

Post by arfgh »

How can i clone a scene node ?

thx
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

there is no function for cloning nodes, but you can create as many nodes as you want from a mesh... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

what about newnode=node->clone(newparent, smgr) :idea:
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

oh, really ??? :oops: :lol:
then it's a new function since v1.3, isn't it ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
arfgh
Posts: 104
Joined: Sat Aug 26, 2006 6:15 am

Post by arfgh »

I am still with this problem.

The thing i want to do is to clone a ISceneNode and reposition it on the top of the parent. How can i do that ?
i use irrlitch 1.1
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

well, then my first reply take affect, there is no clone function !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Update to the latest irrlicht, it's not hard! :lol:

Or you can just create your node in a function called createNode(...) which returns the node, then you can do this:

ISceneNode node1 = createNode(...);
ISceneNode node2 = createNode(...);
.
.
.

And so on, in the createNode function you just make your node how you want it to be and that will effectively clone it.
Image Image Image
Frodenius
Posts: 64
Joined: Sun Aug 29, 2004 11:24 am
Location: Germany/Frankfurt
Contact:

Post by Frodenius »

why did the clone() function got added to the interface if no working implementation exists?
http://irrlicht.sourceforge.net/docu/_i ... tml#l00613
[edit]
ahhh im sorry of course there exist many of them, but none for IAnimatedMeshSceneNode...
why so?
worst programming style ever seen...
dgrafix
Posts: 116
Joined: Sun Nov 18, 2007 2:36 pm

Post by dgrafix »

Im confused, is it working or not? I cannot seem to get it to work at all. :? :? :?
Last edited by dgrafix on Wed May 07, 2008 11:48 am, edited 1 time in total.
C++/Irrlicht Noob pl3se B p4t1ent.
Visit www.d-grafix.com :)
Mag-got
Posts: 42
Joined: Tue Dec 04, 2007 5:53 pm

Post by Mag-got »

It is working, or so I remember, to place it on top, get the nodes position you want to put it on top and

Code: Select all

newnode->setPosition(node->getPosition() - vector3df(0, 10, 0));
[/code]
Post Reply