• <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;

                }
            //
            亚洲熟妇无码另类久久久| 伊人久久精品无码二区麻豆| 人妻精品久久久久中文字幕69| 色8久久人人97超碰香蕉987| 91久久精品国产成人久久| 欧美日韩精品久久久久| 久久影院综合精品| 久久人人爽人人爽人人片AV东京热| 久久天天躁狠狠躁夜夜躁2014| 色噜噜狠狠先锋影音久久| 久久精品国产久精国产一老狼| 久久精品一区二区| 一本色道久久88精品综合| 欧美性大战久久久久久| 日韩欧美亚洲综合久久影院d3| 一本色道久久99一综合| 亚州日韩精品专区久久久| 亚洲国产二区三区久久| 性欧美大战久久久久久久久| 亚洲AⅤ优女AV综合久久久| 品成人欧美大片久久国产欧美| 性色欲网站人妻丰满中文久久不卡| 日韩AV毛片精品久久久| 99久久夜色精品国产网站| 麻豆精品久久精品色综合| 99久久久国产精品免费无卡顿| 亚洲午夜久久久久妓女影院| 精品国产乱码久久久久久呢 | 国产精品久久免费| 亚洲午夜福利精品久久| 欧美久久综合九色综合| 久久伊人影视| 久久婷婷是五月综合色狠狠| 中文成人无码精品久久久不卡 | 99久久精品毛片免费播放| 亚洲中文字幕久久精品无码APP| 一本色综合久久| 久久婷婷五月综合色奶水99啪| 久久久久久久久波多野高潮| 亚洲国产精品久久久天堂| 91久久精品91久久性色|