Aggiunto ctrl transp su lower_body in base al piano
This commit is contained in:
Binary file not shown.
@@ -17,16 +17,23 @@ Lower_Body::Lower_Body(rb::Vector3 pos,std::vector<gamba_data> data){
|
|||||||
|
|
||||||
collection Lower_Body::create(ReferencePlane plane){
|
collection Lower_Body::create(ReferencePlane plane){
|
||||||
collection coll;
|
collection coll;
|
||||||
|
dx->setDirection(Direction::R);
|
||||||
|
sx->setTransparency(1);
|
||||||
|
dx->setTransparency(1);
|
||||||
|
|
||||||
switch (plane)
|
switch (plane)
|
||||||
{
|
{
|
||||||
case ReferencePlane::XZ: case ReferencePlane::XZN:
|
case ReferencePlane::XZN:
|
||||||
dx->setDirection(Direction::R);
|
dx->setTransparency(0.5);
|
||||||
|
coll = coll + dx->create(plane);
|
||||||
|
coll = coll + sx->create(plane);
|
||||||
|
break;
|
||||||
|
case ReferencePlane::XZ:
|
||||||
|
sx->setTransparency(0.5);
|
||||||
coll = coll + sx->create(plane);
|
coll = coll + sx->create(plane);
|
||||||
coll = coll + dx->create(plane);
|
coll = coll + dx->create(plane);
|
||||||
break;
|
break;
|
||||||
case ReferencePlane::YZ:
|
case ReferencePlane::YZ:
|
||||||
dx->setDirection(Direction::L);
|
|
||||||
coll = coll + dx->create(plane);
|
coll = coll + dx->create(plane);
|
||||||
coll = coll + sx->create(plane);
|
coll = coll + sx->create(plane);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class PieceInterface{
|
|||||||
virtual bool setTransparency(float alpha){
|
virtual bool setTransparency(float alpha){
|
||||||
if (alpha < 0 || alpha > 1) return false;
|
if (alpha < 0 || alpha > 1) return false;
|
||||||
transparency = alpha;
|
transparency = alpha;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,12 @@ sf::Shape* Torso::draw(ReferencePlane plane){
|
|||||||
|
|
||||||
switch (plane)
|
switch (plane)
|
||||||
{
|
{
|
||||||
case ReferencePlane::XZ:
|
case ReferencePlane::XZ: case ReferencePlane::XZN:
|
||||||
{
|
{
|
||||||
sf::Shape* shape = shapeXZ;
|
sf::Shape* shape = shapeXZ;
|
||||||
shape->setRotation(sf::Angle(sf::radians(tmpRot[1])));
|
shape->setRotation(sf::Angle(sf::radians(tmpRot[1])));
|
||||||
shape->setPosition({tmpPos[0]+globalPos[0],tmpPos[2]+globalPos[2]});
|
shape->setPosition({tmpPos[0]+globalPos[0],tmpPos[2]+globalPos[2]});
|
||||||
|
shape->setFillColor(color*sf::Color(255,255,255,transparency*255));
|
||||||
return shape;}
|
return shape;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ sf::Shape* Torso::draw(ReferencePlane plane){
|
|||||||
sf::Shape* shape = shapeYZ;
|
sf::Shape* shape = shapeYZ;
|
||||||
shape->setRotation(sf::Angle(sf::radians(tmpRot[0])));
|
shape->setRotation(sf::Angle(sf::radians(tmpRot[0])));
|
||||||
shape->setPosition({tmpPos[1]+globalPos[1],tmpPos[2]+globalPos[2]});
|
shape->setPosition({tmpPos[1]+globalPos[1],tmpPos[2]+globalPos[2]});
|
||||||
|
shape->setFillColor(color*sf::Color(255,255,255,transparency*255));
|
||||||
return shape;}
|
return shape;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -320,8 +320,11 @@ void doGUI(State &gs)
|
|||||||
ImGui::Begin("Set visualization plane",0,sdp_flags);
|
ImGui::Begin("Set visualization plane",0,sdp_flags);
|
||||||
const char* MyEnumNames[] = { "XZ", "YZ", "-XZ" };
|
const char* MyEnumNames[] = { "XZ", "YZ", "-XZ" };
|
||||||
int currentPlane = (int)gs.selectedPlane;
|
int currentPlane = (int)gs.selectedPlane;
|
||||||
if (ImGui::SliderInt("Selected Plane", ¤tPlane,0,2,MyEnumNames[currentPlane])) gs.updateCollections();
|
if (ImGui::SliderInt("Selected Plane", ¤tPlane,0,2,MyEnumNames[currentPlane])){
|
||||||
gs.selectedPlane = (ReferencePlane)currentPlane;
|
gs.selectedPlane = (ReferencePlane)currentPlane;
|
||||||
|
gs.updateCollections();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user