| 1 | /* |
|---|
| 2 | ----------------------------------------------------------------------------- |
|---|
| 3 | This source file is part of LEXIExporter |
|---|
| 4 | |
|---|
| 5 | Copyright 2006 NDS Limited |
|---|
| 6 | |
|---|
| 7 | Author(s): |
|---|
| 8 | Mark Folkenberg, |
|---|
| 9 | Bo Krohn |
|---|
| 10 | |
|---|
| 11 | This program is free software; you can redistribute it and/or modify it under |
|---|
| 12 | the terms of the GNU Lesser General Public License as published by the Free Software |
|---|
| 13 | Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 14 | version. |
|---|
| 15 | |
|---|
| 16 | This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 18 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
|---|
| 19 | |
|---|
| 20 | You should have received a copy of the GNU Lesser General Public License along with |
|---|
| 21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
|---|
| 22 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
|---|
| 23 | http://www.gnu.org/copyleft/lesser.txt. |
|---|
| 24 | ----------------------------------------------------------------------------- |
|---|
| 25 | */ |
|---|
| 26 | |
|---|
| 27 | #ifndef __NDS_LexiExporter_IntermediateBuilderSkeleton__ |
|---|
| 28 | #define __NDS_LexiExporter_IntermediateBuilderSkeleton__ |
|---|
| 29 | |
|---|
| 30 | // |
|---|
| 31 | |
|---|
| 32 | class CIntermediateBuilderSkeleton { |
|---|
| 33 | |
|---|
| 34 | public: |
|---|
| 35 | |
|---|
| 36 | CIntermediateBuilderSkeleton( void ); |
|---|
| 37 | ~CIntermediateBuilderSkeleton( void ); |
|---|
| 38 | |
|---|
| 39 | bool BuildIntermediateSkeleton( INode* pRootMaxNode ); |
|---|
| 40 | |
|---|
| 41 | void CreateAnimation( CDDObject* pDDConfig, CExportProgressDlg *pProgressDlg ); |
|---|
| 42 | |
|---|
| 43 | void Finalize( void ); |
|---|
| 44 | |
|---|
| 45 | void SetVertexData( unsigned int maxIdx, unsigned int intermediateIdx ); |
|---|
| 46 | |
|---|
| 47 | CIntermediateSkeleton* GetSkeleton( void ); |
|---|
| 48 | |
|---|
| 49 | static bool QuerySkinModifier( INode* pMaxNode ); |
|---|
| 50 | |
|---|
| 51 | private: |
|---|
| 52 | |
|---|
| 53 | bool FindSkinModifier( INode* pMaxNode ); |
|---|
| 54 | |
|---|
| 55 | void CreateBonePool( void ); |
|---|
| 56 | |
|---|
| 57 | void ConnectLinkedBones( void ); |
|---|
| 58 | |
|---|
| 59 | void AssembleBones( void ); |
|---|
| 60 | |
|---|
| 61 | void SetBindingPose( unsigned int frame ); |
|---|
| 62 | |
|---|
| 63 | void SetBoneIndexes( void ); |
|---|
| 64 | |
|---|
| 65 | void SetBoneIndexesRecursive( CIntermediateBone* pIBone ); |
|---|
| 66 | |
|---|
| 67 | void AddFrame( CAnimationSetting animSetting); |
|---|
| 68 | |
|---|
| 69 | // Max node holding the mesh to be bone animated |
|---|
| 70 | INode* m_pMaxNode; |
|---|
| 71 | |
|---|
| 72 | CIntermediateSkeleton* m_pISkel; |
|---|
| 73 | Modifier* m_pSkinMod; |
|---|
| 74 | ISkin* m_pSkin; |
|---|
| 75 | ISkinContextData* m_pSkinContext; |
|---|
| 76 | |
|---|
| 77 | unsigned int m_iBoneIndex; |
|---|
| 78 | |
|---|
| 79 | CExportProgressDlg* m_pProgressDlg; |
|---|
| 80 | }; |
|---|
| 81 | |
|---|
| 82 | #endif |
|---|