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