1 | /* |
---|
2 | ----------------------------------------------------------------------------- |
---|
3 | This source file is part of OGRE |
---|
4 | (Object-oriented Graphics Rendering Engine) |
---|
5 | For the latest info, see http://www.ogre3d.org/ |
---|
6 | |
---|
7 | Copyright (c) 2000-2006 Torus Knot Software Ltd |
---|
8 | Also see acknowledgements in Readme.html |
---|
9 | |
---|
10 | This program is free software; you can redistribute it and/or modify it under |
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
12 | Foundation; either version 2 of the License, or (at your option) any later |
---|
13 | version. |
---|
14 | |
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU Lesser General Public License along with |
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
22 | http://www.gnu.org/copyleft/lesser.txt. |
---|
23 | |
---|
24 | You may alternatively use this source under the terms of a specific version of |
---|
25 | the OGRE Unrestricted License provided you have obtained such a license from |
---|
26 | Torus Knot Software Ltd. |
---|
27 | ----------------------------------------------------------------------------- |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef __MilkshapePlugin_H__ |
---|
31 | #define __MilkshapePlugin_H__ |
---|
32 | |
---|
33 | #include "msPlugIn.h" |
---|
34 | #include "windows.h" |
---|
35 | #include "Ogre.h" |
---|
36 | |
---|
37 | |
---|
38 | /** A plugin class for Milkshape3D to export to OGRE model formats. |
---|
39 | @remarks |
---|
40 | This class is the implementor of the exporting interface for Milkshape3D, to allow |
---|
41 | you to export your models to OGRE format from that tool. |
---|
42 | Note that this plugin delegates most of the detail of exporting the model to the |
---|
43 | generic model export framework. |
---|
44 | */ |
---|
45 | class MilkshapePlugin : public cMsPlugIn |
---|
46 | { |
---|
47 | |
---|
48 | char mTitle[64]; |
---|
49 | |
---|
50 | public: |
---|
51 | MilkshapePlugin (); |
---|
52 | virtual ~MilkshapePlugin (); |
---|
53 | |
---|
54 | public: |
---|
55 | /// As required by Milkshape |
---|
56 | int GetType (); |
---|
57 | /// As required by Milkshape |
---|
58 | const char * GetTitle (); |
---|
59 | /// As required by Milkshape |
---|
60 | int Execute (msModel* pModel); |
---|
61 | |
---|
62 | /** Callback to process window events */ |
---|
63 | #if OGRE_ARCHITECTURE_64 == OGRE_ARCH_TYPE |
---|
64 | static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam); |
---|
65 | #else |
---|
66 | static BOOL CALLBACK DlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam); |
---|
67 | #endif |
---|
68 | |
---|
69 | bool exportMaterials; |
---|
70 | bool generateLods; |
---|
71 | bool generateEdgeLists; |
---|
72 | bool generateTangents; |
---|
73 | Ogre::VertexElementSemantic tangentSemantic; |
---|
74 | unsigned short numLods; |
---|
75 | float lodDepthIncrement; |
---|
76 | Ogre::ProgressiveMesh::VertexReductionQuota lodReductionMethod; |
---|
77 | float lodReductionAmount; |
---|
78 | bool exportMesh; |
---|
79 | bool exportSkeleton; |
---|
80 | bool splitAnimations; |
---|
81 | float fps; |
---|
82 | |
---|
83 | protected: |
---|
84 | bool showOptions(void); |
---|
85 | void doExportMesh(msModel* pModel); |
---|
86 | void doExportMaterials(msModel* pModel); |
---|
87 | void doExportAnimations(msModel* pModel, Ogre::SkeletonPtr& skel); |
---|
88 | Ogre::SkeletonPtr doExportSkeleton(msModel* pModel, Ogre::MeshPtr& mesh); // Skeleton returned for deletion later |
---|
89 | bool locateSkeleton(Ogre::MeshPtr& mesh); |
---|
90 | Ogre::ColourValue msVec4ToColourValue(float prop[4]); |
---|
91 | }; |
---|
92 | |
---|
93 | #endif |
---|
94 | |
---|