Node to Renderable

grizzley90

12-11-2006 18:08:21

How can i pass a node to a renderable?

Since renderable is an abstract class (http://www.ogre3d.org/docs/api/html/cla ... rable.html) node should inherit from it or implement it meaning that i can implicitly pass a node to a renderable, no?
I should be able to do something like this

SetRenderable(mynode);

or am I still thinking c++ and not c#?

Maybe Renderable should be an interface? :?

Bekas

12-11-2006 18:27:51

Ogre::Renderable is already an interface, Mogre.IRenderable. Node implements it so if SetRenderable accepts an IRenderable you can pass the node.

If you want to make a class that implements IRenderable, just adding IRenderable at your class definition is not enough (you'll implement it in the .NET side but Ogre won't be able to use it). In order to implement IRenderable AND get Ogre to use it, you need to subclass the Mogre.Renderable class.
This is is true for all interfaces (Node.IListener etc.)

grizzley90

13-11-2006 02:05:17

Ok sorry i didn't see Mogre.IRenderable... I only found the abstract class mogre.renderable...

Its all good now thanks !!!