load map/obj

This commit is contained in:
Joachim Rey 2025-10-09 21:33:37 +02:00
parent 6b454d46ad
commit 8383fc1edf
18 changed files with 305 additions and 43 deletions

23
src/object/point.cpp Normal file
View file

@ -0,0 +1,23 @@
#include "point.h"
#include <string>
Point::Point(std::string &txt) {
size_t pos = 0;
while ((pos = txt.find(",")) != std::string::npos) {
this->xyz.push_back(new float(std::stof(txt.substr(0, pos))));
txt.erase(0, pos + 1);
}
this->xyz.push_back(new float(std::stof(txt)));
}
uint16_t Point::translate3D() { return 0; };
float Point::getX() { return (*this->xyz.at(0)); }
float Point::getY() { return (*this->xyz.at(1)); }
float Point::getZ() { return (*this->xyz.at(2)); }
std::ostream & operator<<(std::ostream& os, Point& p){
os << " - Point " << &p << "\n - X: " << p.getX() << "\n - Y: "<< p.getY() << "\n - Z: "<< p.getZ() << std::endl;
return os;
}