source: cpp/frams/neuro/impl/neuroimpl-body-sdk.h @ 1326

Last change on this file since 1326 was 952, checked in by Maciej Komosinski, 5 years ago

Added new receptors (Gp:"gyroscope" on a Part, Tp:Touch-proximity and Tc:Touch-contact) and improved existing ones (T, G)

  • Property svn:eol-style set to native
File size: 3.6 KB
Line 
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
10class NI_Gyro : public NeuroImpl
11{
12public:
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
18extern ParamEntry NI_GyroP_tab[];
19
20class NI_GyroP : public NeuroImpl
21{
22public:
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
30extern ParamEntry NI_Touch_tab[];
31class NI_Touch : public NeuroImpl
32{
33public:
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
42extern ParamEntry NI_TouchP_tab[];
43class NI_TouchP : public NI_Touch
44{
45public:
46        NeuroImpl* makeNew() { return new NI_TouchP(); } // for NeuroFactory
47        NI_TouchP() { paramentries = NI_TouchP_tab; }
48};
49
50extern ParamEntry NI_TouchC_tab[];
51class NI_TouchC : public NI_Touch
52{
53public:
54        NeuroImpl* makeNew() { return new NI_TouchC(); } // for NeuroFactory
55        NI_TouchC() { paramentries = NI_TouchC_tab; }
56};
57
58
59class NI_Smell : public NeuroImpl
60{
61public:
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
67extern ParamEntry NI_BendMuscle_tab[];
68class NI_BendMuscle : public NeuroImpl
69{
70public:
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
78extern ParamEntry NI_RotMuscle_tab[];
79class NI_RotMuscle : public NeuroImpl
80{
81public:
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
89extern ParamEntry NI_SolidMuscle_tab[];
90class NI_SolidMuscle : public NeuroImpl
91{
92public:
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
101extern ParamEntry NI_LinearMuscle_tab[];
102class NI_LinearMuscle : public NeuroImpl
103{
104public:
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
112class NI_Sticky : public NeuroImpl
113{
114public:
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
121class NI_WaterDetect : public NeuroImpl
122{
123public:
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
129class NI_Energy : public NeuroImpl
130{
131public:
132        NeuroImpl* makeNew() { return new NI_Energy(); } // for NeuroFactory
133        void go() { setState(0); }
134};
135
136#endif
Note: See TracBrowser for help on using the repository browser.