OSDN Git Service

ネームタグの表示判定を軽量化
authorh2so5 <h2so5@git.sourceforge.jp>
Thu, 13 Sep 2012 12:02:33 +0000 (21:02 +0900)
committerh2so5 <h2so5@git.sourceforge.jp>
Thu, 13 Sep 2012 12:02:33 +0000 (21:02 +0900)
落ちたときに自動復帰する機能を追加
カメラの移動速度制限を廃止

Readme.txt
client/3d/FieldPlayer.cpp
client/3d/Stage.cpp
client/3d/Stage.hpp
client/3d/model.cpp
client/version.hpp
common/unicode.hpp

index bdda085..70b7140 100644 (file)
@@ -1,4 +1,4 @@
-Miku Miku Online 0.2.7
+Miku Miku Online 0.3.2
 
 // ******************************** 警告 *********************************** //
 // *** 
@@ -17,7 +17,7 @@
 
 
 === 動作環境
- Windows Vista, 7
+ Windows XP, Vista, 7
  2GB RAM
  DirectX 9
  シェーダーモデル 2.0 以上
index 9cbe7f4..3cb7b9d 100644 (file)
@@ -126,6 +126,11 @@ void FieldPlayer::Update()
                SetModel(loading_model_handle_);
                loading_model_handle_ = ModelHandle();
        }
+
+       // 落ちた時に強制復帰
+       if (prev_stat_.pos.y < stage_->min_height()) {
+               RescuePosition();
+       }
     /*
     if (key_checker_.Check() == -1)
     {
index e6cc014..253cee5 100644 (file)
@@ -9,7 +9,8 @@
 
 Stage::Stage(const tstring& model_name) :
     map_handle_(ResourceManager::LoadModelFromName(model_name)),
-    map_scale_(map_handle_.property().get<float>("scale", 20.0))
+    map_scale_(map_handle_.property().get<float>("scale", 20.0)),
+       min_height_(map_handle_.property().get<float>("min_height", -200.0))
 {
     MV1SetScale(map_handle_.handle(), VGet(map_scale_, map_scale_, map_scale_));
     MV1SetupCollInfo(map_handle_.handle(), -1, 256, 256, 256);
@@ -185,9 +186,14 @@ bool Stage::IsVisiblePoint(const VECTOR& point) const
 {
        MMO_PROFILE_FUNCTION;
 
-    auto coll_info = MV1CollCheck_Line(map_handle_.handle(), -1, point, GetCameraPosition());
+       const auto& camera = GetCameraPosition();
+
+       auto distance = (point.x - camera.x) * (point.x - camera.x) +
+               (point.y - camera.y) * (point.y - camera.y) +
+               (point.z - camera.z) * (point.z - camera.z);
+
     auto screen_pos = ConvWorldPosToScreenPos(point);
-    return (!coll_info.HitFlag && screen_pos.z > 0.0f && screen_pos.z < 1.0f);
+    return (distance < 500000 && screen_pos.z > 0.0f && screen_pos.z < 1.0f);
 }
 
 void Stage::UpdateSkymapPosition(const VECTOR& pos)
@@ -209,3 +215,8 @@ float Stage::map_scale() const
 {
     return map_scale_;
 }
+
+float Stage::min_height() const
+{
+    return min_height_;
+}
\ No newline at end of file
index a13d292..93addfa 100644 (file)
@@ -28,6 +28,7 @@ class Stage {
 
         const ModelHandle& map_handle() const;
         float map_scale() const;
+        float min_height() const;
 
         const std::vector<VECTOR>& start_points() const;
 
@@ -36,6 +37,7 @@ class Stage {
     private:
         ModelHandle map_handle_;
         float map_scale_;
+               float min_height_;
         ModelHandle skymap_handle_;
 
         std::vector<VECTOR> start_points_;
index f919e3a..d8667db 100644 (file)
@@ -132,9 +132,9 @@ void GameLoop::FixCameraPosition()
        }
 
        auto camera_pos_delta = VScale(camera_pos - GetCameraPosition(),(float)0.3);
-    if (VSize(camera_pos_delta) > 10) {
-        camera_pos_delta = VNorm(camera_pos_delta) * 10;
-    }
+    // if (VSize(camera_pos_delta) > 10) {
+    //    camera_pos_delta = VNorm(camera_pos_delta) * 10;
+    //}
 
        SetCameraPositionAndTarget_UpVecY(
                GetCameraPosition() + camera_pos_delta, target_pos);
index 5e1dabe..481a507 100644 (file)
@@ -9,7 +9,7 @@
 
 #define MMO_VERSION_MAJOR 0
 #define MMO_VERSION_MINOR 3
-#define MMO_VERSION_REVISION 1
+#define MMO_VERSION_REVISION 2
 
 #ifdef MMO_VERSION_BUILD
 #define MMO_VERSION_BUILD_TEXT " Build " MMO_VERSION_TOSTRING(MMO_VERSION_BUILD)
index a42510e..3160585 100644 (file)
@@ -28,8 +28,8 @@ namespace unicode {
 
 #ifdef _WIN32
 
-std::string sjis2utf8(std::string);
-std::string utf82sjis(std::string);
+std::string sjis2utf8(const std::string&);
+std::string utf82sjis(const std::string&);
 
 std::string ToString(const std::wstring& s);
 std::wstring ToWString(const std::string& s);