亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ogremayaskeleton.cpp

?? 使用stl技術(shù),(還沒看,是聽說(shuō)的)
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
============================================================================
This source file is part of the Ogre-Maya Tools.
Distributed as part of Ogre (Object-oriented Graphics Rendering Engine).
Copyright (C) 2003 Fifty1 Software Inc., Bytelords

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
or go to http://www.gnu.org/licenses/gpl.txt
============================================================================
*/
#include "OgreMayaSkeleton.h"
#include "OgreMayaOptions.h"

#include <maya/MString.h>
#include <maya/MArgList.h>
#include <maya/MAnimControl.h>

#include <maya/MFnMesh.h>
#include <maya/MFnIkJoint.h>
#include <maya/MFnDagNode.h>
#include <maya/MFnSkinCluster.h>
#include <maya/MFnMatrixData.h>
#include <maya/MFnSet.h>
#include <maya/MFnLambertShader.h>
#include <maya/MFnBlinnShader.h>
#include <maya/MFnPhongShader.h>

#include <maya/MItGeometry.h>
#include <maya/MItDag.h>
#include <maya/MItDependencyGraph.h>
#include <maya/MItDependencyNodes.h>
#include <maya/MItMeshVertex.h>
#include <maya/MItMeshPolygon.h>

#include <maya/MPlug.h>
#include <maya/MDagPathArray.h>
#include <maya/MFloatPointArray.h>
#include <maya/MFloatVectorArray.h>
#include <maya/MFloatArray.h>
#include <maya/MPointArray.h>
#include <maya/MMatrix.h>
#include <maya/MGlobal.h>
#include <maya/MStatus.h>

#include <iostream>

namespace OgreMaya {
	
	using namespace std;

    void printMMatrix(MMatrix const& m) {
        cout.setf(ios::showpos | ios::fixed);
        cout.precision(5);
        cout << "("<<m(0,0)<<", "<<m(0,1)<<", "<<m(0,2)<<", "<<m(0,3)<<")" << '\n';
        cout << "("<<m(1,0)<<", "<<m(1,1)<<", "<<m(1,2)<<", "<<m(1,3)<<")" << '\n';
        cout << "("<<m(2,0)<<", "<<m(2,1)<<", "<<m(2,2)<<", "<<m(2,3)<<")" << '\n';
        cout << "("<<m(3,0)<<", "<<m(3,1)<<", "<<m(3,2)<<", "<<m(3,3)<<")" << '\n';
    }

    void printMQuaternion(MQuaternion const& q) {
        cout.setf(ios::showpos | ios::fixed);
        cout.precision(5);
        cout << "("<<q[0]<<", "<<q[1]<<", "<<q[2]<<", "<<q[3]<<")" << '\n';
    }

    void printMVector(MVector const& v) {
        cout.setf(ios::showpos | ios::fixed);
        cout.precision(5);
        cout << "("<<v[0]<<", "<<v[1]<<", "<<v[2]<<")" << '\n';
    }

	//	--------------------------------------------------------------------------
	/** Standard constructor. Creates Ogre Mesh and defines known options.
	*/	
	//	--------------------------------------------------------------------------
	SkeletonGenerator::SkeletonGenerator() {
	}


	//	--------------------------------------------------------------------------
	/** Destructor.
	*/	
	//	--------------------------------------------------------------------------
	SkeletonGenerator::~SkeletonGenerator()
	{
	}


