new SMaterial

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
Papa Lazarou
Posts: 12
Joined: Wed May 14, 2008 12:31 pm

new SMaterial

Post by Papa Lazarou »

If i create a new SMaterial class instance, how can I then apply it to a scene node? Without having to go through all the material's properties and 'copying' them over.
Like, there should be a .setMaterial(index,material) function :) .
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

node->getMaterial(x)= mynewmaterialwithallsettingsmade;
That's even simpler as the version you proposed, and it's already available :D
Papa Lazarou
Posts: 12
Joined: Wed May 14, 2008 12:31 pm

Post by Papa Lazarou »

forgive my c++ ignorance, but if i then made a few nodes' materials = mynewmaterialwithallsettingsmade, and then changed a setting on mynewmaterialwithallsettingsmade, would that affect all the other nodes too?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, but that wouldn't be too pleasant usually. Moreover, setting the materials to different values isn't too time consuming, and you can do that in a loop inside a method to make it pretty easy for you as well.
Post Reply