• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂8f6eed7f717632626be916a7b4697df155ea33e0 (tree)
時間2012-09-25 18:27:16
作者angeart <angeart@git....>
Commiterangeart

Log Message

ジャンプモーションの対応
新バージョンDXライブラリ対応

Change Summary

差異

Binary files a/client/3d/FieldPlayer.hpp and b/client/3d/FieldPlayer.hpp differ
--- a/client/3d/MotionPlayer.cpp
+++ b/client/3d/MotionPlayer.cpp
@@ -5,12 +5,17 @@
55
66 MotionPlayer::MotionPlayer(int model_handle)
77 : model_handle_(model_handle), prev_attach_index_(-1), current_attach_index_(-1),
8- connect_prev_(false), prev_blend_rate_(0), blend_time_(0),prev_anim_index_(-1),isloop_(true)
8+ connect_prev_(false), prev_blend_rate_(0), blend_time_(0),prev_anim_index_(-1),isloop_(true),isloopcheck_(false)
99 {}
1010
11-void MotionPlayer::Play(int anim_index, bool connect_prev, int blend_time, int anim_src_model_handle, bool check_name, bool isloop)
11+void MotionPlayer::Play(int anim_index, bool connect_prev, int blend_time, int anim_src_model_handle, bool check_name, bool isloop, int nextanim_handle, bool isloopcheck)
1212 {
13- prev_anim_index_ = MV1GetAttachAnim(model_handle_,current_attach_index_);
13+ if(nextanim_handle != -1)
14+ {
15+ prev_anim_index_ = nextanim_handle;
16+ }else{
17+ prev_anim_index_ = MV1GetAttachAnim(model_handle_,current_attach_index_);
18+ }
1419
1520 // まだ前回の移行期間の最中なら、移行を中止する
1621 DetachPrevMotionIfExist();
@@ -19,6 +24,8 @@ void MotionPlayer::Play(int anim_index, bool connect_prev, int blend_time, int a
1924 prev_blend_rate_ = blend_time;
2025 blend_time_ = blend_time;
2126 isloop_ = isloop;
27+ isloopcheck_ = isloopcheck;
28+ if(!isloopcheck_)isplayend_ = false;
2229
2330 prev_attach_index_ = current_attach_index_;
2431 if (blend_time_ <= 0)
@@ -100,7 +107,8 @@ void MotionPlayer::AdvancePlayTime(int diff_time)
100107 if(!isloop_)
101108 {
102109 Stop();
103- Play(prev_anim_index_,connect_prev_,200,-1,false);
110+ isplayend_ = true;
111+ Play(prev_anim_index_,connect_prev_,200,-1,false,true,-1,isloopcheck_);
104112 return;
105113 }
106114 anim_time -= anim_total_time;
@@ -123,4 +131,12 @@ void MotionPlayer::AdvancePlayTime(int diff_time)
123131 }
124132 }
125133
126-
134+bool MotionPlayer::GetPlayEnd()
135+{
136+ if(isplayend_)
137+ {
138+ isplayend_ = false;
139+ return true;
140+ }
141+ return false;
142+}
--- a/client/3d/MotionPlayer.hpp
+++ b/client/3d/MotionPlayer.hpp
@@ -4,9 +4,10 @@ class MotionPlayer
44 {
55 public:
66 MotionPlayer(int model_handle);
7- void Play(int anim_index, bool connect_prev, int blend_time, int anim_src_model_handle, bool check_name, bool isloop = true);
7+ void Play(int anim_index, bool connect_prev, int blend_time, int anim_src_model_handle, bool check_name, bool isloop = true, int nextanim_handle = -1,bool isloopcheck = false);
88 void Next(int diff_time);
99 void Stop();
10+ bool GetPlayEnd();
1011
1112 private:
1213 int model_handle_;
@@ -16,6 +17,8 @@ private:
1617 int blend_time_;
1718 bool isloop_;
1819 int prev_anim_index_;
20+ bool isplayend_;
21+ bool isloopcheck_;
1922
2023 void SetBlendRateToModel();
2124 void DetachPrevMotionIfExist();
--- a/client/3d/PlayerCharacter.cpp
+++ b/client/3d/PlayerCharacter.cpp
@@ -243,8 +243,8 @@ public:
243243 //moved_pos.y = std::max(moved_pos.y, floor_y); // 床にあたっているときは床の方がyが高くなる
244244 if(!jump_flag_){
245245 // 登ったり下ったりできる段差の大きさの制限を求める
246- static const float y_max_limit_factor = sin(45 * PHI_F / 180);
247- static const float y_min_limit_factor = sin(-45 * PHI_F / 180);
246+ static const float y_max_limit_factor = sin(45 * DX_PI_F / 180);
247+ static const float y_min_limit_factor = sin(-45 * DX_PI_F / 180);
248248 const float y_max_limit = y_max_limit_factor * VSize(diff_pos);
249249 const float y_min_limit = y_min_limit_factor * VSize(diff_pos);
250250
--- a/client/3d/Stage.cpp
+++ b/client/3d/Stage.cpp
@@ -196,7 +196,7 @@ std::pair<bool,VECTOR> Stage::FrontCollides(float collision_length, const VECTOR
196196 {
197197 for(int j = 0; j < slide_coll_info.HitNum; ++j)
198198 {
199- auto angle = (acos(VDot(slide_coll_info.Dim[j].Normal,current_pos - prev_pos) / (VSize(slide_coll_info.Dim[j].Normal) * VSize(current_pos - prev_pos)))*180.0f)/PHI_F;
199+ auto angle = (acos(VDot(slide_coll_info.Dim[j].Normal,current_pos - prev_pos) / (VSize(slide_coll_info.Dim[j].Normal) * VSize(current_pos - prev_pos)))*180.0f)/DX_PI_F;
200200 if(angle < 90.0f || angle > 270.0f)
201201 {
202202 NowPos += VScale(slide_coll_info.Dim[j].Normal, 0.1f * map_scale_);
--- a/client/3d/dx_vector.hpp
+++ b/client/3d/dx_vector.hpp
@@ -3,7 +3,7 @@
33
44 #include <ostream>
55
6-#define TORADIAN(DEGREE) ((DEGREE*PHI_F)/180.0f)
6+#define TORADIAN(DEGREE) ((DEGREE*DX_PI_F)/180.0f)
77
88 inline VECTOR operator +(const VECTOR& lhs, const VECTOR& rhs)
99 {
--- a/client/3d/model.cpp
+++ b/client/3d/model.cpp
@@ -44,10 +44,10 @@ const float GameLoop::CAMERA_MAX_RADIUS = 40.0f;
4444
4545 GameLoop::GameLoop(const StagePtr& stage)
4646 : stage_(stage),
47- camera_default_stat(CameraStatus(7.0f, 0.8f, 0.0f, 20 * PHI_F / 180, false)),
47+ camera_default_stat(CameraStatus(7.0f, 0.8f, 0.0f, 20 * DX_PI_F / 180, false)),
4848 camera(camera_default_stat)
4949 {
50- SetupCamera_Perspective(PHI_F * 60.0f / 180.0f); // 視野角60度
50+ SetupCamera_Perspective(DX_PI_F * 60.0f / 180.0f); // 視野角60度
5151 SetCameraNearFar(1.0f * stage_->map_scale(), 700.0f * stage_->map_scale());
5252 }
5353
@@ -199,12 +199,12 @@ void GameLoop::MoveCamera(InputManager* input)
199199 camera.theta += diff_x * 0.005f;
200200 camera.phi += diff_y * 0.005f;
201201 }
202- if(camera.phi < (-40.0f * PHI_F)/180.0f)
202+ if(camera.phi < (-40.0f * DX_PI_F)/180.0f)
203203 {
204- camera.phi = (-39.9f * PHI_F)/180.0f;
205- }else if(camera.phi > (220.0f * PHI_F)/180.0f)
204+ camera.phi = (-39.9f * DX_PI_F)/180.0f;
205+ }else if(camera.phi > (220.0f * DX_PI_F)/180.0f)
206206 {
207- camera.phi = (219.0f * PHI_F)/180.0f;
207+ camera.phi = (219.0f * DX_PI_F)/180.0f;
208208 }
209209 }
210210 else
Binary files a/client/InputManager.cpp and b/client/InputManager.cpp differ