Beispiel #1
0
        /// <summary>
        /// 渲染
        /// </summary>
        public void render(TransformEX parentWorld, bool dirty)
        {
            //如果父链中它之上的任何物体标记为脏,则它将被置为true
            dirty |= dirty_;

            //而当节点没有改动时(dirty=false),跳过combine的过程,否则,表示此链为脏,进行combine
            if (dirty)
            {
                Debug.Log("this node is dirty,combine it!");
                world_ = local_.combine(parentWorld);
                dirty_ = false;
            }

            //渲染mesh
            if (_mesh != null)
            {
                renderMesh(_mesh, world_);
            }

            for (int i = 0; i < numChildren_; i++)
            {
                if (children_[i] != null)
                {
                    children_[i].render(world_, dirty);
                }
            }
        }
        public void render(TransformEX parentWorld, bool dirty)
        {
            //if object from parent be dirty than it will be true
            dirty |= dirty_;

            //if not changed than (dirty=false),jump it from combine
            if (dirty)
            {
                Debug.Log("this node is dirty,combine it!");
                world_ = local_.combine(parentWorld);
                dirty_ = false;
            }

            //renderMesh
            if (mesh_ != null)
            {
                renderMesh(mesh_, world_);
            }

            for (int i = 0; i < numChildren_; i++)
            {
                if (children_[i] != null)
                {
                    children_[i].render(world_, dirty);
                }
            }
        }
        public void render(TransformEX parentWorld, bool dirty)
        {

            //If any object above it in the parent chain is marked as dirty, it will be set to true

            dirty |= dirty_;

            //When the node is not changed (dirty=false), skip the combine process, otherwise, it means that the chain is dirty and combine
            if (dirty)
            {
                Debug.Log("this node is dirty,combine it!");
                world_ = local_.combine(parentWorld);
                dirty_ = false;
            }

           
            if (mesh_ != null)
            {
                renderMesh(mesh_, world_);
            }

            for (int i = 0; i < numChildren_; i++)
            {
                if (children_[i] != null)
                {
                    children_[i].render(world_, dirty);
                }

            }
        }