OSDN Git Service

ワープオブジェクトを暫定的に追加
authorangeart <angeart@git.sourceforge.jp>
Sat, 29 Sep 2012 17:41:03 +0000 (02:41 +0900)
committerangeart <angeart@git.sourceforge.jp>
Sat, 29 Sep 2012 17:41:03 +0000 (02:41 +0900)
何故かMV1SetPositionが仕事してない
ジャンプモーションの一時廃止

client/3d/FieldPlayer.cpp
client/3d/Stage.cpp
client/3d/Stage.hpp

index 9b5e193..a5e6ab7 100644 (file)
@@ -340,7 +340,6 @@ void FieldPlayer::Move()
         // 前回キャラが接地していたなら、今回もキャラを地面に接地させる
         if (prev_stat_.acc.y == 0)
         {
-                       jump_wait_ = false;
             // 前回接地していた
             // std::cout << "  previous on the ground" << std::endl;
 
@@ -423,14 +422,9 @@ void FieldPlayer::Move()
                 {
                     // 地面に到達した
                     // std::cout << "    current on the ground" << std::endl;
-                                       additional_motion_.handle_ = motion.end_jmp_;
-                                       additional_motion_.isloop_ = false;
-                                       additional_motion_.nextanim_handle_ = motion.stand_;
-                                       additional_motion_.flag_ = true;
                     current_stat_.pos = foot_floor_exists.second;
                     current_stat_.acc.y = 0;
                     current_stat_.vel.y = 0;
-                                       jump_wait_ = false;
                 }
             }
             else
@@ -597,26 +591,13 @@ void FieldPlayer::InputFromUser()
         current_stat_.roty_speed = 0;
     }
 
-    if (!jump_wait_ &&
-            (input.GetKeyCount(InputManager::KEYBIND_JUMP) > 0 ||
+    if (current_stat_.acc.y == 0 &&
+               (input.GetKeyCount(InputManager::KEYBIND_JUMP) > 0 ||
                     input.GetGamepadCount(InputManager::PADBIND_JUMP) > 0))
     {
-               jump_wait_ = true;
-               additional_motion_.handle_ = motion.pre_jmp_;
-               additional_motion_.isloop_ = false;
-               additional_motion_.flag_ = true;
-               additional_motion_.nextanim_handle_ = motion.jmp_;
-               additional_motion_.loopcheck_ = true;
-    }
-
-       if (current_stat_.acc.y == 0 && jump_wait_)
-       {
-               if(motion_player_->GetPlayEnd())
-               {
                        any_move_ = true;
                        current_stat_.acc.y = -9.8 * stage_->map_scale();
                        current_stat_.vel += VGet(0, jump_height_ * stage_->map_scale(), 0);
-               }
        }
 }
 
index a640e09..3f36c62 100644 (file)
@@ -12,7 +12,7 @@ Stage::Stage(const tstring& model_name) :
     map_scale_(map_handle_.property().get<float>("scale", 20.0)),
        min_height_(map_handle_.property().get<float>("min_height", -200.0)),
        host_change_flag_(false)
-{
+       {
     MV1SetScale(map_handle_.handle(), VGet(map_scale_, map_scale_, map_scale_));
     MV1SetupCollInfo(map_handle_.handle(), -1, 128, 64, 128);// 元の数値は256,256,256
 
@@ -36,6 +36,19 @@ Stage::Stage(const tstring& model_name) :
     if (warp_points_.empty()) {
         warp_points_.push_back(VGet(0,0,0));
     }
+       auto warpobj_name = map_handle_.property().get<std::string>("stage.warpobj_name", unicode::ToString(_T("warpobj:デフォルトワープオブジェクト")));
+       warpobj_handle_ = ResourceManager::LoadModelFromName(unicode::ToTString(warpobj_name));
+
+       float warpobj_scale = warpobj_handle_.property().get<float>("scale",12.5f);
+       if(warpobj_scale != 1.0f)MV1SetScale(warpobj_handle_.handle(), VGet(warpobj_scale, warpobj_scale, warpobj_scale));
+       auto warpobj_push_it = warp_points_.begin();
+       while(!warpobj_handle_.CheckLoaded());
+       for( warpobj_push_it; warpobj_push_it != warp_points_.end(); ++warpobj_push_it)
+       {
+               auto tmp = ResourceManager::LoadModelFromName(unicode::ToTString(warpobj_name));
+               MV1SetPosition(tmp,*warpobj_push_it);
+               warpobj_array_.push_back(tmp);
+       }
 
     auto skymap_name = map_handle_.property().get<std::string>("stage.skydome", unicode::ToString(_T("skydome:入道雲のある風景")));
     skymap_handle_ = ResourceManager::LoadModelFromName(unicode::ToTString(skymap_name));
@@ -55,6 +68,10 @@ void Stage::Draw()
 
     MV1DrawModel(skymap_handle_.handle());
     MV1DrawModel(map_handle_.handle());
+       BOOST_FOREACH(auto warp_handle,warpobj_array_)
+       {
+               MV1DrawModel(warp_handle.handle());
+       }
 }
 
 float Stage::GetFloorY(const VECTOR& v1, const VECTOR& v2) const
index af2cfe0..22fab3f 100644 (file)
@@ -9,6 +9,7 @@
 #include <DxLib.h>
 #include "dx_vector.hpp"
 #include "../ResourceManager.hpp"
+#include "../ui/InputBox.hpp"
 
 class Stage {
     public:
@@ -45,6 +46,8 @@ class Stage {
         float map_scale_;
                float min_height_;
         ModelHandle skymap_handle_;
+               ModelHandle warpobj_handle_;
+               std::vector<ModelHandle> warpobj_array_;
 
         std::vector<VECTOR> start_points_;
                std::vector<VECTOR> warp_points_;