Archive 17/01/2023.

[SOLVED] Child node that not inherit parent’s scale

1vanK

I need child node that moved with parent, but do not inherit its scale. How to do it? I see 2 approach for it:

  1. Add flags for the nodes: inherit scale, move, rotation.
  2. Add event “E_SCALECHANGED” and fix sizes of child nodes with SetSizeSilent().

Of course I can check sizes of schild nodes everey frame

Update()
{
    if (childNode_.GetWorldScale() != x)
        childNode_.SetWorldScale(x);
}

but it looks as dirty hack

cadaver

These kind of booleans is what Ogre does / used to do and they’re quite nasty, as they’d fall directly on the fast path required to calculate global matrices.

If possible, I suggest keeping a non-scaled parent hierarchy, and adding a separate child for the scaled parent model.

1vanK

This will help me, but in my case it will be ugly. Anyway, if it strongly affects the performance, it is not necessary.