NodeUpdater

Goliat and I have spend some time tracing a bug in that NodeUpdater thingi, because in View line 833 it says:


            if ((node instanceof NodeUpdater) && !(node instanceof Shape3D)) {
                if (!((NodeUpdater)node).preRender(getTransform(),frustum,node.getTransformGroup().getTransform(),currentFrameStartTime)) return;
            }

Unfortunately for those Nodes close to the root, who don’t have a transformgroup as a parent this will throw an null-pointer exception.
To resolve this, we could simply remove this node.getTransformGroup().getTransform() param, node will know this anyways, so there’s no need to have this there.
Additionally Goliat suggested, if the view could be passed directly instead of only it’s transform.

What do you think?

If you use it, please tell us, what parameters you need, so we won’t stop your code from working.
And ofcourse if you have some arguments against such a change!

Arne

Two people posted, that they use it, but they didn’t post for what they use it - so can I safely assume that it’s safe to change it?

“safe”, you mean.

yes - sure :wink:

Hi,

Some of my developers use NodeUpdater (they were asking me several times about that), but I have to check in details for what purposes. Unfortunately, I can do this not earlier than in a week.

Yuri

so the week’s now well past…
so Yuri - were you able to fetch that information?

maybe I’ll simply perform the change (I’ll also adjust one of the classes using it in the xith-tk). I already changed all that stuff at my comp - I’ll only have to commit it.

What do you think?

good to hear you’ve kept track of this issue

altough the fix breaks compability for some, it isn’t a very big change … even for those who use the parameter
(and i’ll be able to use the NodeUpdater class as i need to … so a ‘please change it’ from me)

Ok I just took the freedom to commit the change.

Please make sure, if you either update Xith3d or the XithTk, to update the other one, too, or you won’t be able to use Text2d!

All I did is this:

  • instead of the Transform3D of the View, the View itself is an argument
  • I removed the local Transform3D of the Node itself as an argument, because each Node should know that and it reduces problems, for e.g. Nodes without a (grand)parent TransformGroup.

Arne