Changeset 952
- Timestamp:
- 06/20/20 01:09:57 (5 years ago)
- Location:
- cpp/frams
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/config/f0-SDK.def
r945 r952 1 CLASS(Model,f0_model,m )1 CLASS(Model,f0_model,m,Model) 2 2 GROUP(Properties) 3 3 GROUP(Visual) … … 6 6 ENDCLASS 7 7 8 CLASS(Part,f0_part,p )8 CLASS(Part,f0_part,p,Part) 9 9 GROUP(Geometry) 10 10 GROUP(Other properties) … … 39 39 ENDCLASS 40 40 41 CLASS(Joint,f0_joint,j )41 CLASS(Joint,f0_joint,j,Joint) 42 42 GROUP(Connections) 43 43 GROUP(Geometry) … … 73 73 ENDCLASS 74 74 75 CLASS(Joint,f0_nodeltajoint,j, NOXML)75 CLASS(Joint,f0_nodeltajoint,j,Joint,NOXML) 76 76 GROUP(Connections) 77 77 GROUP(Geometry) … … 101 101 ENDCLASS 102 102 103 CLASS(Neuro,f0_neuro,n )103 CLASS(Neuro,f0_neuro,n,Neuro) 104 104 GROUP(Connections) 105 105 GROUP(Other) … … 117 117 ENDCLASS 118 118 119 CLASS(NeuroConn,f0_neuroconn,c )119 CLASS(NeuroConn,f0_neuroconn,c,Neuron connection) 120 120 GROUP(Connection) 121 121 GROUP(Other) … … 141 141 ENDNEUROCLASS 142 142 143 NEUROCLASS(Gyro,G,Gyroscope,`Equilibrium sensor.\n0=the stick is horizontal\n+1/-1=the stick is vertical',0,1,2) 143 NEUROCLASS(Gyro,G,Gyroscope,`Tilt sensor.\nSignal is proportional to sin(angle) = most sensitive in horizontal orientation.\n0=the stick is horizontal\n+1/-1=the stick is vertical',0,1,2) 144 SHAPETYPE(BallAndStickShapeType) 144 145 VISUALHINTS(ReceptorClass) 145 146 SYMBOL(`8,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,12,43,24,48,24,48,19,38,19,38,24,43,24,43,54,48,54,48,64,43,69,38,64,38,54,43,54,5,63,69,58,74,48,79,38,79,28,74,23,69,1,43,79,43,74,1,23,69,26,66,1,63,69,60,66,1,55,76,53,73,1,31,75,33,72') 146 147 ENDNEUROCLASS 147 148 148 NEUROCLASS(Touch,T,Touch,`Touch sensor.\n-1=no contact\n0=just touching\n>0=pressing, value depends on the force applied',0,1,1) 149 NEUROCLASS(GyroP,Gp,Part Gyroscope,`Tilt sensor. Signal is directly proportional to the tilt angle.\n0=the part X axis is horizontal\n+1/-1=the axis is vertical',0,1,1) 150 VISUALHINTS(ReceptorClass) 151 SYMBOL(`8,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,12,43,24,48,24,48,19,38,19,38,24,43,24,43,54,48,54,48,64,43,69,38,64,38,54,43,54,5,63,69,58,74,48,79,38,79,28,74,23,69,1,43,79,43,74,1,23,69,26,66,1,63,69,60,66,1,55,76,53,73,1,31,75,33,72') 152 NEUROPROP(ry,1,0,rotation.y,f,-6.282,6.282,0,ry) 153 NEUROPROP(rz,1,0,rotation.z,f,-6.282,6.282,0,rz) 154 ENDNEUROCLASS 155 156 NEUROCLASS(Touch,T,Touch,`Touch and proximity sensor (Tc+Tp combined)\n-1=no contact\n0=just touching\n>0=pressing, value depends on the force applied (not implemented in ODE mode)',0,1,1) 149 157 VISUALHINTS(ReceptorClass) 150 158 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 151 159 NEUROPROP(r,1,0,Range,f,0.0,1.0,1.0,range) 160 NEUROPROP(ry,1,0,rotation.y,f,-6.282,6.282,0,ry) 161 NEUROPROP(rz,1,0,rotation.z,f,-6.282,6.282,0,rz) 162 ENDNEUROCLASS 163 164 NEUROCLASS(TouchC,Tc,Touch contact,`Touch sensor.\n-1=no contact\n0=the Part is touching the obstacle\n>0=pressing, value depends on the force applied (not implemented in ODE mode)',0,1,1) 165 VISUALHINTS(ReceptorClass) 166 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 167 ENDNEUROCLASS 168 169 NEUROCLASS(TouchP,Tp,Touch proximity,`Proximity sensor detecting obstacles along the X axis.\n-1=distance is \'r\' or more\n0=zero distance',0,1,1) 170 VISUALHINTS(ReceptorClass) 171 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 172 NEUROPROP(r,1,0,Range,f,0.0,1.0,1.0,range) 173 NEUROPROP(ry,1,0,rotation.y,f,-6.282,6.282,0,ry) 174 NEUROPROP(rz,1,0,rotation.z,f,-6.282,6.282,0,rz) 152 175 ENDNEUROCLASS 153 176 -
cpp/frams/config/f0.def
r945 r952 1 CLASS(Model,f0_model,m )1 CLASS(Model,f0_model,m,Model) 2 2 GROUP(Properties) 3 3 GROUP(Visual) … … 6 6 ENDCLASS 7 7 8 CLASS(Part,f0_part,p )8 CLASS(Part,f0_part,p,Part) 9 9 GROUP(Geometry) 10 10 GROUP(Other properties) … … 39 39 ENDCLASS 40 40 41 CLASS(Joint,f0_joint,j )41 CLASS(Joint,f0_joint,j,Joint) 42 42 GROUP(Connections) 43 43 GROUP(Geometry) … … 73 73 ENDCLASS 74 74 75 CLASS(Joint,f0_nodeltajoint,j, NOXML)75 CLASS(Joint,f0_nodeltajoint,j,Joint,NOXML) 76 76 GROUP(Connections) 77 77 GROUP(Geometry) … … 101 101 ENDCLASS 102 102 103 CLASS(Neuro,f0_neuro,n )103 CLASS(Neuro,f0_neuro,n,Neuro) 104 104 GROUP(Connections) 105 105 GROUP(Other) … … 117 117 ENDCLASS 118 118 119 CLASS(NeuroConn,f0_neuroconn,c )119 CLASS(NeuroConn,f0_neuroconn,c,Neuron connection) 120 120 GROUP(Connection) 121 121 GROUP(Other) … … 141 141 ENDNEUROCLASS 142 142 143 NEUROCLASS(Gyro,G,Gyroscope,`Equilibrium sensor.\n0=the stick is horizontal\n+1/-1=the stick is vertical',0,1,2) 143 NEUROCLASS(Gyro,G,Gyroscope,`Tilt sensor.\nSignal is proportional to sin(angle) = most sensitive in horizontal orientation.\n0=the stick is horizontal\n+1/-1=the stick is vertical',0,1,2) 144 SHAPETYPE(BallAndStickShapeType) 144 145 VISUALHINTS(ReceptorClass) 145 146 SYMBOL(`8,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,12,43,24,48,24,48,19,38,19,38,24,43,24,43,54,48,54,48,64,43,69,38,64,38,54,43,54,5,63,69,58,74,48,79,38,79,28,74,23,69,1,43,79,43,74,1,23,69,26,66,1,63,69,60,66,1,55,76,53,73,1,31,75,33,72') 146 147 ENDNEUROCLASS 147 148 148 NEUROCLASS(Touch,T,Touch,`Touch sensor.\n-1=no contact\n0=just touching\n>0=pressing, value depends on the force applied',0,1,1) 149 NEUROCLASS(GyroP,Gp,Part Gyroscope,`Tilt sensor. Signal is directly proportional to the tilt angle.\n0=the part X axis is horizontal\n+1/-1=the axis is vertical',0,1,1) 150 VISUALHINTS(ReceptorClass) 151 SYMBOL(`8,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,12,43,24,48,24,48,19,38,19,38,24,43,24,43,54,48,54,48,64,43,69,38,64,38,54,43,54,5,63,69,58,74,48,79,38,79,28,74,23,69,1,43,79,43,74,1,23,69,26,66,1,63,69,60,66,1,55,76,53,73,1,31,75,33,72') 152 NEUROPROP(ry,1,0,rotation.y,f,-6.282,6.282,0,ry) 153 NEUROPROP(rz,1,0,rotation.z,f,-6.282,6.282,0,rz) 154 ENDNEUROCLASS 155 156 NEUROCLASS(Touch,T,Touch,`Touch and proximity sensor (Tc+Tp combined)\n-1=no contact\n0=just touching\n>0=pressing, value depends on the force applied (not implemented in ODE mode)',0,1,1) 149 157 VISUALHINTS(ReceptorClass) 150 158 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 151 159 NEUROPROP(r,1,0,Range,f,0.0,1.0,1.0,range) 160 NEUROPROP(ry,1,0,rotation.y,f,-6.282,6.282,0,ry) 161 NEUROPROP(rz,1,0,rotation.z,f,-6.282,6.282,0,rz) 162 ENDNEUROCLASS 163 164 NEUROCLASS(TouchC,Tc,Touch contact,`Touch sensor.\n-1=no contact\n0=the Part is touching the obstacle\n>0=pressing, value depends on the force applied (not implemented in ODE mode)',0,1,1) 165 VISUALHINTS(ReceptorClass) 166 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 167 ENDNEUROCLASS 168 169 NEUROCLASS(TouchP,Tp,Touch proximity,`Proximity sensor detecting obstacles along the X axis.\n-1=distance is \'r\' or more\n0=zero distance',0,1,1) 170 VISUALHINTS(ReceptorClass) 171 SYMBOL(`2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50') 172 NEUROPROP(r,1,0,Range,f,0.0,1.0,1.0,range) 173 NEUROPROP(ry,1,0,rotation.y,f,-6.282,6.282,0,ry) 174 NEUROPROP(rz,1,0,rotation.z,f,-6.282,6.282,0,rz) 152 175 ENDNEUROCLASS 153 176 -
cpp/frams/genetics/preconfigured.h
r938 r952 28 28 if (Geno::useValidators(&validators) != NULL) 29 29 logPrintf("PreconfiguredGenetics", "init", LOG_WARN, "Geno validators already configured"); 30 static const char* genactive_classes[] = { "N", "G", " T", "S", "*", "|", "@", "M", NULL };30 static const char* genactive_classes[] = { "N", "G", "Gp", "T", "S", "*", "|", "@", "M", NULL }; 31 31 NeuroClass::resetActive(); 32 32 NeuroClass::setGenActive(genactive_classes); -
cpp/frams/model/defassign-f0-SDK.h
r945 r952 61 61 62 62 63 64 65 63 66 void Part_MinMaxDef::defassign() 64 67 { 65 68 volume=4.18879; 66 69 } 70 71 72 67 73 68 74 … … 165 171 166 172 173 174 175 167 176 void Neuro::defassign() 168 177 { … … 172 181 vis_style="neuro"; 173 182 } 183 184 185 174 186 175 187 … … 234 246 235 247 248 249 250 -
cpp/frams/model/f0-SDK-classes.h
r945 r952 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 7 7 ParamEntry f0_model_paramtab[]= 8 8 { 9 {"Properties",2,2,"m" 9 {"Properties",2,2,"m",NULL,0,NULL,NULL,"Model"}, 10 10 {"Visual",}, 11 11 {"se",0,1024,"startenergy","f",FIELD(startenergy),}, … … 24 24 ParamEntry f0_part_paramtab[]= 25 25 { 26 {"Geometry",3,22,"p" 26 {"Geometry",3,22,"p",NULL,0,NULL,NULL,"Part"}, 27 27 {"Other properties",}, 28 28 {"Visual",}, … … 71 71 ParamEntry f0_part_minmaxdef_paramtab[]= 72 72 { 73 {"Geometry",1,1,"p" 73 {"Geometry",1,1,"p"}, 74 74 {"f",0,0,"volume","f 0.83776 20.94395 4.18879",FIELD(volume),"Recommended default and min,max range for solid-shape Parts created and modified by genetic operators which are responsible for setting sizex,y,z. Default is the volume of the solid sphere (ball) with default radius=1 (radius is the same as sizex,y,z). Minimum is 5x less, maximum is 5x more.",}, 75 75 {0,0,0,} … … 86 86 ParamEntry f0_joint_paramtab[]= 87 87 { 88 {"Connections",4,27,"j" 88 {"Connections",4,27,"j",NULL,0,NULL,NULL,"Joint"}, 89 89 {"Geometry",}, 90 90 {"Other properties",}, … … 135 135 ParamEntry f0_nodeltajoint_paramtab[]= 136 136 { 137 {"Connections",4,21,"j" 137 {"Connections",4,21,"j",NULL,0,NULL,NULL,"Joint"}, 138 138 {"Geometry",}, 139 139 {"Other properties",}, … … 178 178 ParamEntry f0_neuro_paramtab[]= 179 179 { 180 {"Connections",3,10,"n" 180 {"Connections",3,10,"n",NULL,0,NULL,NULL,"Neuro"}, 181 181 {"Other",}, 182 182 {"Visual",}, … … 204 204 ParamEntry f0_neuroconn_paramtab[]= 205 205 { 206 {"Connection",2,4,"c" 206 {"Connection",2,4,"c",NULL,0,NULL,NULL,"Neuron connection"}, 207 207 {"Other",}, 208 208 {"n1",0,1024,"this neuro ref#","d -1 999999 -1",FIELD(n1_refno),}, … … 239 239 240 240 241 242 243 -
cpp/frams/model/model.cpp
r934 r952 952 952 if ((check != LIVE_CHECK) && (check != CHECKPOINT_CHECK)) 953 953 { 954 if (j->shape != Joint::SHAPE_FIXED)954 if (j->shape == Joint::SHAPE_BALL_AND_STICK) 955 955 { 956 956 if (j->d() > getMaxJoint().d.x) -
cpp/frams/model/modelparts.cpp
r932 r952 22 22 #include <frams/util/extvalue.h> 23 23 #include <frams/param/paramobj.h> 24 #include <frams/neuro/neuroimpl.h> 24 25 25 26 #include F0_DEFASSIGN_FILE … … 756 757 { 757 758 #define FIELDSTRUCT NeuroExt 758 ParamEntry entry = { "class", 2, 0, "neuro class", "s", GETSET(neuroclass) }; 759 ParamEntry entries[] = { 760 { "class", 2, 0, "neuro class", "s", GETSET(neuroclass) }, 761 { "liveNeuro", 2, 1, "live Neuro object", "oNeuro", GETONLY(liveNeuro) }}; 759 762 #undef FIELDSTRUCT 760 add(&entry);763 for(auto& e : entries) add(&e); 761 764 762 765 #define FIELDSTRUCT Neuro … … 797 800 setClassName(arg->getString()); return PSET_CHANGED; 798 801 } 802 803 void NeuroExt::get_liveNeuro(PARAMGETARGS) 804 { 805 #ifndef SDK_WITHOUT_FRAMS 806 NeuroNetImpl::getLiveNeuroObject(this,ret); 807 #endif 808 } -
cpp/frams/model/modelparts.h
r937 r952 519 519 PARAMGETDEF(neuroclass); 520 520 PARAMSETDEF(neuroclass); 521 PARAMGETDEF(liveNeuro); 521 522 #undef STATRICKCLASS 522 523 static ParamEntry *getParamTab(); -
cpp/frams/neuro/impl/neuroimpl-body-sdk.h
r922 r952 16 16 }; 17 17 18 extern ParamEntry NI_GyroP_tab[]; 19 20 class NI_GyroP : public NeuroImpl 21 { 22 public: 23 double ry,rz; 24 NeuroImpl* makeNew() { return new NI_GyroP(); } // for NeuroFactory 25 int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; } 26 void go() { setState(0); } 27 NI_GyroP(): ry(0),rz(0) { paramentries = NI_GyroP_tab; } 28 }; 29 18 30 extern ParamEntry NI_Touch_tab[]; 19 31 class NI_Touch : public NeuroImpl … … 21 33 public: 22 34 double range; 35 double ry,rz; 23 36 NeuroImpl* makeNew() { return new NI_Touch(); } // for NeuroFactory 24 37 int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; } 25 38 void go() { setState(0); } 26 NI_Touch() :range(1) { paramentries = NI_Touch_tab; }39 NI_Touch() :range(1),ry(0),rz(0) { paramentries = NI_Touch_tab; } 27 40 }; 41 42 extern ParamEntry NI_TouchP_tab[]; 43 class NI_TouchP : public NI_Touch 44 { 45 public: 46 NeuroImpl* makeNew() { return new NI_TouchP(); } // for NeuroFactory 47 NI_TouchP() { paramentries = NI_TouchP_tab; } 48 }; 49 50 extern ParamEntry NI_TouchC_tab[]; 51 class NI_TouchC : public NI_Touch 52 { 53 public: 54 NeuroImpl* makeNew() { return new NI_TouchC(); } // for NeuroFactory 55 NI_TouchC() { paramentries = NI_TouchC_tab; } 56 }; 57 28 58 29 59 class NI_Smell : public NeuroImpl -
cpp/frams/neuro/neurocls-f0-SDK-factory.h
r946 r952 39 39 #undef FIELDSTRUCT 40 40 41 #define FIELDSTRUCT NI_GyroP 42 ParamEntry NI_GyroP_tab []={ 43 {"Part Gyroscope",1, 2 ,"Gp",}, 44 {"ry",1,0,"rotation.y","f -6.282 6.282 0",FIELD(ry),}, 45 {"rz",1,0,"rotation.z","f -6.282 6.282 0",FIELD(rz),}, 46 {0,0,0,},}; 47 #undef FIELDSTRUCT 48 41 49 #define FIELDSTRUCT NI_Touch 42 50 ParamEntry NI_Touch_tab []={ 43 {"Touch",1, 1,"T",},51 {"Touch",1, 3 ,"T",}, 44 52 {"r",1,0,"Range","f 0.0 1.0 1.0",FIELD(range),}, 53 {"ry",1,0,"rotation.y","f -6.282 6.282 0",FIELD(ry),}, 54 {"rz",1,0,"rotation.z","f -6.282 6.282 0",FIELD(rz),}, 55 {0,0,0,},}; 56 #undef FIELDSTRUCT 57 58 #define FIELDSTRUCT NI_TouchC 59 ParamEntry NI_TouchC_tab []={ 60 {"Touch contact",1, 0 ,"Tc",}, 61 {0,0,0,},}; 62 #undef FIELDSTRUCT 63 64 #define FIELDSTRUCT NI_TouchP 65 ParamEntry NI_TouchP_tab []={ 66 {"Touch proximity",1, 3 ,"Tp",}, 67 {"r",1,0,"Range","f 0.0 1.0 1.0",FIELD(range),}, 68 {"ry",1,0,"rotation.y","f -6.282 6.282 0",FIELD(ry),}, 69 {"rz",1,0,"rotation.z","f -6.282 6.282 0",FIELD(rz),}, 45 70 {0,0,0,},}; 46 71 #undef FIELDSTRUCT … … 159 184 setImplementation("Nu",new NI_StdUNeuron); \ 160 185 setImplementation("G",new NI_Gyro); \ 186 setImplementation("Gp",new NI_GyroP); \ 161 187 setImplementation("T",new NI_Touch); \ 188 setImplementation("Tc",new NI_TouchC); \ 189 setImplementation("Tp",new NI_TouchP); \ 162 190 setImplementation("S",new NI_Smell); \ 163 191 setImplementation("*",new NI_Const); \ -
cpp/frams/neuro/neurocls-f0-SDK-library.h
r946 r952 41 41 42 42 43 44 {0,0,0,},}; 45 addClass(new NeuroClass(NI_Gyro_tab,"Equilibrium sensor.\n0=the stick is horizontal\n+1/-1=the stick is vertical",0,1,2, Gyro_xy,false, 32, 3)); 43 44 45 {0,0,0,},}; 46 addClass(new NeuroClass(NI_Gyro_tab,"Tilt sensor.\nSignal is proportional to sin(angle) = most sensitive in horizontal orientation.\n0=the stick is horizontal\n+1/-1=the stick is vertical",0,1,2, Gyro_xy,false, 32, 1)); 47 48 static int GyroP_xy[]={83,8,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,12,43,24,48,24,48,19,38,19,38,24,43,24,43,54,48,54,48,64,43,69,38,64,38,54,43,54,5,63,69,58,74,48,79,38,79,28,74,23,69,1,43,79,43,74,1,23,69,26,66,1,63,69,60,66,1,55,76,53,73,1,31,75,33,72}; 49 static ParamEntry NI_GyroP_tab[]={ 50 {"Part Gyroscope",1, 2 ,"Gp",}, 51 52 53 {"ry",1,0,"rotation.y","f -6.282 6.282 0",}, 54 {"rz",1,0,"rotation.z","f -6.282 6.282 0",}, 55 56 {0,0,0,},}; 57 addClass(new NeuroClass(NI_GyroP_tab,"Tilt sensor. Signal is directly proportional to the tilt angle.\n0=the part X axis is horizontal\n+1/-1=the axis is vertical",0,1,1, GyroP_xy,false, 32, 3)); 46 58 47 59 static int Touch_xy[]={43,2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50}; 48 60 static ParamEntry NI_Touch_tab[]={ 49 {"Touch",1, 1,"T",},61 {"Touch",1, 3 ,"T",}, 50 62 51 63 52 64 {"r",1,0,"Range","f 0.0 1.0 1.0",}, 53 54 {0,0,0,},}; 55 addClass(new NeuroClass(NI_Touch_tab,"Touch sensor.\n-1=no contact\n0=just touching\n>0=pressing, value depends on the force applied",0,1,1, Touch_xy,false, 32, 3)); 65 {"ry",1,0,"rotation.y","f -6.282 6.282 0",}, 66 {"rz",1,0,"rotation.z","f -6.282 6.282 0",}, 67 68 {0,0,0,},}; 69 addClass(new NeuroClass(NI_Touch_tab,"Touch and proximity sensor (Tc+Tp combined)\n-1=no contact\n0=just touching\n>0=pressing, value depends on the force applied (not implemented in ODE mode)",0,1,1, Touch_xy,false, 32, 3)); 70 71 static int TouchC_xy[]={43,2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50}; 72 static ParamEntry NI_TouchC_tab[]={ 73 {"Touch contact",1, 0 ,"Tc",}, 74 75 76 77 {0,0,0,},}; 78 addClass(new NeuroClass(NI_TouchC_tab,"Touch sensor.\n-1=no contact\n0=the Part is touching the obstacle\n>0=pressing, value depends on the force applied (not implemented in ODE mode)",0,1,1, TouchC_xy,false, 32, 3)); 79 80 static int TouchP_xy[]={43,2,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,11,75,50,65,50,60,55,55,45,50,55,45,45,40,50,35,50,30,45,25,50,30,55,35,50}; 81 static ParamEntry NI_TouchP_tab[]={ 82 {"Touch proximity",1, 3 ,"Tp",}, 83 84 85 {"r",1,0,"Range","f 0.0 1.0 1.0",}, 86 {"ry",1,0,"rotation.y","f -6.282 6.282 0",}, 87 {"rz",1,0,"rotation.z","f -6.282 6.282 0",}, 88 89 {0,0,0,},}; 90 addClass(new NeuroClass(NI_TouchP_tab,"Proximity sensor detecting obstacles along the X axis.\n-1=distance is \r\' or more\n0=zero distance'",0,1,1, TouchP_xy,false, 32, 3)); 56 91 57 92 static int Smell_xy[]={64,5,7,100,50,90,50,90,40,70,40,80,50,70,60,90,60,90,50,3,10,40,15,45,15,55,10,60,5,20,30,25,35,30,45,30,55,25,65,20,70,4,15,35,20,40,22,50,20,60,15,65,5,75,50,50,50,45,45,40,50,45,55,50,50}; -
cpp/frams/neuro/neuroimpl.cpp
r932 r952 13 13 #include <frams/simul/simul.h> 14 14 #endif 15 #include <frams/vm/classes/3dobject.h> 15 16 16 17 const int NeuroImpl::ENDDRAWING = -9999; … … 153 154 } 154 155 156 void NeuroNetImpl::getLiveNeuroObject(Neuro *n, ExtValue *ret) 157 { 158 NeuroImpl *ni = getImpl(n); 159 if (ni) 160 ret->setObject(ExtObject(&NeuroImpl::getStaticParam(), ni)); 161 else 162 ret->setEmpty(); 163 } 164 155 165 /////////////////////////////////////////////// 156 166 … … 301 311 ParamEntry neuroimpl_tab[] = 302 312 { 303 { "Neuro", 1, 2 7+ NEUROIMPL_SIGNAL_PROPS, "Neuro", "Live Neuron object." },313 { "Neuro", 1, 29 + NEUROIMPL_SIGNAL_PROPS, "Neuro", "Live Neuron object." }, 304 314 305 315 { "getInputState", 0, 0, "Get input signal", "p f(d input)", PROCEDURE(p_get), }, … … 324 334 { "position_y", 0, PARAM_READONLY, "Position y", "f", GETONLY(position_y), }, 325 335 { "position_z", 0, PARAM_READONLY, "Position z", "f", GETONLY(position_z), }, 336 { "relative_pos", 0, PARAM_READONLY, "Relative position", "oXYZ", GETONLY(relative_pos), }, 337 { "relative_orient", 0, PARAM_READONLY, "Relative orientation", "oOrient", GETONLY(relative_orient), }, 326 338 { "creature", 0, PARAM_READONLY, "Gets owner creature", "oCreature", GETONLY(creature), }, 327 { " part", 0, PARAM_READONLY, "The Part object where this neuron is located", "oMechPart", GETONLY(part),},328 { " joint", 0, PARAM_READONLY, "The Joint object where this neuron is located", "oMechJoint", GETONLY(joint),},339 { "mechpart", 0, PARAM_READONLY, "MechPart object", "oMechPart", GETONLY(part), "The MechPart object where this neuron is located" }, 340 { "mechjoint", 0, PARAM_READONLY, "MechJoint object" , "oMechJoint", GETONLY(joint), "The MechJoint object where this neuron is located" }, 329 341 { "neuroproperties", 0, PARAM_READONLY, "Custom neuron fields", "oNeuroProperties", GETONLY(fields), 330 342 "Neurons can have different fields depending on their class. Script neurons have their fields defined using the \"property:\" syntax. If you develop a custom neuron script you should use the NeuroProperties object for accessing your own neuron fields. The Neuro.neuroproperties property is meant for accessing the neuron fields from the outside script.\n" … … 549 561 } 550 562 563 void NeuroImpl::get_relative_pos(ExtValue *ret) 564 { 565 ret->setObject(Pt3D_Ext::makeDynamicObject(getRelativePosition())); 566 } 567 568 void NeuroImpl::get_relative_orient(ExtValue *ret) 569 { 570 ret->setObject(Orient_Ext::makeDynamicObject(new Orient_Ext(getRelativeOrientation()))); 571 } 551 572 552 573 void NeuroImpl::createFieldsObject() -
cpp/frams/neuro/neuroimpl.h
r932 r952 88 88 89 89 static NeuroImpl *getImpl(Neuro* n) { return (NeuroImpl*)n->userdata[mytags_id]; } 90 static void getLiveNeuroObject(Neuro *n, ExtValue *ret); 90 91 }; 91 92 … … 271 272 Creature* getCreature(); 272 273 274 virtual Pt3D getRelativePosition() { return Pt3D_0; } 275 virtual Orient getRelativeOrientation() { return Orient_1; } 276 273 277 #define STATRICKCLASS NeuroImpl 274 278 PARAMGETDEF(count) { arg1->setInt(getInputCount()); } … … 300 304 PARAMGETDEF(position_y); 301 305 PARAMGETDEF(position_z); 306 PARAMGETDEF(relative_pos); 307 PARAMGETDEF(relative_orient); 302 308 PARAMGETDEF(fields); 303 309 PARAMGETDEF(neurodef);
Note: See TracChangeset
for help on using the changeset viewer.