• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

コミットメタ情報

リビジョン1805b3669dd4aae057d67b7a96b9fe9af9a09ca5 (tree)
日時2012-09-30 02:12:46
作者angeart <angeart@git....>
コミッターangeart

ログメッセージ

ジャンプモーションありのコード

変更サマリ

差分

--- a/client/3d/FieldPlayer.cpp
+++ b/client/3d/FieldPlayer.cpp
@@ -254,10 +254,27 @@ void FieldPlayer::Update()
254254 }else if(additional_motion_.flag_)
255255 {
256256 bool connect_prev = true;
257- motion_player_->Play(additional_motion_.handle_, connect_prev, 400, -1, false,additional_motion_.isloop_,additional_motion_.nextanim_handle_,additional_motion_.loopcheck_);
257+ motion_player_->Play(
258+ additional_motion_.handle_,
259+ additional_motion_.connection_,
260+ additional_motion_.connection_time_,
261+ -1,
262+ false,
263+ additional_motion_.isloop_,
264+ additional_motion_.nextanim_handle_,
265+ additional_motion_.loopcheck_);
258266 additional_motion_.loopcheck_ = false;
259267 additional_motion_.flag_ = false;
260268 additional_motion_.nextanim_handle_ = -1;
269+ additional_motion_.connection_ = true;
270+ additional_motion_.next_connection_ = true;
271+ }else if(additional_motion_.motion_change_)
272+ {
273+ if(motion_player_->GetPlayEnd())
274+ {
275+ additional_motion_.motion_change_ = false;
276+ motion_player_->Play(current_stat_.motion, true, 200, -1, false);
277+ }
261278 }
262279 // モーション再生時刻更新
263280 motion_player_->Next(timer_->Delta());
@@ -341,7 +358,7 @@ void FieldPlayer::Move()
341358 if (prev_stat_.acc.y == 0)
342359 {
343360 jump_wait_ = false;
344- // 前回接地していた
361+ // 前回接地していた
345362 // std::cout << " previous on the ground" << std::endl;
346363
347364 // 登ったり下ったりできる段差の大きさの制限を求める
@@ -417,16 +434,19 @@ void FieldPlayer::Move()
417434 // 落下している
418435 // std::cout << " previous falling" << std::endl;
419436
420- // 地面に食い込むのを防止する
437+ // 地面に食い込むのを防止する
421438
422439 if (foot_floor_exists.first)
423440 {
424441 // 地面に到達した
425442 // std::cout << " current on the ground" << std::endl;
426443 additional_motion_.handle_ = motion.end_jmp_;
444+ additional_motion_.connection_ = false;
427445 additional_motion_.isloop_ = false;
428- additional_motion_.nextanim_handle_ = motion.stand_;
446+ additional_motion_.nextanim_handle_ = current_stat_.motion;
447+ additional_motion_.loopcheck_ = true;
429448 additional_motion_.flag_ = true;
449+ additional_motion_.motion_change_ = true;
430450 current_stat_.pos = foot_floor_exists.second;
431451 current_stat_.acc.y = 0;
432452 current_stat_.vel.y = 0;
@@ -602,11 +622,22 @@ void FieldPlayer::InputFromUser()
602622 input.GetGamepadCount(InputManager::PADBIND_JUMP) > 0))
603623 {
604624 jump_wait_ = true;
605- additional_motion_.handle_ = motion.pre_jmp_;
606- additional_motion_.isloop_ = false;
607- additional_motion_.flag_ = true;
608- additional_motion_.nextanim_handle_ = motion.jmp_;
609- additional_motion_.loopcheck_ = true;
625+ if(move_dir == 0)
626+ {
627+ additional_motion_.handle_ = motion.pre_jmp_;
628+ additional_motion_.isloop_ = false;
629+ additional_motion_.flag_ = true;
630+ additional_motion_.nextanim_handle_ = motion.jmp_;
631+ additional_motion_.loopcheck_ = true;
632+ additional_motion_.next_connection_ = false;
633+ }else if(current_stat_.acc.y == 0){
634+ additional_motion_.handle_ = motion.jmp_;
635+ additional_motion_.isloop_ = true;
636+ any_move_ = true;
637+ current_stat_.acc.y = -9.8 * stage_->map_scale();
638+ current_stat_.vel += VGet(0, jump_height_ * stage_->map_scale(), 0);
639+ additional_motion_.flag_ = true;
640+ }
610641 }
611642
612643 if (current_stat_.acc.y == 0 && jump_wait_)
@@ -618,6 +649,14 @@ void FieldPlayer::InputFromUser()
618649 current_stat_.vel += VGet(0, jump_height_ * stage_->map_scale(), 0);
619650 }
620651 }
652+
653+ if (stage_->CheckWarpPoint(current_stat_.pos))
654+ {
655+ //stage_->SetHostChangeFlag(true);
656+
657+ auto pos = ConvWorldPosToScreenPos(current_stat_.pos+VGet(0,25,25));
658+
659+ }
621660 }
622661
623662 void FieldPlayer::PlayMotion(const tstring& name,bool isloop)
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,15 +5,15 @@
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),isloopcheck_(false)
8+ connect_prev_(false), prev_blend_rate_(0), blend_time_(0),prev_anim_index_(-1),isloop_(true),isloopcheck_(false),nextconnect_(true)
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, int nextanim_handle, bool isloopcheck)
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, bool nextconnect)
1212 {
1313 if(nextanim_handle != -1)
1414 {
1515 prev_anim_index_ = nextanim_handle;
16- }else{
16+ }else if(!isloop){
1717 prev_anim_index_ = MV1GetAttachAnim(model_handle_,current_attach_index_);
1818 }
1919
@@ -25,6 +25,7 @@ void MotionPlayer::Play(int anim_index, bool connect_prev, int blend_time, int a
2525 blend_time_ = blend_time;
2626 isloop_ = isloop;
2727 isloopcheck_ = isloopcheck;
28+ nextconnect_ = nextconnect;
2829 if(!isloopcheck_)isplayend_ = false;
2930
3031 prev_attach_index_ = current_attach_index_;
@@ -108,7 +109,7 @@ void MotionPlayer::AdvancePlayTime(int diff_time)
108109 {
109110 Stop();
110111 isplayend_ = true;
111- Play(prev_anim_index_,connect_prev_,200,-1,false,true,-1,isloopcheck_);
112+ Play(prev_anim_index_,nextconnect_,200,-1,false,true,-1,isloopcheck_);
112113 return;
113114 }
114115 anim_time -= anim_total_time;
--- a/client/3d/MotionPlayer.hpp
+++ b/client/3d/MotionPlayer.hpp
@@ -4,7 +4,7 @@ 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, int nextanim_handle = -1,bool isloopcheck = false);
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,bool nextconnect = true);
88 void Next(int diff_time);
99 void Stop();
1010 bool GetPlayEnd();
@@ -19,6 +19,7 @@ private:
1919 int prev_anim_index_;
2020 bool isplayend_;
2121 bool isloopcheck_;
22+ bool nextconnect_;
2223
2324 void SetBlendRateToModel();
2425 void DetachPrevMotionIfExist();