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: 1669
Joined: Mon Jan 21, 2008 10:26 pm

Renderable setMaterial

Post by madmarx » Sat Jan 22, 2011 11:11 am

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
0 x
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
Contact:

Re: Renderable setMaterial

Post by Klaim » Sat Jan 22, 2011 12:01 pm

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.
0 x

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

Re: Renderable setMaterial

Post by madmarx » Sat Jan 22, 2011 4:13 pm

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.
0 x
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