VACの修正(影設定の読み込み(影は未実装))
@@ -8,6 +8,7 @@ | ||
8 | 8 | |
9 | 9 | using TImport = MikuMikuDance.XNA.Accessory.MMD_VAC; |
10 | 10 | using System.IO; |
11 | +using System.Text; | |
11 | 12 | |
12 | 13 | namespace MikuMikuDance.XNA.Accessory |
13 | 14 | { |
@@ -29,7 +30,8 @@ | ||
29 | 30 | float scale; |
30 | 31 | Vector3 move, rot; |
31 | 32 | string bone; |
32 | - using (StreamReader sr = File.OpenText(filename)) | |
33 | + bool shadow = false; | |
34 | + using (StreamReader sr = new StreamReader(filename, Encoding.GetEncoding(932))) | |
33 | 35 | { |
34 | 36 | //アクセサリ名とxファイル名は読まない |
35 | 37 | sr.ReadLine(); |
@@ -44,10 +46,18 @@ | ||
44 | 46 | rot = new Vector3(Convert.ToSingle(data[0]), Convert.ToSingle(data[1]), Convert.ToSingle(data[2])); |
45 | 47 | //ボーン名 |
46 | 48 | bone = sr.ReadLine(); |
49 | + int num; | |
50 | + if (int.TryParse(sr.ReadLine().Trim(), out num)) | |
51 | + shadow = (num != 0); | |
47 | 52 | sr.Close(); |
48 | 53 | |
49 | 54 | } |
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 | + }; | |
51 | 61 | } |
52 | 62 | } |
53 | 63 | } |
@@ -20,5 +20,9 @@ | ||
20 | 20 | /// 基準ボーン名 |
21 | 21 | /// </summary> |
22 | 22 | public string BoneName; |
23 | + /// <summary> | |
24 | + /// 影 | |
25 | + /// </summary> | |
26 | + public bool Shadow; | |
23 | 27 | } |
24 | 28 | } |