Aggiunta viusalizzazione collection su sfml_util

This commit is contained in:
2026-06-19 11:33:47 +02:00
parent 23798ab582
commit 0d4b6d1242
8 changed files with 75 additions and 17 deletions
@@ -24,9 +24,16 @@ inline collection operator+(collection c1, collection c2){
for (PieceInterface* i : c1.pieces){
res.pieces.push_back(i);
}
for (PieceInterface* i : c2.pieces){
res.pieces.push_back(i);
}
for (JointInterface* i : c1.joints){
res.joints.push_back(i);
}
for (JointInterface* i : c2.joints){
res.joints.push_back(i);
}
return res;
}
+1
View File
@@ -28,6 +28,7 @@ public:
~Lower_Body();
void setVisibility(bool c);
void setTransparency(float t);
collection create(ReferencePlane plane) override;
};
+6 -6
View File
@@ -3,15 +3,15 @@
Gamba::Gamba(rb::Vector3 pos, unsigned int* dataPos, std::string cosciaData, std::string cavigliaData){
CSVProcessor processor;
try {
processor.readCSVFile (DATA_PATH + "coscia_filt.csv");
const auto& coscia = processor.getData();
processor.readCSVFile(DATA_PATH + "caviglia_filt.csv");
const auto& caviglia = processor.getData();
pezzi.push_back(new Coscia(pos,2));
pezzi.push_back(new Caviglia(rb::Vector3{pos[0],pos[1],pos[2]+200},2));
processor.readCSVFile (DATA_PATH + cosciaData);
const auto& coscia = processor.getData();
sensori.push_back(new Sensore(pos,_Float16( 0.2 ),dataPos,coscia));
processor.readCSVFile(DATA_PATH + cavigliaData);
const auto& caviglia = processor.getData();
sensori.push_back(new Sensore (rb::Vector3{pos[0],pos[1],pos[2]+200},_Float16( 0.2 ),dataPos,caviglia));
// modifico la rotazione relativa della gamba
+5 -2
View File
@@ -4,7 +4,7 @@ Lower_Body::Lower_Body(rb::Vector3 pos,std::vector<gamba_data> data){
if (data.size() != 2) throw "Lower_Body_Error: data vector size must be 2";
sx = new Gamba({pos[0],pos[1],pos[2]+150},data[0].dataPos,data[0].cosciaData,data[0].cavigliaData);
dx = new Gamba({pos[0],pos[1],pos[2]+150},data[1].dataPos,data[1].cosciaData,data[1].cavigliaData);
dx = new Gamba({pos[0],pos[1]+100,pos[2]+150},data[1].dataPos,data[1].cosciaData,data[1].cavigliaData);
t = new Torso({pos[0],pos[1]+100,pos[2]},_Float16(3.0));
PieceInterface* psx = sx->getJointPiece();
@@ -18,7 +18,6 @@ Lower_Body::Lower_Body(rb::Vector3 pos,std::vector<gamba_data> data){
collection Lower_Body::create(ReferencePlane plane){
collection coll;
switch (plane)
{
case ReferencePlane::XZ: case ReferencePlane::XZN:
@@ -33,6 +32,10 @@ collection Lower_Body::create(ReferencePlane plane){
default:
break;
}
coll.pieces.push_back(t);
coll.joints.push_back(jsx);
coll.joints.push_back(jdx);
return coll;
}