OSDN Git Service

UIListのバグを修正
authorh2so5 <h2so5@git.sourceforge.jp>
Mon, 17 Sep 2012 14:40:12 +0000 (23:40 +0900)
committerh2so5 <h2so5@git.sourceforge.jp>
Mon, 17 Sep 2012 14:40:12 +0000 (23:40 +0900)
近くのUnknownキャラクターのモデル名を表示

client/3d/Stage.cpp
client/3d/Stage.hpp
client/PlayerManager.cpp
client/WorldManager.cpp
client/WorldManager.hpp
client/ui/UIList.cpp
client/version.hpp

index ff1c0e3..12d78f7 100644 (file)
@@ -235,6 +235,20 @@ bool Stage::IsVisiblePoint(const VECTOR& point) const
     return (distance < 500000 && screen_pos.z > 0.0f && screen_pos.z < 1.0f);
 }
 
+bool Stage::IsNearPoint(const VECTOR& point) const
+{
+       MMO_PROFILE_FUNCTION;
+
+       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 (distance < 10000 && screen_pos.z > 0.0f && screen_pos.z < 1.0f);
+}
+
 void Stage::UpdateSkymapPosition(const VECTOR& pos)
 {
     MV1SetPosition(skymap_handle_.handle(), VGet(pos.x, 800, pos.z));
index b03698e..af2cfe0 100644 (file)
@@ -26,6 +26,7 @@ class Stage {
         float height_begin, float height_end, size_t num_division) const;
 
         bool IsVisiblePoint(const VECTOR& point) const;
+        bool IsNearPoint(const VECTOR& point) const;
 
         const ModelHandle& map_handle() const;
         float map_scale() const;
index 8e831bb..0ecdf31 100644 (file)
Binary files a/client/PlayerManager.cpp and b/client/PlayerManager.cpp differ
index c0bb568..ead57de 100644 (file)
Binary files a/client/WorldManager.cpp and b/client/WorldManager.cpp differ
index eda141b..b1cbd8a 100644 (file)
@@ -21,6 +21,7 @@ class WorldManager {
         void Draw();
 
         bool IsVisiblePoint(const VECTOR& point);
+        bool IsNearPoint(const VECTOR& point);
         void ResetCameraPosition();
 
     public:
index aeaa891..0ca450d 100644 (file)
@@ -136,7 +136,7 @@ void UIList::ProcessInput(InputManager* input)
     for (auto it = items_.begin(); it != items_.end(); ++it) {
         auto item = *it;
         UIBasePtr item_ptr = *static_cast<UIBasePtr*>(item->GetPointerFromInternalField(0));
-               if (input->GetMousePos().first > absolute_y() && 
+               if (input->GetMousePos().second > absolute_y() && 
                        input->GetMousePos().second < absolute_y() + absolute_height()) {
                        item_ptr->ProcessInput(input);
                }
index 9307a6e..4243b44 100644 (file)
@@ -9,7 +9,7 @@
 
 #define MMO_VERSION_MAJOR 0
 #define MMO_VERSION_MINOR 3
-#define MMO_VERSION_REVISION 5
+#define MMO_VERSION_REVISION 6
 
 #define MMO_PROTOCOL_VERSION 2