zoukankan      html  css  js  c++  java
  • cocos2dx 3.3多相机下_transformUpdated bug

    uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFlags)

    {

        if(_usingNormalizedPosition) {

            CCASSERT(_parent, "setNormalizedPosition() doesn't work with orphan nodes");

            if ((parentFlags & FLAGS_CONTENT_SIZE_DIRTY) || _normalizedPositionDirty) {

                auto s = _parent->getContentSize();

                _position.x = _normalizedPosition.x * s.width;

                _position.y = _normalizedPosition.y * s.height;

                _transformUpdated = _transformDirty = _inverseDirty = true;

                _normalizedPositionDirty = false;

            }

        }

        

        uint32_t flags = parentFlags;

        flags |= (_transformUpdated ? FLAGS_TRANSFORM_DIRTY : 0);

        flags |= (_contentSizeDirty ? FLAGS_CONTENT_SIZE_DIRTY : 0);

        

        if(flags & FLAGS_DIRTY_MASK)

            _modelViewTransform = this->transform(parentTransform);

        _transformUpdated = false;

        _contentSizeDirty = false;

        return flags;

    }

     改成:

    uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFlags)

    {

        if(_usingNormalizedPosition) {

            CCASSERT(_parent, "setNormalizedPosition() doesn't work with orphan nodes");

            if ((parentFlags & FLAGS_CONTENT_SIZE_DIRTY) || _normalizedPositionDirty) {

                auto s = _parent->getContentSize();

                _position.x = _normalizedPosition.x * s.width;

                _position.y = _normalizedPosition.y * s.height;

                _transformUpdated = _transformDirty = _inverseDirty = true;

                _normalizedPositionDirty = false;

            }

        }

        

        uint32_t flags = parentFlags;

        flags |= (_transformUpdated ? FLAGS_TRANSFORM_DIRTY : 0);

        flags |= (_contentSizeDirty ? FLAGS_CONTENT_SIZE_DIRTY : 0);

        

        if(flags & FLAGS_DIRTY_MASK)

            _modelViewTransform = this->transform(parentTransform);

        if(isVisitableByVisitingCamera())//if the camera is not match this node, do not consume _transformUpdated.  [wantnon,  yuanotes]. see: https://github.com/cocos2d/cocos2d-x/issues/10063

        {

            _transformUpdated = false;

            _contentSizeDirty = false;

        }

        return flags;

    }

     

  • 相关阅读:
    强化学习的基本迭代方法
    基于文本描述的事务聚类
    学习强化学习之前需要掌握的3种技能
    其它 华硕 ASAU S4100U 系统安装 win10安装 重装系统 Invalid Partition Table 解决
    数据分析 一些基本的知识
    Python 取样式的内容 合并多个文件的样式 自定义样式
    电商 Python 生成补单公司需要的评论格式3
    SpringBlade 本地图片上传 生成缩略图
    SQL Server 字符串截取
    SpringBlade 本地图片上传
  • 原文地址:https://www.cnblogs.com/wantnon/p/4341579.html
Copyright © 2011-2022 走看看