diff --git a/NetworkSync.h b/NetworkSync.h index 4347d6c..786934e 100644 --- a/NetworkSync.h +++ b/NetworkSync.h @@ -85,6 +85,8 @@ public: virtual void SendText(const char *s); void SendInt(const int x); + virtual void Download(const char *url) {}; + protected: Roboid *roboid; NetworkPerception *networkPerception; diff --git a/Roboid.cpp b/Roboid.cpp index ec04aad..02a6f3c 100644 --- a/Roboid.cpp +++ b/Roboid.cpp @@ -130,3 +130,11 @@ void Passer::RoboidControl::Roboid::Release(Thing *child) { this->perception->AddTrackedObject(nullptr, Spherical16::zero, SwingTwist16::identity, child->type); } + +void Roboid::LoadModel(const char *url) { + this->modelUrl = url; + if (this->networkSync == nullptr) + return; + + this->networkSync->Download(url); +} \ No newline at end of file diff --git a/Roboid.h b/Roboid.h index c2cb2d8..7164170 100644 --- a/Roboid.h +++ b/Roboid.h @@ -70,6 +70,12 @@ public: nullptr; // thing to track the world origin to be able to transform // world coordinates into roboid or local coordinates // Perhaps this will move to perception at some point + + /// @brief Loads the model and adds the skeleton (if any) to the roboid + /// @param url The url of the model + /// @remark The only supported model format is .gltf + void LoadModel(const char *url); + private: unsigned long lastUpdateTimeMs = 0; };