Hello Anreas,

Andreas Halm wrote:
> However, there are a few questions left. First, why use MaterialDrawable at
> all as a base class? Is this just for simplicity?

yes, and a real world core would probably want to draw the cubes using 
the material stored in the MaterialDrawable and then it is a little 
nicer to just implement drawPrimitives() without the need to duplicate 
the renderActionEnterHandler/LeaveHandler functions.

> As far as I can see if you
> derive from NodeCore directly, all you need is to get the method you
> register in initMethod right. Or are there other bonuses I just did not see
> yet?

yes, there is nothing special about MaterialDrawable in the sense that 
it is not necessary to derive from it to have a core that renders 
something. In the case of the example plain Drawable would have been 
another viable choice, but I would not have used NodeCore directly in 
order to keep things grouped by functionality.

> Second, for the implementation of drawPrimitives ... I was used to use the
> act node of the RenderAction, and with the advent of the DrawEnv* parameter
> here, I just tried to use env->getAction()->getActNode() and leave the rest
> as-is.

yes, that gives you the current node.

> However, I can't cast the core to what I thought the core would be -
> the dynamic_cast fails. Has behavior changed here between 1.8 and 2.0?

hm, getActNode() gives you the current Node, not the NodeCore. If your 
render action callback is a member function the current node core is 
simply "this" and the same as getActNode()->getCore().
Can you post the relevant part(s) of your code?

        Cheers,
                Carsten

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to