1 pDOF->getMatrixAffine()函数取得的是DOF建立场景内部限定的参数,不随缩放比例而变化
//获取DOF的内部限定坐标void GetAffinePositionFromDOF(const vsDOF * pDOF,double &x,double &y, double &z){if(pDOF==NULL)return ;vuMatrixAffine v;v=pDOF->getMatrixAffine();x=v.getTranslateX(),y=v.getTranslateY(),z=v.getTranslateZ(); }
2 void GetAbsolutePositionFromDOF()遍历后获取DOF的全局坐标
//获取DOF全局坐标void GetAbsolutePositionFromDOF(const vsDOF * pDOF,double &x, double &y, double &z,double &h,double &p,double &r){if(!pDOF)return ;vsTraversalLocate * travLocate=new vsTraversalLocate(); travLocate->setMode(vsTraversalLocate::MODE_MATRIX_STACK|vsTraversalLocate::MODE_NODE_STACK);travLocate->visit(pDOF);vuMatrix m=travLocate->getTopMatrixStack();m.getTranslate(&x,&y,&z); m.getRotate(&h,&p,&r); }