3 * MMD
\82Ì
\83\82\81[
\83V
\83\87\83\93\83f
\81[
\83^
\81B
4 *
\83o
\83C
\83i
\83\8a\8c`
\8e®
\82Å
\83{
\81[
\83\93\83\82\81[
\83V
\83\87\83\93\81A
\95\
\8fî
\83\82\81[
\83t
\83B
\83\93\83O
\81A
\8cõ
\8c¹
\81A
\89e
\82Ì
\83L
\81[
\83t
\83\8c\81[
\83\80\82ª
5 *
\8bL
\98^
\82³
\82ê
\82é
\81B
8 * http://blog.goo.ne.jp/torisu_tetosuki/e/bc9f1c4d597341b394bd02b64597499d
9 * http://atupdate.web.fc2.com/vmd_format.htm
12 #ifndef MESH_IO_VMD_H_INCLUDED
13 #define MESH_IO_VMD_H_INCLUDED
25 typedef la::Vector2 Vector2;
26 typedef la::Vector3 Vector3;
27 typedef la::Quaternion Quaternion;
28 typedef color::fRGB fRGB;
30 ////////////////////////////////////////////////////////////
31 //!
\83\82\81[
\83V
\83\87\83\93
32 ////////////////////////////////////////////////////////////
37 char interpolationX[16];
38 char interpolationY[16];
39 char interpolationZ[16];
40 char interpolationRot[16];
42 inline std::ostream& operator<<(std::ostream &os, const BoneKey &rhs)
45 << "<BoneKey: " << rhs.pos << rhs.q << ">"
49 ////////////////////////////////////////////////////////////
51 ////////////////////////////////////////////////////////////
56 inline std::ostream& operator<<(std::ostream &os, const MorphKey &rhs)
59 << "<MorphKey: " << rhs.weight << ">"
64 ////////////////////////////////////////////////////////////
66 ////////////////////////////////////////////////////////////
69 //!
\89½
\82Ì
\8b\97\97£
\81H
73 //!
\83I
\83C
\83\89\81[
\8ap
76 char interpolation[24];
78 unsigned short viewAngle;
79 //!
\89\93\8bß
\8a´ 0
\82ªon
80 unsigned char perspective;
82 inline std::ostream& operator<<(std::ostream &os, const CameraKey &rhs)
85 << "<CameraKey: " << rhs.length
86 << rhs.pos << rhs.euler << ">"
91 ////////////////////////////////////////////////////////////
93 ////////////////////////////////////////////////////////////
99 inline std::ostream& operator<<(std::ostream &os, const LightKey &rhs)
102 << "<LightKey: " << rhs.color << rhs.pos << ">"
107 ////////////////////////////////////////////////////////////
108 //!
\83Z
\83\8b\83t
\83V
\83\83\83h
\83E
109 ////////////////////////////////////////////////////////////
114 ////////////////////////////////////////////////////////////
115 //! 1
\83`
\83\83\83\93\83l
\83\8b\95ª
\82Ì
\83L
\81[
\83t
\83\8c\81[
\83\80\82Ì
\83\8a\83X
\83g
\81B
116 //!
\93Ç
\82Ý
\8d\9e\82ñ
\82¾
\8cã
\82Å
\83t
\83\8c\81[
\83\80\94Ô
\8d\86\82Å
\83\
\81[
\83g
\82·
\82é
\81B
117 ////////////////////////////////////////////////////////////
123 //!
\83t
\83\8c\81[
\83\80\94Ô
\8d\86
128 //!
\83t
\83\8c\81[
\83\80\94Ô
\8d\86\82Å
\83L
\81[
\82ð
\83\
\81[
\83g
\82·
\82é
129 bool operator<(const KeyFrame &rhs)const{ return frame<rhs.frame; }
131 std::vector<KeyFrame> list;
132 void sort(){ std::sort(list.begin(), list.end()); }
133 KeyFrame& push(unsigned int frame)
135 list.push_back(KeyFrame());
136 KeyFrame &keyFrame=list.back();
137 keyFrame.frame=frame;
142 ////////////////////////////////////////////////////////////
144 ////////////////////////////////////////////////////////////
150 //!
\83\82\81[
\83V
\83\87\83\93
151 typedef std::map<std::string, KeyFrameList<BoneKey> > BoneMap;
154 typedef std::map<std::string, KeyFrameList<MorphKey> > MorphMap;
156 //!
\83J
\83\81\83\89\83\82\81[
\83V
\83\87\83\93
157 typedef std::map<std::string, KeyFrameList<CameraKey> > CameraMap;
160 typedef std::map<std::string, KeyFrameList<LightKey> > LightMap;
162 //!
\83Z
\83\8b\83t
\83V
\83\83\83h
\81[
163 typedef std::map<std::string, KeyFrameList<SelfShadowKey> > SelfShadowMap;
164 SelfShadowMap selfShadowMap;
167 bool read(binary::IReader &reader);
168 bool read(const char *path);
169 bool write(std::ostream &os);
171 inline std::ostream& operator<<(std::ostream &os, const IO &rhs)
174 << "<VMD " << rhs.name << std::endl
175 << "[bones] " << rhs.boneMap.size() << std::endl
176 << "[morphs] " << rhs.morphMap.size() << std::endl
183 } // namespace meshio
185 #endif // MESH_IO_VMD_H_INCLUDED