MMDModelのXNAの処理を#ifでくるんだ
@@ -4,9 +4,10 @@ | ||
4 | 4 | using System.Text; |
5 | 5 | using MikuMikuDance.XNA.Motion; |
6 | 6 | using System.Collections.ObjectModel; |
7 | +using MikuMikuDance.XNA.Misc; | |
8 | +#if XNA | |
7 | 9 | using Microsoft.Xna.Framework; |
8 | -using Microsoft.Xna.Framework.Graphics; | |
9 | -using MikuMikuDance.XNA.Misc; | |
10 | +#endif | |
10 | 11 | |
11 | 12 | namespace MikuMikuDance.XNA.Model |
12 | 13 | { |
@@ -79,13 +80,7 @@ | ||
79 | 80 | foreach (var part in modelParts) |
80 | 81 | { |
81 | 82 | part.SetMatrices(ref Transform, ref view, ref projection); |
82 | - //ライティング処理 | |
83 | - IEffectLights lights = part.Effect as IEffectLights; | |
84 | - if (lights != null) | |
85 | - { | |
86 | - lights.EnableDefaultLighting(); | |
87 | - } | |
88 | - | |
83 | + part.SetLights(); | |
89 | 84 | part.Draw(); |
90 | 85 | } |
91 | 86 | } |
@@ -70,6 +70,18 @@ | ||
70 | 70 | } |
71 | 71 | } |
72 | 72 | /// <summary> |
73 | + /// エフェクトにライティングを適用 | |
74 | + /// </summary> | |
75 | + public void SetLights() | |
76 | + { | |
77 | + //ライティング処理 | |
78 | + IEffectLights lights = Effect as IEffectLights; | |
79 | + if (lights != null) | |
80 | + { | |
81 | + lights.EnableDefaultLighting(); | |
82 | + } | |
83 | + } | |
84 | + /// <summary> | |
73 | 85 | /// モデルの描画 |
74 | 86 | /// </summary> |
75 | 87 | public void Draw() |
@@ -132,6 +144,8 @@ | ||
132 | 144 | |
133 | 145 | internal abstract void SetBone(Matrix[] bones); |
134 | 146 | |
147 | + | |
148 | + | |
135 | 149 | |
136 | 150 | } |
137 | 151 | /// <summary> |