[286] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
[920] | 2 | // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. |
---|
[286] | 3 | // See LICENSE.txt for details. |
---|
[109] | 4 | |
---|
| 5 | #ifndef _NEUROIMPLBODY_H_ |
---|
| 6 | #define _NEUROIMPLBODY_H_ |
---|
| 7 | |
---|
| 8 | #include <frams/neuro/neuroimpl.h> |
---|
| 9 | |
---|
[791] | 10 | class NI_Gyro : public NeuroImpl |
---|
[109] | 11 | { |
---|
| 12 | public: |
---|
[907] | 13 | NeuroImpl* makeNew() { return new NI_Gyro(); } // for NeuroFactory |
---|
[791] | 14 | int lateinit() { if (!neuro->joint) return 0; simorder = 0; return 1; } |
---|
| 15 | void go() { setState(0); } |
---|
[109] | 16 | }; |
---|
| 17 | |
---|
[952] | 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 | |
---|
[109] | 30 | extern ParamEntry NI_Touch_tab[]; |
---|
[791] | 31 | class NI_Touch : public NeuroImpl |
---|
[109] | 32 | { |
---|
| 33 | public: |
---|
[791] | 34 | double range; |
---|
[952] | 35 | double ry,rz; |
---|
[907] | 36 | NeuroImpl* makeNew() { return new NI_Touch(); } // for NeuroFactory |
---|
[791] | 37 | int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; } |
---|
| 38 | void go() { setState(0); } |
---|
[952] | 39 | NI_Touch() :range(1),ry(0),rz(0) { paramentries = NI_Touch_tab; } |
---|
[109] | 40 | }; |
---|
| 41 | |
---|
[952] | 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 | |
---|
| 58 | |
---|
[791] | 59 | class NI_Smell : public NeuroImpl |
---|
[109] | 60 | { |
---|
| 61 | public: |
---|
[907] | 62 | NeuroImpl* makeNew() { return new NI_Smell(); } // for NeuroFactory |
---|
[791] | 63 | void go() { setState(0); } |
---|
| 64 | int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; } |
---|
[109] | 65 | }; |
---|
| 66 | |
---|
| 67 | extern ParamEntry NI_BendMuscle_tab[]; |
---|
[791] | 68 | class NI_BendMuscle : public NeuroImpl |
---|
[109] | 69 | { |
---|
| 70 | public: |
---|
[791] | 71 | double power, bendrange; |
---|
[907] | 72 | NeuroImpl* makeNew() { return new NI_BendMuscle(); } // for NeuroFactory |
---|
[791] | 73 | NI_BendMuscle() { paramentries = NI_BendMuscle_tab; } |
---|
| 74 | int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; } |
---|
| 75 | void go() {} |
---|
[109] | 76 | }; |
---|
| 77 | |
---|
| 78 | extern ParamEntry NI_RotMuscle_tab[]; |
---|
[791] | 79 | class NI_RotMuscle : public NeuroImpl |
---|
[109] | 80 | { |
---|
| 81 | public: |
---|
[791] | 82 | double power; |
---|
[907] | 83 | NeuroImpl* makeNew() { return new NI_RotMuscle(); } // for NeuroFactory |
---|
[791] | 84 | NI_RotMuscle() { paramentries = NI_RotMuscle_tab; } |
---|
| 85 | int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; } |
---|
| 86 | void go() {} |
---|
[109] | 87 | }; |
---|
| 88 | |
---|
[920] | 89 | extern ParamEntry NI_SolidMuscle_tab[]; |
---|
| 90 | class NI_SolidMuscle : public NeuroImpl |
---|
| 91 | { |
---|
| 92 | public: |
---|
| 93 | paInt axis; |
---|
[922] | 94 | double power; |
---|
[920] | 95 | NeuroImpl* makeNew() { return new NI_SolidMuscle(); } // for NeuroFactory |
---|
| 96 | NI_SolidMuscle() { paramentries = NI_SolidMuscle_tab; } |
---|
| 97 | int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; } |
---|
| 98 | void go() {} |
---|
| 99 | }; |
---|
| 100 | |
---|
[109] | 101 | extern ParamEntry NI_LinearMuscle_tab[]; |
---|
[791] | 102 | class NI_LinearMuscle : public NeuroImpl |
---|
[109] | 103 | { |
---|
| 104 | public: |
---|
[791] | 105 | double power; |
---|
[907] | 106 | NeuroImpl* makeNew() { return new NI_RotMuscle(); } // for NeuroFactory |
---|
[791] | 107 | NI_LinearMuscle() { paramentries = NI_RotMuscle_tab; } |
---|
| 108 | int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; } |
---|
| 109 | void go() {} |
---|
[109] | 110 | }; |
---|
| 111 | |
---|
[791] | 112 | class NI_Sticky : public NeuroImpl |
---|
[109] | 113 | { |
---|
| 114 | public: |
---|
[791] | 115 | double power; |
---|
[907] | 116 | NeuroImpl* makeNew() { return new NI_Sticky(); } // for NeuroFactory |
---|
[791] | 117 | int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; } |
---|
| 118 | void go() {} |
---|
[109] | 119 | }; |
---|
| 120 | |
---|
[791] | 121 | class NI_WaterDetect : public NeuroImpl |
---|
[109] | 122 | { |
---|
| 123 | public: |
---|
[907] | 124 | NeuroImpl* makeNew() { return new NI_WaterDetect(); } // for NeuroFactory |
---|
[791] | 125 | int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; } |
---|
| 126 | void go() { setState(0); } |
---|
[109] | 127 | }; |
---|
| 128 | |
---|
[791] | 129 | class NI_Energy : public NeuroImpl |
---|
[109] | 130 | { |
---|
| 131 | public: |
---|
[907] | 132 | NeuroImpl* makeNew() { return new NI_Energy(); } // for NeuroFactory |
---|
[791] | 133 | void go() { setState(0); } |
---|
[109] | 134 | }; |
---|
| 135 | |
---|
| 136 | #endif |
---|