Page 1 of 1

Renderable setMaterial

Posted: Sat Jan 22, 2011 11:11 am
by madmarx
Hello,

Most things that inherit from Renderable have a setMaterial/setMaterialName function, but Renderable itself has not.
This gaves me problem when I was working with std::set of Renderable* (subentity, billboards etc...) for which I wanted to change the material once using polymorphism.

I would like to know if it is a good idea to add such virtual function to Renderable.

Best,

Pierre

Re: Renderable setMaterial

Posted: Sat Jan 22, 2011 12:01 pm
by Klaim
The semantic of Renderable makes it not a good idea to put set Material there as a Renderable could not have any material informations. But for convenience it could still be done.
Maybe an intenrmediate class in the hierarchy would be necessary? Something that is Renderable and can have a Material. But Maybe that's overkill. Not sure.

Re: Renderable setMaterial

Posted: Sat Jan 22, 2011 4:13 pm
by madmarx
as a Renderable could not have any material informations.
I don't see when it could happen? And there is already a getMaterial function, too.