Own actor class needed? NxOgreOgreNodeRenderable

spacegaier

15-10-2008 20:13:08

Hello,

I want to achieve the following thing:

I do raycasting with NxOgre and therefore get the hit actor as a result. But now I want to change the color/material of this entity at runtime.

But the actor does not save the scenenode or something else related to Oge or the render system in general. Is this then one of these cases I have to implement my own actor class?

And what's about the NxOgreOgreNodeRenderable? When is this class (and the other NxOgreOgre* classes) intended to be used?

Has anyone of you ever used them and can show some code as an entry point?

Best regards - sapcegaier

nargil

16-10-2008 18:34:09

how aboutOgre::SceneNode* sn = ((NxOgre::OgreNodeRenderable*)actor->getRenderable())->getNode(); ?
I use it in my editor, to enable bounding box on a selected object.

spacegaier

16-10-2008 20:09:26

Unfortunately, that does not work. Are you using an older version, because an actor does not have a function called getRenderable() ?!?

nargil

16-10-2008 20:54:27

I use 1.0.22. Which version do you use ?

betajaen

16-10-2008 20:57:31

Your better of making your own body, instead of casting it to a OgreNodeRenderable all the time.

http://nxogre.org/Inheriting_Actor_and_ ... type_class

spacegaier

16-10-2008 21:02:54

I'm using 1.0.22T2. But there is no such function.

I only found this function implemented in the RenderableSource class. Could it be that your pointer called actor is actually a NxOgre::Body pointer because this class inherits RenderableSource?

nargil

16-10-2008 21:29:59

sorry - my mistake. It should be body instead of actor :)

nargil

29-10-2008 15:55:28

I've created my own Renderable faktory, but now I have more memory leaks. I fixed it with mScene->unregisterRenderableActorFactory(0);, but 0 doesn't seem safe. I mean if I had more custom Renderable Factories and wish to delete a certain one - how can I be sure of its index ? Is there a better way ?