16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 19:29:19 +02:00

vehicle params window, aware system rewrite, sifa

This commit is contained in:
milek7
2019-03-16 01:21:59 +01:00
parent f1c8c8f1cd
commit 3556a2d0e6
24 changed files with 622 additions and 451 deletions

View File

@@ -4,37 +4,42 @@
#include "Event.h"
#include "scene.h"
namespace map {
namespace map
{
struct map_object {
std::string name;
glm::vec3 location;
struct map_object
{
std::string name;
glm::vec3 location;
virtual ~map_object() = default;
};
virtual ~map_object() = default;
};
using object_list = std::vector<std::shared_ptr<map::map_object>>;
using sorted_object_list = std::map<float, std::shared_ptr<map::map_object>>;
using object_list = std::vector<std::shared_ptr<map::map_object>>;
using sorted_object_list = std::map<float, std::shared_ptr<map::map_object>>;
// semaphore description (only for minimap purposes)
struct semaphore : public map_object {
std::vector<TAnimModel *> models;
// semaphore description (only for minimap purposes)
struct semaphore : public map_object
{
std::vector<TAnimModel *> models;
std::vector<basic_event *> events;
};
std::vector<basic_event *> events;
};
// switch description (only for minimap purposes)
struct track_switch : public map_object {
basic_event *straight_event = nullptr;
basic_event *divert_event = nullptr;
};
// switch description (only for minimap purposes)
struct track_switch : public map_object
{
basic_event *straight_event = nullptr;
basic_event *divert_event = nullptr;
};
struct objects {
std::vector<std::shared_ptr<map_object>> entries;
struct objects
{
std::vector<std::shared_ptr<map_object>> entries;
// returns objects in range from vec3, NaN in Y ignores it
sorted_object_list find_in_range(glm::vec3 from, float distance);
};
// returns objects in range from vec3, NaN in Y ignores it
sorted_object_list find_in_range(glm::vec3 from, float distance);
};
extern objects Objects;
}
extern objects Objects;
} // namespace map