Accessing SMaterial

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Accessing SMaterial

Post by Tyn »

Hey all

I was looking to change some of the settings of SMaterial on one node but it appears you can't do that. It seems like the only access you get to the SMaterial of that node is through the functions setMaterialFlag(), but what if you use settings like changing the ambiant colour, the emissive colour etc. Is this impossible? If it is, how can I give access to the SMaterial struct for my scene nodes?
Luke923
Posts: 59
Joined: Wed Nov 05, 2003 5:26 am

Post by Luke923 »

I believe you would do something like this:

Code: Select all

MeshNode->getMaterial(0).AmbientColor = video::SColor(0,0,0,0);
I haven't put it to use, but it should work in theory. I would assume that any call to getMaterial() should allow you to access the SMaterial struct as that's what setMaterialFlag() and setMaterialType() do to access the struct in its own class.
"Object-oriented programming is an exceptionally bad idea which could only have originated in California."
- E.W. Dijkstra
Post Reply