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

Last change on this file since 1229 was 952, checked in by Maciej Komosinski, 4 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
RevLine 
[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]10class NI_Gyro : public NeuroImpl
[109]11{
12public:
[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]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
[109]30extern ParamEntry NI_Touch_tab[];
[791]31class NI_Touch : public NeuroImpl
[109]32{
33public:
[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]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
[791]59class NI_Smell : public NeuroImpl
[109]60{
61public:
[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
67extern ParamEntry NI_BendMuscle_tab[];
[791]68class NI_BendMuscle : public NeuroImpl
[109]69{
70public:
[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
78extern ParamEntry NI_RotMuscle_tab[];
[791]79class NI_RotMuscle : public NeuroImpl
[109]80{
81public:
[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]89extern ParamEntry NI_SolidMuscle_tab[];
90class NI_SolidMuscle : public NeuroImpl
91{
92public:
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]101extern ParamEntry NI_LinearMuscle_tab[];
[791]102class NI_LinearMuscle : public NeuroImpl
[109]103{
104public:
[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]112class NI_Sticky : public NeuroImpl
[109]113{
114public:
[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]121class NI_WaterDetect : public NeuroImpl
[109]122{
123public:
[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]129class NI_Energy : public NeuroImpl
[109]130{
131public:
[907]132        NeuroImpl* makeNew() { return new NI_Energy(); } // for NeuroFactory
[791]133        void go() { setState(0); }
[109]134};
135
136#endif
Note: See TracBrowser for help on using the repository browser.