// // Created by Иван Ильин on 13.01.2021. // #ifndef ENGINE_WORLD_H #define ENGINE_WORLD_H #include #include "Camera.h" #include "physics/RigidBody.h" class World { private: std::map> _objects; public: World() = default; void checkCollision(const std::string& body); void update(); void projectObjectsInCamera(std::shared_ptr camera); void addBody(std::shared_ptr mesh, const std::string& name = ""); std::shared_ptr body(const std::string& name); void removeBody(std::string name); void loadBody(const std::string &name, const std::string &filename, const std::string &materials = "", const Point4D& scale = Point4D{1, 1, 1}); // rayCast returns pair of Point4D and std::string: // 1) Point4D is point of collision (the last coordinate is -1 if there are no collisions) // 2) std::string - title of the object std::pair rayCast(const Point4D& from, const Point4D& to); void loadMap(const std::string& filename, const std::string& materials, const std::string& name = "map", const Point4D & scale = Point4D{1, 1, 1}); }; #endif //INC_3DZAVR_WORLD_H