	//	--------------------------------------------------------------------------
	/** Find and export all joints

		\return		True if exported ok, false otherwise
	*/	
	//	--------------------------------------------------------------------------
	bool SkeletonGenerator::exportAll()	{        

        if(!_querySkeleton())
            return false;

        if(!_querySkeletonAnim())
            return false;

        
        MGlobal::executeCommand("ikSystem -e -sol 0;");
        MGlobal::selectByName(root->name.c_str());
        MGlobal::executeCommand("dagPose -r -g -bp");
        MGlobal::executeCommand("dagPose -r -g -bp");
		//MGlobal::executeCommand("currentTime -edit 0");
        
        
/*        
        MGlobal::executeCommand("ikSystem -e -sol 0;");
	    MGlobal::executeCommand((string("select ")+root->name).c_str());
	    MGlobal::executeCommand("dagPose -r -g -bp");
*/
        
        /////////////////////////////////////////////

        
        {
            ofstream out(OPTIONS.outSkelFile.c_str());

            out.precision(5);
            out.setf(ios::fixed);

            out << "<skeleton>\n";

            
            //
            // BONES
            //
            out << "\t<bones>\n";


            SkeletonJointList::iterator it, end;
            MVector axis;
            double angle;

            for(it=jointList.begin(), end=jointList.end(); it!=end; ++it) {
                
                SkeletonJoint& j = **it;
                                
                /*
                cout << "* worldMatrix:\n";
                printMMatrix(j.worldMatrix);
                cout << "* relPos:\n";
                printMVector(j.relPos);
                cout << "* relRot:\n";
                printMQuaternion(j.relRot);
                cout << "----------------------------\n";
                */

                j.relRot.getAxisAngle(axis, angle);

                out << "\t\t<bone id=\""<<j.index<<"\" name=\""<<j.name<<"\">\n";
                out << "\t\t\t<position x=\""<<j.relPos.x<<"\" y=\""<<j.relPos.y<<"\" z=\""<<j.relPos.z<<"\"/>\n";
                out << "\t\t\t<rotation angle=\""<<((float)angle)<<"\">\n";
                out << "\t\t\t\t<axis x=\""<<axis.x<<"\" y=\""<<axis.y<<"\" z=\""<<axis.z<<"\"/>\n";
                out << "\t\t\t</rotation>\n";
                out << "\t\t</bone>\n";

            }

            out << "\t</bones>\n";

            
            //
            // HIERARCHY
            //
            out << "\t<bonehierarchy>\n";
            for(it=jointList.begin(), end=jointList.end(); it!=end; ++it) {
                SkeletonJoint& j = **it;
                if(j.hasParent) {
                    out << "\t\t<boneparent bone=\""<<j.name<<"\" parent=\""<<j.parentName<<"\"/>\n";
                }
            }

            out << "\t</bonehierarchy>\n";
            

            //
            // ANIMATIONS
            //
            out << "\t<animations>\n";
            AnimationMap::iterator animIt = animations.begin();
            AnimationMap::iterator animEnd = animations.end();
            for(; animIt!=animEnd; ++animIt) {
                string animName = (*animIt).first;
                Animation& anim = (*animIt).second;

                out << "\t\t<animation name=\""<<animName.c_str()<<"\" ";
                out << "length=\""<<anim.time<<"\">\n";
                out << "\t\t\t<tracks>\n";

                KeyframesMap::iterator keyframesIt = anim.keyframes.begin();
                KeyframesMap::iterator keyframesEnd = anim.keyframes.end();
                for(; keyframesIt!=keyframesEnd; ++keyframesIt) {
                    string boneName = (*keyframesIt).first;
                    KeyframeList& l = (*keyframesIt).second;

                    out << "\t\t\t\t<track bone=\""<<boneName.c_str()<<"\">\n";
                    out << "\t\t\t\t\t<keyframes>\n";

                    KeyframeList::iterator it  = l.begin();
                    KeyframeList::iterator end = l.end();
                    for(;it!=end; ++it) {
                        Keyframe& k = *it;

                        MVector axis;
                        double angle;
                        k.rot.getAxisAngle(axis, angle);

                        out << "\t\t\t\t\t\t<keyframe time=\""<<k.time<<"\">\n";                        
                        out << "\t\t\t\t\t\t\t<translate x=\""<<k.pos.x<<"\" y=\""<<k.pos.y<<"\" z=\""<<k.pos.z<<"\"/>\n";
                        out << "\t\t\t\t\t\t\t<rotate angle=\""<<((float)angle)<<"\">\n";
                        out << "\t\t\t\t\t\t\t\t<axis x=\""<<axis.x<<"\" y=\""<<axis.y<<"\" z=\""<<axis.z<<"\"/>\n";
                        out << "\t\t\t\t\t\t\t</rotate>\n";
                        out << "\t\t\t\t\t\t</keyframe>\n";
                    }

                    out << "\t\t\t\t\t</keyframes>\n";
                    out << "\t\t\t\t</track>\n";
                }                    

                out << "\t\t\t</tracks>\n";
                out << "\t\t</animation>\n";
            }
            out << "\t</animations>\n";


            out << "</skeleton>\n";
        }


        deleteAll(jointList.begin(), jointList.end());

        return true;
    }
        
