Index: cpp/frams/neuro/impl/neuroimpl-body-sdk.h
===================================================================
--- cpp/frams/neuro/impl/neuroimpl-body-sdk.h	(revision 946)
+++ cpp/frams/neuro/impl/neuroimpl-body-sdk.h	(revision 952)
@@ -16,4 +16,16 @@
 };
 
+extern ParamEntry NI_GyroP_tab[];
+
+class NI_GyroP : public NeuroImpl
+{
+public:
+	double ry,rz;
+	NeuroImpl* makeNew() { return new NI_GyroP(); } // for NeuroFactory
+	int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
+	void go() { setState(0); }
+	NI_GyroP(): ry(0),rz(0) { paramentries = NI_GyroP_tab; }
+};
+
 extern ParamEntry NI_Touch_tab[];
 class NI_Touch : public NeuroImpl
@@ -21,9 +33,27 @@
 public:
 	double range;
+	double ry,rz;
 	NeuroImpl* makeNew() { return new NI_Touch(); } // for NeuroFactory
 	int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
 	void go() { setState(0); }
-	NI_Touch() :range(1) { paramentries = NI_Touch_tab; }
+	NI_Touch() :range(1),ry(0),rz(0) { paramentries = NI_Touch_tab; }
 };
+
+extern ParamEntry NI_TouchP_tab[];
+class NI_TouchP : public NI_Touch
+{
+public:
+	NeuroImpl* makeNew() { return new NI_TouchP(); } // for NeuroFactory
+	NI_TouchP() { paramentries = NI_TouchP_tab; }
+};
+
+extern ParamEntry NI_TouchC_tab[];
+class NI_TouchC : public NI_Touch
+{
+public:
+	NeuroImpl* makeNew() { return new NI_TouchC(); } // for NeuroFactory
+	NI_TouchC() { paramentries = NI_TouchC_tab; }
+};
+
 
 class NI_Smell : public NeuroImpl
Index: cpp/frams/neuro/neurocls-f0-SDK-factory.h
===================================================================
--- cpp/frams/neuro/neurocls-f0-SDK-factory.h	(revision 946)
+++ cpp/frams/neuro/neurocls-f0-SDK-factory.h	(revision 952)
@@ -39,8 +39,33 @@
 #undef FIELDSTRUCT
 
+#define FIELDSTRUCT NI_GyroP 
+ParamEntry NI_GyroP_tab []={
+{"Part Gyroscope",1, 2 ,"Gp",},
+{"ry",1,0,"rotation.y","f -6.282 6.282 0",FIELD(ry),},
+{"rz",1,0,"rotation.z","f -6.282 6.282 0",FIELD(rz),},
+ {0,0,0,},};
+#undef FIELDSTRUCT
+
 #define FIELDSTRUCT NI_Touch 
 ParamEntry NI_Touch_tab []={
-{"Touch",1, 1 ,"T",},
+{"Touch",1, 3 ,"T",},
 {"r",1,0,"Range","f 0.0 1.0 1.0",FIELD(range),},
+{"ry",1,0,"rotation.y","f -6.282 6.282 0",FIELD(ry),},
+{"rz",1,0,"rotation.z","f -6.282 6.282 0",FIELD(rz),},
+ {0,0,0,},};
+#undef FIELDSTRUCT
+
+#define FIELDSTRUCT NI_TouchC 
+ParamEntry NI_TouchC_tab []={
+{"Touch contact",1, 0 ,"Tc",},
+ {0,0,0,},};
+#undef FIELDSTRUCT
+
+#define FIELDSTRUCT NI_TouchP 
+ParamEntry NI_TouchP_tab []={
+{"Touch proximity",1, 3 ,"Tp",},
+{"r",1,0,"Range","f 0.0 1.0 1.0",FIELD(range),},
+{"ry",1,0,"rotation.y","f -6.282 6.282 0",FIELD(ry),},
+{"rz",1,0,"rotation.z","f -6.282 6.282 0",FIELD(rz),},
  {0,0,0,},};
 #undef FIELDSTRUCT
@@ -159,5 +184,8 @@
 setImplementation("Nu",new NI_StdUNeuron); \
 setImplementation("G",new NI_Gyro); \
+setImplementation("Gp",new NI_GyroP); \
 setImplementation("T",new NI_Touch); \
+setImplementation("Tc",new NI_TouchC); \
+setImplementation("Tp",new NI_TouchP); \
 setImplementation("S",new NI_Smell); \
 setImplementation("*",new NI_Const); \
