[SOLVED]Newbie irrlicht question: how to set a material col.
Posted: Tue Feb 23, 2010 9:02 am
Hi I'm trying to set the emissive color of cube:
IMeshSceneNode* node = smgr->addCubeSceneNode();
SMaterial mat = node->getMaterial(0);
mat.EmissiveColor.set(1,1,0,0);
but once I've done this I must do something like node.setMaterial(mat) ?
I come from Java. SMaterial mat = node->getMaterial(0); means that I don't get a pointer to the object but a new object so every change I make to this object (ex mat.EmissiveColor.set(1,1,0,0)) doesn't affect the material of the cube. This is right?
Thanks
IMeshSceneNode* node = smgr->addCubeSceneNode();
SMaterial mat = node->getMaterial(0);
mat.EmissiveColor.set(1,1,0,0);
but once I've done this I must do something like node.setMaterial(mat) ?
I come from Java. SMaterial mat = node->getMaterial(0); means that I don't get a pointer to the object but a new object so every change I make to this object (ex mat.EmissiveColor.set(1,1,0,0)) doesn't affect the material of the cube. This is right?
Thanks