Renderable setMaterial

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1670
Joined: Mon Jan 21, 2008 10:26 pm
x 49

Renderable setMaterial

Post 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
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0

User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Re: Renderable setMaterial

Post 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.

User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1670
Joined: Mon Jan 21, 2008 10:26 pm
x 49

Re: Renderable setMaterial

Post 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.
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0

Post Reply