Aggiunta restituzione Z_acc su gamba

This commit is contained in:
2026-06-20 17:26:05 +02:00
parent bf10647b70
commit 51c620ef4d
4 changed files with 14 additions and 2 deletions
+2 -1
View File
@@ -6,7 +6,7 @@
class Gamba : public CollectionInterface {
protected:
std::vector<PieceInterface*> sensori;
std::vector<Sensore*> sensori;
std::vector<PieceInterface*> pezzi;
std::vector<JointInterface*> joints;
public:
@@ -15,6 +15,7 @@ class Gamba : public CollectionInterface {
PieceInterface* getJointPiece();
void setDirection(Direction dir);
bool setTransparency(float alpha) override;
float getZ_Acc();
};
#endif
+10
View File
@@ -66,4 +66,14 @@ bool Gamba::setTransparency(float alpha){
if (!i->setTransparency(alpha)) return false;
}
return true;
}
float Gamba::getZ_Acc(){
float totZ_Acc = 0;
for (auto i : sensori){
totZ_Acc += i->getZ_Acc();
}
return totZ_Acc;
}