• R/O
  • SSH
  • HTTPS

mmdx: Commit


Commit MetaInfo

Revision795 (tree)
Zeit2011-06-04 18:52:52
Autorwilfrem

Log Message

残ってたファイルを削除

Ändern Zusammenfassung

  • delete: branches/XNA4/MikuMikuDanceCore/Model/ModelDrawingMode.cs
  • delete: branches/XNA4/MikuMikuDanceCore/Stages/MMDMotionTrack.cs

Diff

--- branches/XNA4/MikuMikuDanceCore/Model/ModelDrawingMode.cs (revision 794)
+++ branches/XNA4/MikuMikuDanceCore/Model/ModelDrawingMode.cs (nonexistent)
@@ -1,23 +0,0 @@
1-using System;
2-using System.Collections.Generic;
3-using System.Linq;
4-using System.Text;
5-
6-namespace MikuMikuDance.Core.Model
7-{
8- /// <summary>
9- /// モデルの描画モード
10- /// </summary>
11- public enum ModelDrawingMode
12- {
13- /// <summary>
14- /// 標準描画
15- /// </summary>
16- Normal,
17- /// <summary>
18- /// エッジ検出モード
19- /// </summary>
20- /// <remarks>エッジ情報を得るためのプリレンダリング(エッジ検出モード)</remarks>
21- Edge,
22- }
23-}
--- branches/XNA4/MikuMikuDanceCore/Stages/MMDMotionTrack.cs (revision 794)
+++ branches/XNA4/MikuMikuDanceCore/Stages/MMDMotionTrack.cs (nonexistent)
@@ -1,181 +0,0 @@
1-using System;
2-using System.Collections.Generic;
3-using System.Linq;
4-using System.Text;
5-using MikuMikuDance.Core.Motion;
6-
7-namespace MikuMikuDance.Core.Stages
8-{
9- public class MMDMotionTrack
10- {
11- bool bLoopPlay = false;
12- bool bReverse = false;
13- decimal NowFrame = 0;
14- decimal MaxFrame = 0;
15- bool bStart = false;
16- List<MMDCameraKeyFrame> cameraFrames;
17- List<MMDLightKeyFrame> lightFrames;
18-
19- int cameraPos;
20- int lightPos;
21-
22- /// <summary>
23- /// モーション再生用FPS
24- /// </summary>
25- public decimal FramePerSecond { get; set; }
26- /// <summary>
27- /// コンストラクタ
28- /// </summary>
29- /// <param name="motionData">モーションデータ</param>
30- public MMDMotionTrack(MMDMotion motionData)
31- {
32- cameraFrames = motionData.CameraFrames;
33- lightFrames = motionData.LightFrames;
34- //モーションのFPS=30
35- FramePerSecond = 30m;
36- foreach (var frame in cameraFrames)
37- {
38- MaxFrame = Math.Max(MaxFrame, frame.FrameNo);
39- }
40- foreach (var frame in lightFrames)
41- MaxFrame = Math.Max(MaxFrame, frame.FrameNo);
42- }
43-
44-
45- /// <summary>
46- /// モーションの再生
47- /// </summary>
48- public void Start()
49- {
50- Start(false);
51- }
52- /// <summary>
53- /// モーションの再生
54- /// </summary>
55- /// <param name="LoopPlay">ループ再生</param>
56- public void Start(bool LoopPlay)
57- {
58- bLoopPlay = LoopPlay;
59- bStart = true;
60- }
61- /// <summary>
62- /// モーションの停止
63- /// </summary>
64- public void Stop()
65- {
66- InnerStop();
67- //TimeUpdate();
68- }
69- void InnerStop()
70- {
71- bStart = false;
72- }
73- /// <summary>
74- /// 巻き戻し
75- /// </summary>
76- public void Reset()
77- {
78- Reset(false);
79- }
80- /// <summary>
81- /// 巻き戻し及び逆再生設定
82- /// </summary>
83- /// <param name="Reverse">逆再生</param>
84- public void Reset(bool Reverse)
85- {
86- bReverse = Reverse;
87- bStart = false;
88- if (Reverse)
89- NowFrame = MaxFrame;
90- else
91- NowFrame = 0;
92- Rewind();
93- }
94- //更新
95- internal void Update(float elapsedSeconds)
96- {
97- TimeUpdate(elapsedSeconds);
98- //カメラの更新
99- //カーソル位置の更新
100- int CursorPos = cameraPos;
101- if (!bReverse)
102- for (; CursorPos < cameraFrames.Count && cameraFrames[CursorPos].FrameNo < NowFrame; ++CursorPos) ;
103- else
104- for (; CursorPos > 0 && cameraFrames[CursorPos - 1].FrameNo > NowFrame; --CursorPos) ;
105- cameraPos = CursorPos;
106- if (!(CursorPos == 0 || CursorPos == cameraFrames.Count))
107- {
108- //時間経過取得
109- float Progress = ((float)NowFrame - (float)cameraFrames[CursorPos - 1].FrameNo) / ((float)cameraFrames[CursorPos].FrameNo - (float)cameraFrames[CursorPos - 1].FrameNo);
110- //差分を適用
111- MMDCameraKeyFrame camera1 = cameraFrames[CursorPos - 1], camera2 = cameraFrames[CursorPos];
112- MMDCameraKeyFrame.Lerp(camera1, camera2, Progress, MMDCore.Instance.Camera);
113- }
114- CursorPos = lightPos;
115- if (!bReverse)
116- for (; CursorPos < lightFrames.Count && lightFrames[CursorPos].FrameNo < NowFrame; ++CursorPos) ;
117- else
118- for (; CursorPos > 0 && lightFrames[CursorPos - 1].FrameNo > NowFrame; --CursorPos) ;
119- lightPos = CursorPos;
120- if (!(CursorPos == 0 || CursorPos == lightFrames.Count))
121- {
122- //時間経過取得
123- float Progress = ((float)NowFrame - (float)lightFrames[CursorPos - 1].FrameNo) / ((float)lightFrames[CursorPos].FrameNo - (float)lightFrames[CursorPos - 1].FrameNo);
124- MMDLightKeyFrame light1 = lightFrames[CursorPos - 1], light2 = lightFrames[CursorPos];
125- MMDLightKeyFrame.Lerp(light1, light2, Progress, MMDCore.Instance.Light);
126- }
127- }
128-
129- private void TimeUpdate(float elapsedSeconds)
130- {
131- if (!bStart)
132- return;
133- //decimal ElapsedTime;
134- //ElapsedTime = (decimal)(stopwatch.ElapsedTicks - LastUpdate) * 1000m / (decimal)Stopwatch.Frequency;
135- if (!bReverse)
136- {
137- NowFrame += ((decimal)elapsedSeconds) * FramePerSecond;
138- if (NowFrame > MaxFrame)
139- {
140- if (bLoopPlay)
141- Rewind();
142- else
143- InnerStop();
144- }
145- }
146- else
147- {
148- NowFrame -= ((decimal)elapsedSeconds) * FramePerSecond;
149- if (NowFrame < 0)
150- {
151- if (bLoopPlay)
152- Rewind();
153- else
154- InnerStop();
155- }
156- }
157- //LastUpdate = stopwatch.ElapsedTicks;
158-
159- }
160- //巻き戻し処理
161- private void Rewind()
162- {
163- if (!bReverse)
164- {
165- while (NowFrame >= MaxFrame)
166- NowFrame -= MaxFrame;
167- //ボーンの更新
168- cameraPos = 0;
169- lightPos = 0;
170- }
171- else
172- {
173- while (NowFrame <= 0)
174- NowFrame += MaxFrame;
175- //ボーンの更新
176- cameraPos = cameraFrames.Count - 1;
177- lightPos = lightFrames.Count - 1;
178- }
179- }
180- }
181-}
Show on old repository browser