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.
bonsalty
Posts: 120 Joined: Thu Dec 10, 2009 1:30 pm
Location: Budapest,Hungary
Post
by bonsalty » Fri Aug 13, 2010 11:09 am
Hi!
Whats the proper way of making a copy from a mesh?
I made a custom object which is holding the model-node and the mesh.
Code: Select all
scene::IAnimatedMeshSceneNode *model;
scene::IAnimatedMesh* mesh ;
.
.
.
//init
mesh = params->smgr->getMesh(path.GetBuffer());
model = params->smgr->addAnimatedMeshSceneNode( mesh );
When I get the pointer of the mesh from the first object and call
model = params->smgr->addAnimatedMeshSceneNode( mesh );
for the second object, irrlicht gives an acces violation.
Any ideas?
Tomi
serengeor
Posts: 1712 Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania
Post
by serengeor » Fri Aug 13, 2010 12:57 pm
Just look trough tutorials, there's a tutorial that loads 3 fairies with the same mesh.
What you should do I think:
Code: Select all
scene::IAnimatedMeshSceneNode *model;
scene::IAnimatedMeshSceneNode *model2;
scene::IAnimatedMesh* mesh ;
.
.
.
//init
mesh = params->smgr->getMesh(path.GetBuffer());
model = params->smgr->addAnimatedMeshSceneNode( mesh );
model2 = params->smgr->addAnimatedMeshSceneNode( mesh );
Working on game:
Marrbles (Currently stopped).
Zurzaza
Posts: 153 Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:
Post
by Zurzaza » Fri Aug 13, 2010 2:03 pm
you can use the clone() function...
Code: Select all
scene::IAnimatedMeshSceneNode *model;
scene::IAnimatedMeshSceneNode *model2;
scene::IAnimatedMesh* mesh ;
.
.
.
//init
mesh = params->smgr->getMesh(path.GetBuffer());
model = params->smgr->addAnimatedMeshSceneNode( mesh );
model2 = model->clone();