Model loading

This commit is contained in:
Pascal Serrarens 2024-11-15 14:52:08 +01:00
parent 51e605ca6d
commit 4b21057fdd
3 changed files with 16 additions and 0 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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;
};