Node to Renderable


12-11-2006 18:08:21

How can i pass a node to a renderable?

Since renderable is an abstract class ( ... 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


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

Maybe Renderable should be an interface? :?


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


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 !!!