    //	--------------------------------------------------------------------------
	/** Finds and exports all joints

		\return		True if exported ok, false otherwise
	*/	

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品视频| 一区二区三区**美女毛片| 久久99深爱久久99精品| 4438x亚洲最大成人网| 午夜精品免费在线观看| 欧美精品在线一区二区| 免费观看一级特黄欧美大片| 日韩视频在线永久播放| 国精产品一区一区三区mba桃花| 精品国产自在久精品国产| 国产成人午夜视频| 亚洲伦理在线精品| 欧美人成免费网站| 久久精品国产成人一区二区三区 | 亚洲天堂精品视频| 日本乱人伦一区| 日韩成人一级大片| 国产欧美精品区一区二区三区| 成人精品一区二区三区中文字幕| 一区二区三区免费看视频| 7777精品伊人久久久大香线蕉超级流畅| 久久99精品久久久久久| 国产精品视频九色porn| 欧美性受xxxx黑人xyx| 精品一区二区免费| 亚洲免费观看高清| 精品国产伦理网| 91精品办公室少妇高潮对白| 蜜臀a∨国产成人精品| 国产精品私人自拍| 欧美日韩视频一区二区| 国产不卡视频在线播放| 亚洲sss视频在线视频| 久久九九全国免费| 91精品国产一区二区三区蜜臀| 高清国产一区二区| 蜜桃久久av一区| 亚洲欧美另类小说| 欧美精品一区男女天堂| 91网站视频在线观看| 久久99国产乱子伦精品免费| 亚洲一区免费视频| 久久精品视频在线看| 91麻豆精品国产自产在线| 91网上在线视频| 丰满白嫩尤物一区二区| 蜜臀久久99精品久久久久宅男| 亚洲美女一区二区三区| 国产亚洲一区字幕| 日韩亚洲欧美成人一区| 欧美性高清videossexo| 不卡的看片网站| 国内精品写真在线观看| 蜜桃一区二区三区在线| 午夜精品爽啪视频| 亚洲国产视频在线| 亚洲日本在线观看| 亚洲天堂2014| 国产精品国产馆在线真实露脸| 久久久美女毛片| 精品国产乱码久久久久久1区2区| 7777精品伊人久久久大香线蕉| 色一情一乱一乱一91av| 91美女视频网站| 97精品久久久午夜一区二区三区 | 欧美精品 日韩| 在线免费不卡视频| 日本精品一级二级| 91论坛在线播放| 色综合网站在线| 99久久亚洲一区二区三区青草| 国产成人综合亚洲网站| 国产麻豆精品视频| 国产精品夜夜爽| 懂色av中文一区二区三区| 激情图片小说一区| 国产一区二区按摩在线观看| 国产精品一区免费视频| 国产成人精品亚洲午夜麻豆| 成人激情小说乱人伦| 成人精品亚洲人成在线| 97se亚洲国产综合在线| 色系网站成人免费| 欧美群妇大交群的观看方式| 91精品久久久久久久99蜜桃| 日韩欧美国产一区二区在线播放| 精品欧美乱码久久久久久| 精品国产成人在线影院| 国产欧美日韩另类一区| **性色生活片久久毛片| 亚洲欧美综合另类在线卡通| 亚洲日本欧美天堂| 婷婷国产v国产偷v亚洲高清| 免费三级欧美电影| 国产精品夜夜嗨| 色综合中文字幕| 欧美一区二区性放荡片| 久久久美女毛片| 亚洲色图19p| 天天综合天天综合色| 韩国中文字幕2020精品| 成人性生交大片免费看视频在线| 99久久精品99国产精品| 欧美视频一区二| 精品电影一区二区| 中文字幕一区二区不卡| 午夜av区久久| 国产一区中文字幕| 在线免费观看一区| 26uuu国产日韩综合| 亚洲三级电影网站| 蜜臀av性久久久久蜜臀aⅴ| 成人精品高清在线| 7777精品伊人久久久大香线蕉超级流畅| 精品久久一二三区| 亚洲综合色视频| 国产资源在线一区| 欧美性xxxxxx少妇| 国产日韩一级二级三级| 香蕉久久夜色精品国产使用方法 | 国产精品12区| 成人免费毛片高清视频| 欧美精品三级在线观看| 国产精品天干天干在线综合| 日韩专区欧美专区| 99热在这里有精品免费| 精品久久人人做人人爰| 亚洲一区二区三区在线播放| 国产精品一级在线| 91精品国产美女浴室洗澡无遮挡| 国产精品国产三级国产aⅴ原创| 久久精品国产一区二区| 日本电影亚洲天堂一区| 国产日本亚洲高清| 91久久精品一区二区二区| 久久女同性恋中文字幕| 日日夜夜精品视频天天综合网| a美女胸又www黄视频久久| 欧美岛国在线观看| 天堂va蜜桃一区二区三区| www.欧美日韩| 欧美国产日本韩| 精品影视av免费| 欧美丰满少妇xxxxx高潮对白| 国产精品国模大尺度视频| 国产一区二区美女诱惑| 精品欧美乱码久久久久久1区2区| 亚洲福利一区二区| 欧洲国内综合视频| 亚洲精品视频免费看| 成人av小说网| 国产精品二区一区二区aⅴ污介绍| 久久精品国产免费| 欧美成人猛片aaaaaaa| 青青草成人在线观看| 欧美日韩国产首页| 亚洲成人先锋电影| 欧美视频在线观看一区二区| 亚洲一区在线观看视频| 欧美无人高清视频在线观看| 一区二区三区四区国产精品| 99riav久久精品riav| 一区二区中文字幕在线| a亚洲天堂av| 亚洲欧美日韩国产成人精品影院| 成人黄色av电影| 亚洲色图色小说| 一本久久综合亚洲鲁鲁五月天 | 久久久国产午夜精品| 国产一区二区三区电影在线观看| 精品少妇一区二区三区| 狠狠色狠狠色合久久伊人| 国产午夜精品一区二区三区视频| 国产精品一区一区| 国产精品成人在线观看| 99久久精品国产精品久久| 亚洲男人的天堂av| 欧美日韩高清一区二区不卡| 天天色天天操综合| 日韩一级二级三级精品视频| 激情五月婷婷综合| 国产精品久久久久国产精品日日| 91影院在线免费观看| 一本一道综合狠狠老| 一区二区三区欧美视频| 欧美疯狂做受xxxx富婆| 韩国av一区二区三区四区| 国产精品嫩草影院av蜜臀| 欧美性色黄大片| 麻豆一区二区在线| 国产欧美一区二区三区鸳鸯浴| 成人av综合一区| 亚洲第一主播视频| 久久久久久99久久久精品网站| av高清不卡在线| 日韩中文字幕区一区有砖一区| 精品国产乱码久久久久久牛牛| 99精品久久99久久久久| 天堂成人国产精品一区| 久久精品亚洲麻豆av一区二区|