Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 14c143ff56 | |||
| 4ef359d64c | |||
| 4d8d1316e0 | |||
| e440779338 | |||
| fc5eba1279 | |||
| 83f132a1c4 | |||
| a2eee90e10 | |||
| fa6d6cf76e |
+1
-1
@@ -53,7 +53,7 @@ target_compile_options(common INTERFACE
|
|||||||
|
|
||||||
set(METHODS_PATH "./src/*/methods/*.cpp")
|
set(METHODS_PATH "./src/*/methods/*.cpp")
|
||||||
|
|
||||||
set(VERSION "V6")
|
set(VERSION "V7")
|
||||||
|
|
||||||
file(GLOB_RECURSE METHODS_SRC "${METHODS_PATH}")
|
file(GLOB_RECURSE METHODS_SRC "${METHODS_PATH}")
|
||||||
add_executable(main${VERSION} ./src/testMain.cpp ${METHODS_SRC} )
|
add_executable(main${VERSION} ./src/testMain.cpp ${METHODS_SRC} )
|
||||||
|
|||||||
@@ -43,10 +43,17 @@ Per spostare l'intera scena si tiene premuto il tasto centrale del mouse.
|
|||||||
- Modifica di sfml_util per gestire le collezioni
|
- Modifica di sfml_util per gestire le collezioni
|
||||||
- Aggiunta modalità debug
|
- Aggiunta modalità debug
|
||||||
|
|
||||||
|
## Nella versione v0.7
|
||||||
|
- Aggiunta impostazione di trasparenza dei pezzi
|
||||||
|
- Aggiustato cambio direzione della gamba (sulla visualizzazione dei piani XZ e -XZ)
|
||||||
|
- Aggiunto controllo trasparenza delle collezioni
|
||||||
|
- Modificato lower_body per gestire la trasparenza della gamba più lontana
|
||||||
|
- Ridimensionato bacino per migiore visualizzazione
|
||||||
|
|
||||||
# Per compilare:
|
# Per compilare:
|
||||||
|
|
||||||
cmake --build
|
cmake --build
|
||||||
|
|
||||||
# Per lanciare:
|
# Per lanciare:
|
||||||
|
|
||||||
./build/bin/mainV6
|
./build/bin/mainV7
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -13,6 +13,7 @@ struct collection{
|
|||||||
class CollectionInterface{
|
class CollectionInterface{
|
||||||
public:
|
public:
|
||||||
virtual collection create(ReferencePlane plane) = 0;
|
virtual collection create(ReferencePlane plane) = 0;
|
||||||
|
virtual bool setTransparency(float alpha) = 0;
|
||||||
virtual ~CollectionInterface(){};
|
virtual ~CollectionInterface(){};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ class Gamba : public CollectionInterface {
|
|||||||
Gamba(rb::Vector3 pos, unsigned int* dataPos, std::string cosciaData, std::string cavigliaData);
|
Gamba(rb::Vector3 pos, unsigned int* dataPos, std::string cosciaData, std::string cavigliaData);
|
||||||
collection create(ReferencePlane plane) override;
|
collection create(ReferencePlane plane) override;
|
||||||
PieceInterface* getJointPiece();
|
PieceInterface* getJointPiece();
|
||||||
|
void setDirection(Direction dir);
|
||||||
|
bool setTransparency(float alpha) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
~Lower_Body();
|
~Lower_Body();
|
||||||
|
|
||||||
void setVisibility(bool c);
|
void setVisibility(bool c);
|
||||||
void setTransparency(float t);
|
bool setTransparency(float alpha) override;
|
||||||
collection create(ReferencePlane plane) override;
|
collection create(ReferencePlane plane) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ Gamba::Gamba(rb::Vector3 pos, unsigned int* dataPos, std::string cosciaData, std
|
|||||||
sensori.push_back(new Sensore (rb::Vector3{pos[0],pos[1],pos[2]+200},_Float16( 0.2 ),dataPos,caviglia));
|
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
|
// modifico la rotazione relativa della gamba
|
||||||
sensori[0]->body.setRot({_Float16 (1.3),_Float16 (1.7),0});
|
sensori[0]->body.setRot({_Float16 (1.5708),_Float16 (1.5708),0});
|
||||||
sensori[1]->body.setRot({_Float16 (1.8),_Float16 (1.7),0});
|
sensori[1]->body.setRot({_Float16 (1.5708),_Float16 (1.5708),0});
|
||||||
|
|
||||||
joints.push_back(new RigidJoint(sensori[0], {pezzi[0]}));
|
joints.push_back(new RigidJoint(sensori[0], {pezzi[0]}));
|
||||||
joints.push_back(new PivotJoint(sensori[0], {sensori[1]}, rb::Vector3{0,0,100}));
|
joints.push_back(new PivotJoint(sensori[0], {sensori[1]}, rb::Vector3{0,0,100}));
|
||||||
@@ -47,4 +47,23 @@ collection Gamba::create(ReferencePlane plane){
|
|||||||
|
|
||||||
PieceInterface* Gamba::getJointPiece(){
|
PieceInterface* Gamba::getJointPiece(){
|
||||||
return sensori[0];
|
return sensori[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
void Gamba::setDirection(Direction dir){
|
||||||
|
for (auto i : pezzi){
|
||||||
|
i->setDirection(dir);
|
||||||
|
}
|
||||||
|
for (auto i : sensori){
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
@@ -3,28 +3,43 @@
|
|||||||
Lower_Body::Lower_Body(rb::Vector3 pos,std::vector<gamba_data> data){
|
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";
|
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);
|
sx = new Gamba({pos[0],pos[1]-60,pos[2]+150},data[0].dataPos,data[0].cosciaData,data[0].cavigliaData);
|
||||||
dx = new Gamba({pos[0],pos[1]+200,pos[2]+150},data[1].dataPos,data[1].cosciaData,data[1].cavigliaData);
|
dx = new Gamba({pos[0],pos[1]+60,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));
|
t = new Torso({pos[0],pos[1],pos[2]},_Float16(3.0));
|
||||||
|
|
||||||
PieceInterface* psx = sx->getJointPiece();
|
PieceInterface* psx = sx->getJointPiece();
|
||||||
PieceInterface* pdx = dx->getJointPiece();
|
PieceInterface* pdx = dx->getJointPiece();
|
||||||
|
|
||||||
jsx = new PivotJoint(t, {psx}, rb::Vector3{0,-100,50});
|
jsx = new PivotJoint(t, {psx}, rb::Vector3{0,-60,50});
|
||||||
jdx = new PivotJoint(t, {pdx}, rb::Vector3{0,100,50});
|
jdx = new PivotJoint(t, {pdx}, rb::Vector3{0,60,50});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
collection Lower_Body::create(ReferencePlane plane){
|
collection Lower_Body::create(ReferencePlane plane){
|
||||||
collection coll;
|
collection coll;
|
||||||
|
|
||||||
|
sx->setTransparency(1);
|
||||||
|
dx->setTransparency(1);
|
||||||
|
|
||||||
switch (plane)
|
switch (plane)
|
||||||
{
|
{
|
||||||
case ReferencePlane::XZ: case ReferencePlane::XZN:
|
case ReferencePlane::XZN:
|
||||||
|
dx->setTransparency(0.5);
|
||||||
|
dx->setDirection(Direction::L);
|
||||||
|
sx->setDirection(Direction::R);
|
||||||
|
coll = coll + dx->create(plane);
|
||||||
|
coll = coll + sx->create(plane);
|
||||||
|
break;
|
||||||
|
case ReferencePlane::XZ:
|
||||||
|
sx->setTransparency(0.5);
|
||||||
|
dx->setDirection(Direction::R);
|
||||||
|
sx->setDirection(Direction::L);
|
||||||
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:
|
||||||
|
sx->setDirection(Direction::R);
|
||||||
|
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;
|
||||||
@@ -50,4 +65,11 @@ Lower_Body::~Lower_Body(){
|
|||||||
|
|
||||||
void Lower_Body::setVisibility(bool c){
|
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;
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,11 @@ enum class ReferencePlane {
|
|||||||
XZN
|
XZN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class Direction {
|
||||||
|
L,
|
||||||
|
R
|
||||||
|
};
|
||||||
|
|
||||||
//classi
|
//classi
|
||||||
class PieceInterface{
|
class PieceInterface{
|
||||||
protected:
|
protected:
|
||||||
@@ -25,16 +30,25 @@ class PieceInterface{
|
|||||||
shapeXZ->setFillColor(color);
|
shapeXZ->setFillColor(color);
|
||||||
shapeYZ->setFillColor(color);
|
shapeYZ->setFillColor(color);
|
||||||
}
|
}
|
||||||
|
Direction direction = Direction::L;
|
||||||
public:
|
public:
|
||||||
sf::Shape* shapeXZ, *shapeYZ;
|
sf::Shape* shapeXZ, *shapeYZ;
|
||||||
rb::Vector3 globalPos;
|
rb::Vector3 globalPos;
|
||||||
rb::rigidbody body;
|
rb::rigidbody body;
|
||||||
sf::Color color;
|
sf::Color color;
|
||||||
|
float transparency = 1.0; //canale alpha del pezzo
|
||||||
|
|
||||||
virtual void update(sf::Clock cl) = 0;
|
virtual void update(sf::Clock cl) = 0;
|
||||||
virtual sf::Shape* draw(ReferencePlane plane) = 0;
|
virtual sf::Shape* draw(ReferencePlane plane) = 0;
|
||||||
virtual ~PieceInterface(){}
|
virtual ~PieceInterface(){}
|
||||||
|
virtual void setDirection(Direction dir){
|
||||||
|
direction = dir;
|
||||||
|
}
|
||||||
|
virtual bool setTransparency(float alpha){
|
||||||
|
if (alpha < 0 || alpha > 1) return false;
|
||||||
|
transparency = alpha;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
class Torso : public PieceInterface{
|
class Torso : public PieceInterface{
|
||||||
private:
|
private:
|
||||||
const sf::Vector3f torso_Dim = {100, 100, 250};
|
const sf::Vector3f torso_Dim = {100, 100, 150};
|
||||||
const sf::Color torso_Col = sf::Color::Red;
|
const sf::Color torso_Col = sf::Color::Red;
|
||||||
public:
|
public:
|
||||||
Torso(rb::Vector3 coords, _Float16 mass);
|
Torso(rb::Vector3 coords, _Float16 mass);
|
||||||
|
|||||||
@@ -26,12 +26,13 @@ sf::Shape* Caviglia::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->setScale({1,cos(float(tmpRot[0]))});
|
shape->setScale({1,cos(float(tmpRot[0]))});
|
||||||
|
shape->setFillColor(color*sf::Color(255,255,255,transparency*255));
|
||||||
return shape;}
|
return shape;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -41,6 +42,7 @@ sf::Shape* Caviglia::draw(ReferencePlane plane){
|
|||||||
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->setScale({1,cos(float(tmpRot[1]))});
|
shape->setScale({1,cos(float(tmpRot[1]))});
|
||||||
|
shape->setFillColor(color*sf::Color(255,255,255,transparency*255));
|
||||||
return shape;}
|
return shape;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -25,17 +25,13 @@ sf::Shape* Coscia::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]});
|
||||||
|
|
||||||
//calcolo ridimensionamento dato da cos(x)-> questo per definire l'ancoraggio corretto del pivot
|
|
||||||
shape->setScale({1,cos(float(tmpRot[0]))});
|
shape->setScale({1,cos(float(tmpRot[0]))});
|
||||||
//shape->setScale({1,(0.5* cos(float(tmpRot[0]*2)))+0.5});
|
shape->setFillColor(color*sf::Color(255,255,255,transparency*255));
|
||||||
|
|
||||||
|
|
||||||
return shape;}
|
return shape;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -44,10 +40,8 @@ sf::Shape* Coscia::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));
|
||||||
//calcolo ridimensionamento dato da cos(x) -> questo per definire l'ancoraggio corretto del pivot
|
|
||||||
shape->setScale({1,cos(float(tmpRot[1]))});
|
shape->setScale({1,cos(float(tmpRot[1]))});
|
||||||
//shape->setScale({1,(0.5* cos(float(tmpRot[1]*2)))+0.5});
|
|
||||||
return shape;}
|
return shape;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -60,11 +60,13 @@ sf::Shape* Sensore::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;
|
||||||
|
|
||||||
@@ -73,6 +75,7 @@ sf::Shape* Sensore::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;
|
||||||
|
|
||||||
@@ -85,7 +88,7 @@ sf::Shape* Sensore::draw(ReferencePlane plane){
|
|||||||
|
|
||||||
|
|
||||||
void Sensore::calcRotWithG(unsigned int index){ // calcolo rotazione con valori della gravità
|
void Sensore::calcRotWithG(unsigned int index){ // calcolo rotazione con valori della gravità
|
||||||
|
int dir = direction == Direction::R ? -1 : 1;
|
||||||
std::vector<float> grav = gData[index];
|
std::vector<float> grav = gData[index];
|
||||||
float modG = sqrt(pow(grav[0],2)+pow(grav[1],2)+pow(grav[2],2));
|
float modG = sqrt(pow(grav[0],2)+pow(grav[1],2)+pow(grav[2],2));
|
||||||
|
|
||||||
@@ -95,8 +98,8 @@ void Sensore::calcRotWithG(unsigned int index){ // calcolo rotazione con valori
|
|||||||
float tmpSinY = -grav[1] / modG;
|
float tmpSinY = -grav[1] / modG;
|
||||||
float tmpSinZ = -grav[2] / modG;
|
float tmpSinZ = -grav[2] / modG;
|
||||||
|
|
||||||
float tmpAX = acos(tmpSinX);
|
float tmpAX = acos(dir*tmpSinX);
|
||||||
float tmpAY = acos(tmpSinY);
|
float tmpAY = acos(dir*tmpSinY);
|
||||||
float tmpAZ = acos(tmpSinZ);
|
float tmpAZ = acos(tmpSinZ);
|
||||||
|
|
||||||
body.setRot(rb::Vector3{tmpAY, tmpAX, tmpAZ });
|
body.setRot(rb::Vector3{tmpAY, tmpAX, tmpAZ });
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -43,8 +43,8 @@ int main() {
|
|||||||
const auto& coscia = processor.getData();
|
const auto& coscia = processor.getData();
|
||||||
gs.setIntervall(coscia.size());
|
gs.setIntervall(coscia.size());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
gs.pieces.push_back(new Coscia (rb::Vector3{300,300,300},2));
|
gs.pieces.push_back(new Coscia (rb::Vector3{0,0,0},2));
|
||||||
gs.pieces.push_back(new Sensore (rb::Vector3{300,300,300},_Float16( 0.2 ),&pos,coscia));
|
gs.pieces.push_back(new Sensore (rb::Vector3{300,300,300},_Float16( 0.2 ),&pos,coscia));
|
||||||
gs.pieces.push_back(new Caviglia (rb::Vector3{300,300,500},1));
|
gs.pieces.push_back(new Caviglia (rb::Vector3{300,300,500},1));
|
||||||
|
|
||||||
@@ -68,11 +68,12 @@ int main() {
|
|||||||
gs.joints.push_back(new RigidJoint(gs.pieces[1], {gs.pieces[0]}));
|
gs.joints.push_back(new RigidJoint(gs.pieces[1], {gs.pieces[0]}));
|
||||||
gs.joints.push_back(new PivotJoint(gs.pieces[1], {gs.pieces[3]}, rb::Vector3{0,0,100}));
|
gs.joints.push_back(new PivotJoint(gs.pieces[1], {gs.pieces[3]}, rb::Vector3{0,0,100}));
|
||||||
gs.joints.push_back(new RigidJoint(gs.pieces[3], {gs.pieces[2]}));
|
gs.joints.push_back(new RigidJoint(gs.pieces[3], {gs.pieces[2]}));
|
||||||
|
|
||||||
|
gs.pieces[2]->setDirection(Direction::R);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//provo ad aggiungere una collection
|
//provo ad aggiungere una collection
|
||||||
//gs.collections.push_back(new Gamba({220,0,220},&pos,"coscia_filt.csv","caviglia_filt.csv"));
|
//gs.collections.push_back(new Gamba({220,0,220},&pos,"coscia_filt.csv","caviglia_filt.csv"));
|
||||||
|
|
||||||
std::vector<gamba_data> data;
|
std::vector<gamba_data> data;
|
||||||
gamba_data d;
|
gamba_data d;
|
||||||
d.dataPos = &pos;
|
d.dataPos = &pos;
|
||||||
@@ -85,7 +86,7 @@ int main() {
|
|||||||
data.push_back(d);
|
data.push_back(d);
|
||||||
data.push_back(s);
|
data.push_back(s);
|
||||||
gs.collections.push_back(new Lower_Body(rb::Vector3{200,200,100},data));
|
gs.collections.push_back(new Lower_Body(rb::Vector3{200,200,100},data));
|
||||||
|
|
||||||
printf("Ho costruito tutto!\n");
|
printf("Ho costruito tutto!\n");
|
||||||
}
|
}
|
||||||
catch(char* e){
|
catch(char* e){
|
||||||
|
|||||||
Reference in New Issue
Block a user