Aggiuto controllo trasparenza nelle collezioni

This commit is contained in:
2026-06-20 09:57:53 +02:00
parent 83f132a1c4
commit fc5eba1279
5 changed files with 20 additions and 1 deletions
@@ -13,6 +13,7 @@ struct collection{
class CollectionInterface{
public:
virtual collection create(ReferencePlane plane) = 0;
virtual bool setTransparency(float alpha) = 0;
virtual ~CollectionInterface(){};
};
+1
View File
@@ -14,6 +14,7 @@ class Gamba : public CollectionInterface {
collection create(ReferencePlane plane) override;
PieceInterface* getJointPiece();
void setDirection(Direction dir);
bool setTransparency(float alpha) override;
};
#endif
+1 -1
View File
@@ -28,7 +28,7 @@ public:
~Lower_Body();
void setVisibility(bool c);
void setTransparency(float t);
bool setTransparency(float alpha) override;
collection create(ReferencePlane plane) override;
};
+10
View File
@@ -57,3 +57,13 @@ void Gamba::setDirection(Direction dir){
i->setDirection(dir);
}
}
bool Gamba::setTransparency(float alpha){
for (auto i : pezzi){
if (!i->setTransparency(alpha)) return false;
}
for (auto i : sensori){
if (!i->setTransparency(alpha)) return false;
}
return true;
}
+7
View File
@@ -53,3 +53,10 @@ Lower_Body::~Lower_Body(){
void Lower_Body::setVisibility(bool c){
}
bool Lower_Body::setTransparency(float alpha){
if (!sx->setTransparency(alpha)) return false;
dx->setTransparency(alpha);
t->setTransparency(alpha);
return true;
}