From 3ef70aca3f5d6cc4c108aa76eac2b6098c3b62f4 Mon Sep 17 00:00:00 2001 From: angeart Date: Sun, 2 Sep 2012 02:33:34 +0900 Subject: [PATCH] =?utf8?q?=E3=82=B8=E3=83=A3=E3=83=B3=E3=83=97=E3=81=AE?= =?utf8?q?=E5=BC=8F=E3=82=92=E5=86=8D=E4=BF=AE=E6=AD=A3=E3=80=81=E3=82=B3?= =?utf8?q?=E3=83=9F=E3=83=83=E3=83=88=E3=81=99=E3=82=8B=E3=83=95=E3=82=A1?= =?utf8?q?=E3=82=A4=E3=83=AB=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ client/3d/FieldPlayer.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index ac03cc4..15cba42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ *.suo *.sdf *.opensdf +*.sln +*.vcxproj /ipch /Release /Debug diff --git a/client/3d/FieldPlayer.cpp b/client/3d/FieldPlayer.cpp index 8092f4c..9ec28c1 100644 --- a/client/3d/FieldPlayer.cpp +++ b/client/3d/FieldPlayer.cpp @@ -145,14 +145,14 @@ void FieldPlayer::Move() // std::cout << "MovePlayer: " << timer.current_time() << std::endl; // myself_.prev_statを元にしてmyself_.current_statを計算する - //current_stat_.pos = prev_stat_.pos + prev_stat_.vel * timer_->DeltaSec(); - current_stat_.pos = [&]()->VECTOR + current_stat_.pos = prev_stat_.pos + prev_stat_.vel * timer_->DeltaSec(); + //current_stat_.vel = prev_stat_.vel + prev_stat_.acc * timer_->DeltaSec(); + current_stat_.vel = [&]()->VECTOR { - VECTOR tmp_vel_ = prev_stat_.vel * timer_->DeltaSec(); - tmp_vel_.y *= 1.0f / flight_duration_ideal_; - return prev_stat_.pos + tmp_vel_; + VECTOR tmp_acc_ = prev_stat_.acc * timer_->DeltaSec(); + tmp_acc_.y *= 1.0f / flight_duration_ideal_; + return prev_stat_.vel + tmp_acc_; }(); - current_stat_.vel = prev_stat_.vel + prev_stat_.acc * timer_->DeltaSec(); current_stat_.acc = prev_stat_.acc; current_stat_.roty = prev_stat_.roty + prev_stat_.roty_speed * timer_->DeltaSec(); -- 2.11.0