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));
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;
void Draw();
bool IsVisiblePoint(const VECTOR& point);
+ bool IsNearPoint(const VECTOR& point);
void ResetCameraPosition();
public:
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);
}
#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