• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 311, comments - 0, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

             

              void Node::rotate(const Quaternion& q, TransformSpace relativeTo)
                {
                    
            // Normalise quaternion to avoid drift
                    Quaternion qnorm = q;
                    qnorm.normalise();

                    
            switch(relativeTo)
                    {
                    
            case TS_PARENT:
                        
            // Rotations are normally relative to local axes, transform up
                        mOrientation = qnorm * mOrientation;
                        
            break;
                    
            case TS_WORLD:
                        
            // Rotations are normally relative to local axes, transform up
                        mOrientation = mOrientation * _getDerivedOrientation().Inverse()
                            
            * qnorm * _getDerivedOrientation();
                        
            break;
                    
            case TS_LOCAL:
                        
            // Note the order of the mult, i.e. q comes after
                        mOrientation = mOrientation * qnorm;
                        
            break;
                    }
                    needUpdate();
                }
            旋轉(zhuǎn)是本地坐標(biāo)旋轉(zhuǎn)

                //-----------------------------------------------------------------------
                void Node::translate(const Vector3& d, TransformSpace relativeTo)
                {
                    
            switch(relativeTo)
                    {
                    
            case TS_LOCAL:
                        
            // position is relative to parent so transform downwards
                        mPosition += mOrientation * d;
                        
            break;
                    
            case TS_WORLD:
                        
            // position is relative to parent so transform upwards
                        if (mParent)
                        {
                            mPosition 
            += (mParent->_getDerivedOrientation().Inverse() * d)
                                
            / mParent->_getDerivedScale();
                        }
                        
            else
                        {
                            mPosition 
            += d;
                        }
                        
            break;
                    
            case TS_PARENT:
                        mPosition 
            += d;
                        
            break;
                    }
                    needUpdate();

                }
            變換是相對(duì)于父坐標(biāo)變換
            //-----------------------------------------------------------------------
                void Node::updateFromParentImpl(voidconst
                {
                    
            if (mParent)
                    {
                        
            // Update orientation
                        const Quaternion& parentOrientation = mParent->_getDerivedOrientation();
                        
            if (mInheritOrientation)
                        {
                            
            // Combine orientation with that of parent
                            mDerivedOrientation = parentOrientation * mOrientation;
                        }
                        
            else
                        {
                            
            // No inheritence
                            mDerivedOrientation = mOrientation;
                        }

                        
            // Update scale
                        const Vector3& parentScale = mParent->_getDerivedScale();
                        
            if (mInheritScale)
                        {
                            
            // Scale own position by parent scale, NB just combine
                            
            // as equivalent axes, no shearing
                            mDerivedScale = parentScale * mScale;
                        }
                        
            else
                        {
                            
            // No inheritence
                            mDerivedScale = mScale;
                        }

                        
            // Change position vector based on parent's orientation & scale
                        mDerivedPosition = parentOrientation * (parentScale * mPosition);

                        
            // Add altered position vector to parents
                        mDerivedPosition += mParent->_getDerivedPosition();
                    }
                    
            else
                    {
                        
            // Root node, no parent
                        mDerivedOrientation = mOrientation;
                        mDerivedPosition 
            = mPosition;
                        mDerivedScale 
            = mScale;
                    }

                    mCachedTransformOutOfDate 
            = true;
                    mNeedParentUpdate 
            = false;

                }
            //
            亚洲va中文字幕无码久久不卡| 久久精品无码一区二区app| 色欲久久久天天天综合网| 久久国产热精品波多野结衣AV| 伊人久久大香线蕉精品| 精品国产青草久久久久福利| 成人免费网站久久久| 久久精品免费一区二区| 国产一区二区精品久久| 精品久久久久久久国产潘金莲| 久久精品国产一区| 伊人久久大香线蕉av不变影院| 国产精品久久久久久久久久免费| 欧美亚洲另类久久综合婷婷 | 久久综合国产乱子伦精品免费| 99国产欧美久久久精品蜜芽 | 久久99精品免费一区二区| 亚洲午夜久久久久妓女影院| 久久国产福利免费| 亚洲国产精品久久| 久久99国产精品久久99| 久久99久久99精品免视看动漫| 欧美精品福利视频一区二区三区久久久精品| 久久AV高清无码| 国产亚洲色婷婷久久99精品| 国产成人久久精品一区二区三区 | 久久精品亚洲一区二区三区浴池 | 2020久久精品亚洲热综合一本| 久久精品二区| 国产精品无码久久综合网| 久久亚洲综合色一区二区三区| 97久久精品国产精品青草| 国产精品99精品久久免费| 色诱久久久久综合网ywww| 国产精品美女久久久久久2018| 久久精品国产亚洲精品2020| 久久亚洲精精品中文字幕| 久久福利青草精品资源站免费| 亚洲一区中文字幕久久| 国产69精品久久久久99尤物| 久久av免费天堂小草播放|