• R/O
  • SSH
  • HTTPS

mmdx: Commit


Commit MetaInfo

Revision41 (tree)
Zeit2010-03-07 17:54:24
Autorwilfrem

Log Message

VACの修正(影設定の読み込み(影は未実装))

Ändern Zusammenfassung

Diff

--- trunk/MMDImporter/Accessory/VACImporter.cs (revision 40)
+++ trunk/MMDImporter/Accessory/VACImporter.cs (revision 41)
@@ -8,6 +8,7 @@
88
99 using TImport = MikuMikuDance.XNA.Accessory.MMD_VAC;
1010 using System.IO;
11+using System.Text;
1112
1213 namespace MikuMikuDance.XNA.Accessory
1314 {
@@ -29,7 +30,8 @@
2930 float scale;
3031 Vector3 move, rot;
3132 string bone;
32- using (StreamReader sr = File.OpenText(filename))
33+ bool shadow = false;
34+ using (StreamReader sr = new StreamReader(filename, Encoding.GetEncoding(932)))
3335 {
3436 //アクセサリ名とxファイル名は読まない
3537 sr.ReadLine();
@@ -44,10 +46,18 @@
4446 rot = new Vector3(Convert.ToSingle(data[0]), Convert.ToSingle(data[1]), Convert.ToSingle(data[2]));
4547 //ボーン名
4648 bone = sr.ReadLine();
49+ int num;
50+ if (int.TryParse(sr.ReadLine().Trim(), out num))
51+ shadow = (num != 0);
4752 sr.Close();
4853
4954 }
50- return new TImport() { BoneName = bone, Transform =Matrix.CreateScale(scale)* Matrix.CreateFromYawPitchRoll(rot.Y, rot.X, rot.Z) * Matrix.CreateTranslation(move) };
55+ return new TImport()
56+ {
57+ BoneName = bone,
58+ Shadow = shadow,
59+ Transform = Matrix.CreateScale(scale) * Matrix.CreateFromYawPitchRoll(rot.Y, rot.X, rot.Z) * Matrix.CreateTranslation(move)
60+ };
5161 }
5262 }
5363 }
--- trunk/MikuMikuDanceXNA/Accessory/MMD_VAC.cs (revision 40)
+++ trunk/MikuMikuDanceXNA/Accessory/MMD_VAC.cs (revision 41)
@@ -20,5 +20,9 @@
2020 /// 基準ボーン名
2121 /// </summary>
2222 public string BoneName;
23+ /// <summary>
24+ /// 影
25+ /// </summary>
26+ public bool Shadow;
2327 }
2428 }
Show on old repository browser