Changeset 370 in flair-src
- Timestamp:
- Nov 19, 2020, 11:17:30 AM (4 years ago)
- Location:
- trunk/lib/FlairSimulator/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/X4.cpp
r339 r370 25 25 #ifdef GL 26 26 #include <ISceneManager.h> 27 #include <IMeshManipulator.h> 27 28 #include "Blade.h" 28 29 #include "MeshSceneNode.h" … … 76 77 77 78 motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100); 79 80 Tab *visual_tab = new Tab(GetTabWidget(), "visual"); 81 armColorR = new SpinBox(visual_tab->NewRow(), "arm color (R):", 0, 255, 1,255); 82 armColorG = new SpinBox(visual_tab->LastRowLastCol(), "arm color (G):", 0, 255, 1,0); 83 armColorB = new SpinBox(visual_tab->LastRowLastCol(), "arm color (B):", 0, 255, 1,0); 78 84 79 85 motors = new SimuBldc(this, name, 4, modelId,0); … … 98 104 99 105 // cylinders are aligned with y axis 100 IMesh *red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));106 colored_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, armColorR->Value(), armColorG->Value(), armColorB->Value())); 101 107 IMesh *black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128)); 102 108 IMesh *motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128)); … … 104 110 105 111 ITexture *texture = getGui()->getTexture("carbone.jpg"); 106 MeshSceneNode *fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),112 MeshSceneNode *fl_arm = new MeshSceneNode(this, colored_arm, vector3df(0, 0, 0), 107 113 vector3df(0, 0, -135)); 108 MeshSceneNode *fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),114 MeshSceneNode *fr_arm = new MeshSceneNode(this, colored_arm, vector3df(0, 0, 0), 109 115 vector3df(0, 0, -45)); 110 116 MeshSceneNode *rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0), … … 141 147 rr_blade->SetRotationSpeed(K_MOT *vector3df(0, 0, motor_speed[3])); 142 148 motor_speed_mutex->ReleaseMutex(); 149 150 if (armColorR->ValueChanged() == true || armColorG->ValueChanged() == true || armColorB->ValueChanged() == true) { 151 getGui()->getSceneManager()->getMeshManipulator()->setVertexColors(colored_arm, SColor(0,armColorR->Value(), armColorG->Value(), armColorB->Value())); 152 } 143 153 144 154 // adapt UAV size -
trunk/lib/FlairSimulator/src/X4.h
r286 r370 33 33 } 34 34 35 #ifdef GL 36 namespace irr { 37 namespace scene { 38 class IMesh; 39 } 40 } 41 #endif 42 35 43 namespace flair { 36 44 namespace simulator { … … 55 63 Blade *fl_blade, *fr_blade, *rl_blade, *rr_blade; 56 64 core::Mutex *motor_speed_mutex; 65 irr::scene::IMesh *colored_arm; 57 66 #endif 58 67 … … 64 73 gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw; 65 74 gui::SpinBox *motorTimeout; 75 gui::SpinBox *armColorR,*armColorG,*armColorB; 66 76 }; 67 77 } // end namespace simulator -
trunk/lib/FlairSimulator/src/X8.cpp
r339 r370 25 25 #ifdef GL 26 26 #include <ISceneManager.h> 27 #include <IMeshManipulator.h> 27 28 #include "Blade.h" 28 29 #include "MeshSceneNode.h" … … 85 86 motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100); 86 87 88 Tab *visual_tab = new Tab(GetTabWidget(), "visual"); 89 armColorR = new SpinBox(visual_tab->NewRow(), "arm color (R):", 0, 255, 1,255); 90 armColorG = new SpinBox(visual_tab->LastRowLastCol(), "arm color (G):", 0, 255, 1,0); 91 armColorB = new SpinBox(visual_tab->LastRowLastCol(), "arm color (B):", 0, 255, 1,0); 92 87 93 motors = new SimuBldc(this, name, 8, modelId,0); 88 94 … … 102 108 103 109 // cylinders are aligned with y axis 104 IMesh *red_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 255, 0, 0));110 colored_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, armColorR->Value(), armColorG->Value(), armColorB->Value())); 105 111 IMesh *black_arm = geo->createCylinderMesh(2.5, 100, 16, SColor(0, 128, 128, 128)); 106 112 IMesh *motor = geo->createCylinderMesh(7.5, 15, 16); //,SColor(0, 128, 128, 128)); … … 108 114 109 115 ITexture *texture = getGui()->getTexture("carbone.jpg"); 110 MeshSceneNode *fl_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),116 MeshSceneNode *fl_arm = new MeshSceneNode(this, colored_arm, vector3df(0, 0, 0), 111 117 vector3df(0, 0, -135)); 112 MeshSceneNode *fr_arm = new MeshSceneNode(this, red_arm, vector3df(0, 0, 0),118 MeshSceneNode *fr_arm = new MeshSceneNode(this, colored_arm, vector3df(0, 0, 0), 113 119 vector3df(0, 0, -45)); 114 120 MeshSceneNode *rl_arm = new MeshSceneNode(this, black_arm, vector3df(0, 0, 0), … … 171 177 brr_blade->SetRotationSpeed(-K_MOT * vector3df(0, 0,motor_speed[7])); 172 178 motor_speed_mutex->ReleaseMutex(); 179 180 if (armColorR->ValueChanged() == true || armColorG->ValueChanged() == true || armColorB->ValueChanged() == true) { 181 getGui()->getSceneManager()->getMeshManipulator()->setVertexColors(colored_arm, SColor(0,armColorR->Value(), armColorG->Value(), armColorB->Value())); 182 } 183 173 184 174 185 // adapt UAV size -
trunk/lib/FlairSimulator/src/X8.h
r286 r370 33 33 } 34 34 35 #ifdef GL 36 namespace irr { 37 namespace scene { 38 class IMesh; 39 } 40 } 41 #endif 42 35 43 namespace flair { 36 44 namespace simulator { … … 56 64 Blade *tfl_blade, *tfr_blade, *trl_blade, *trr_blade; 57 65 Blade *bfl_blade, *bfr_blade, *brl_blade, *brr_blade; 66 irr::scene::IMesh *colored_arm; 58 67 #endif 59 68 … … 66 75 gui::DoubleSpinBox *j_r, *sigma, *S; 67 76 gui::SpinBox *motorTimeout; 77 gui::SpinBox *armColorR,*armColorG,*armColorB; 68 78 }; 69 79 } // end namespace simulator
Note:
See TracChangeset
for help on using the changeset viewer.