CCNode::setAdditionalTransform clarification

I just wanted to clarify the usage of this function.

As far as I understand, this function stores the additional transformation as a member of CCNode and then uses it to adjust CCNode’s own transformation. So if we need one node to be relative to another one, we have to update this additional transformation every frame manually (e.g. via scheduler). Isn’t this the same as getting pseudo-parent’s position / direction / scale / whole_transformation by hand and applying those values to the pseudo-child node?

I mean it would be more convenient to have these things done automagically. For instance, pseudo-code:

CCNode::setPseudoParent(CCNode* pseudo_parent)
{
        m_pseudo_parent = pseudo_parent;
}

CCNode::nodeToParentTransform
{
        [blah-blah-blah, some usual things]
        ...
        if (m_pseudo_parent)
        {
                m_sTransform = CCAffineTransformConcat(m_sTransform, m_pseudo_parent->nodeToParentTransform());
        }
}

Thus CCNode’s transformation will be adjusted in respect to pseudo-parent automatically.

Or did I get the idea of CCNode::setAdditionalTransform wrong?

Anyone?..

Yes, you’re correct.
Agree with you. That will be more convenience.
Did you implement this functionility? Could you send us your patch on github? Thanks.

Nope, I didn’t. I just asked for clarification of the idea of this method. Currently this functionality is not urgent for me. Maybe later.

At first, CCNode::setAdditionalTransform was added because CocoStudio needs it to simulate Parent-Child relationship.
Then, Parent-Child could use different SpriteBatchNode s with different textures.

Once the new renderer is finished, I think it will be safe to remove this functionality.