Index: cpp/frams/neuro/neurocls-f0-SDK-library.h
===================================================================
--- cpp/frams/neuro/neurocls-f0-SDK-library.h	(revision 946)
+++ cpp/frams/neuro/neurocls-f0-SDK-library.h	(revision 952)
@@ -41,17 +41,52 @@
 
 
- 
-{0,0,0,},};
-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));
+
+ 
+{0,0,0,},};
+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));
+
+      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};   
+static ParamEntry NI_GyroP_tab[]={
+{"Part Gyroscope",1, 2 ,"Gp",},
+
+
+{"ry",1,0,"rotation.y","f -6.282 6.282 0",},
+{"rz",1,0,"rotation.z","f -6.282 6.282 0",},
+ 
+{0,0,0,},};
+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));
 
       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};   
 static ParamEntry NI_Touch_tab[]={
-{"Touch",1, 1 ,"T",},
+{"Touch",1, 3 ,"T",},
 
 
 {"r",1,0,"Range","f 0.0 1.0 1.0",},
- 
-{0,0,0,},};
-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));
+{"ry",1,0,"rotation.y","f -6.282 6.282 0",},
+{"rz",1,0,"rotation.z","f -6.282 6.282 0",},
+ 
+{0,0,0,},};
+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));
+
+      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};   
+static ParamEntry NI_TouchC_tab[]={
+{"Touch contact",1, 0 ,"Tc",},
+
+
+ 
+{0,0,0,},};
+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));
+
+      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};   
+static ParamEntry NI_TouchP_tab[]={
+{"Touch proximity",1, 3 ,"Tp",},
+
+
+{"r",1,0,"Range","f 0.0 1.0 1.0",},
+{"ry",1,0,"rotation.y","f -6.282 6.282 0",},
+{"rz",1,0,"rotation.z","f -6.282 6.282 0",},
+ 
+{0,0,0,},};
+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));
 
       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};   
Index: cpp/frams/neuro/neuroimpl.cpp
===================================================================
--- cpp/frams/neuro/neuroimpl.cpp	(revision 946)
+++ cpp/frams/neuro/neuroimpl.cpp	(revision 952)
@@ -13,4 +13,5 @@
 #include <frams/simul/simul.h>
 #endif
+#include <frams/vm/classes/3dobject.h>
 
 const int NeuroImpl::ENDDRAWING = -9999;
@@ -153,4 +154,13 @@
 }
 
+void NeuroNetImpl::getLiveNeuroObject(Neuro *n, ExtValue *ret)
+{
+	NeuroImpl *ni = getImpl(n);
+	if (ni)
+		ret->setObject(ExtObject(&NeuroImpl::getStaticParam(), ni));
+	else
+		ret->setEmpty();
+}
+
 ///////////////////////////////////////////////
 
@@ -301,5 +311,5 @@
 ParamEntry neuroimpl_tab[] =
 {
-	{ "Neuro", 1, 27 + NEUROIMPL_SIGNAL_PROPS, "Neuro", "Live Neuron object." },
+	{ "Neuro", 1, 29 + NEUROIMPL_SIGNAL_PROPS, "Neuro", "Live Neuron object." },
 
 	{ "getInputState", 0, 0, "Get input signal", "p f(d input)", PROCEDURE(p_get), },
@@ -324,7 +334,9 @@
 	{ "position_y", 0, PARAM_READONLY, "Position y", "f", GETONLY(position_y), },
 	{ "position_z", 0, PARAM_READONLY, "Position z", "f", GETONLY(position_z), },
+	{ "relative_pos", 0, PARAM_READONLY, "Relative position", "oXYZ", GETONLY(relative_pos), },
+	{ "relative_orient", 0, PARAM_READONLY, "Relative orientation", "oOrient", GETONLY(relative_orient), },
 	{ "creature", 0, PARAM_READONLY, "Gets owner creature", "oCreature", GETONLY(creature), },
-	{ "part", 0, PARAM_READONLY, "The Part object where this neuron is located", "oMechPart", GETONLY(part), },
-	{ "joint", 0, PARAM_READONLY, "The Joint object where this neuron is located", "oMechJoint", GETONLY(joint), },
+	{ "mechpart", 0, PARAM_READONLY, "MechPart object", "oMechPart", GETONLY(part), "The MechPart object where this neuron is located" },
+	{ "mechjoint", 0, PARAM_READONLY, "MechJoint object" , "oMechJoint", GETONLY(joint), "The MechJoint object where this neuron is located" },
 	{ "neuroproperties", 0, PARAM_READONLY, "Custom neuron fields", "oNeuroProperties", GETONLY(fields),
 	"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,4 +561,13 @@
 }
 
+void NeuroImpl::get_relative_pos(ExtValue *ret)
+{
+	ret->setObject(Pt3D_Ext::makeDynamicObject(getRelativePosition()));
+}
+
+void NeuroImpl::get_relative_orient(ExtValue *ret)
+{
+	ret->setObject(Orient_Ext::makeDynamicObject(new Orient_Ext(getRelativeOrientation())));
+}
 
 void NeuroImpl::createFieldsObject()
Index: cpp/frams/neuro/neuroimpl.h
===================================================================
--- cpp/frams/neuro/neuroimpl.h	(revision 946)
+++ cpp/frams/neuro/neuroimpl.h	(revision 952)
@@ -88,4 +88,5 @@
 
 	static NeuroImpl *getImpl(Neuro* n) { return (NeuroImpl*)n->userdata[mytags_id]; }
+	static void getLiveNeuroObject(Neuro *n, ExtValue *ret);
 };
 
@@ -271,4 +272,7 @@
 	Creature* getCreature();
 
+	virtual Pt3D getRelativePosition() { return Pt3D_0; }
+	virtual Orient getRelativeOrientation() { return Orient_1; }
+	
 #define STATRICKCLASS NeuroImpl
 	PARAMGETDEF(count) { arg1->setInt(getInputCount()); }
@@ -300,4 +304,6 @@
 	PARAMGETDEF(position_y);
 	PARAMGETDEF(position_z);
+	PARAMGETDEF(relative_pos);
+	PARAMGETDEF(relative_orient);
 	PARAMGETDEF(fields);
 	PARAMGETDEF(neurodef);
