2 * blenlib/DNA_sensor_types.h (mar-2001 nzc)
6 * ***** BEGIN GPL LICENSE BLOCK *****
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 * All rights reserved.
25 * The Original Code is: all of this file.
27 * Contributor(s): none yet.
29 * ***** END GPL LICENSE BLOCK *****
31 #ifndef DNA_SENSOR_TYPES_H
32 #define DNA_SENSOR_TYPES_H
37 /* ****************** SENSORS ********************* */
39 typedef struct bNearSensor {
41 float dist, resetdist;
46 * Defines the settings of a mouse sensor.
48 typedef struct bMouseSensor {
50 * The type of key this sensor listens to.
58 typedef struct bTouchSensor {
64 typedef struct bKeyboardSensor {
68 * Name of the target property
72 * Name of the toggle property
77 typedef struct bPropertySensor {
85 typedef struct bActuatorSensor {
91 typedef struct bCollisionSensor {
92 char name[32]; /* property name */
93 char materialName[32]; /* material */
94 short damptimer, damp;
95 short mode; /* flag to choose material or property */
99 typedef struct bRadarSensor {
106 typedef struct bRandomSensor {
112 typedef struct bRaySensor {
122 typedef struct bMessageSensor {
124 * (Possible future use) pointer to a single sender object
126 struct Object *fromObject;
129 * Can be used to filter on subjects like this
134 * (Possible future use) body to filter on
139 typedef struct bSensor {
140 struct bSensor *next, *prev;
141 /* pulse and freq are the bool toggle and frame count for pulse mode */
142 short type, otype, flag, pulse;
143 short freq, totlinks, pad1, pad2;
147 struct bController **links;
151 /* just add here, to avoid align errors... */
152 short invert; /* Whether or not to invert the output. */
153 short level; /* Whether the sensor is level base (edge by default) */
157 typedef struct bJoystickSensor {
170 /* bMouseSensor->type: uses blender event defines */
172 /* propertysensor->type */
173 #define SENS_PROP_EQUAL 0
174 #define SENS_PROP_NEQUAL 1
175 #define SENS_PROP_INTERVAL 2
176 #define SENS_PROP_CHANGED 3
177 #define SENS_PROP_EXPRESSION 4
179 /* raysensor->axisflag */
180 /* flip x and y to make y default!!! */
181 #define SENS_RAY_X_AXIS 1
182 #define SENS_RAY_Y_AXIS 0
183 #define SENS_RAY_Z_AXIS 2
184 #define SENS_RAY_NEG_X_AXIS 3
185 #define SENS_RAY_NEG_Y_AXIS 4
186 #define SENS_RAY_NEG_Z_AXIS 5
187 //#define SENS_RAY_NEGATIVE_AXIS 1
189 /* bMessageSensor->type */
190 #define SENS_MESG_MESG 0
191 #define SENS_MESG_PROP 1
194 #define SENS_ALWAYS 0
197 #define SENS_KEYBOARD 3
198 #define SENS_PROPERTY 4
200 #define SENS_COLLISION 6
202 #define SENS_RANDOM 8
204 #define SENS_MESSAGE 10
205 #define SENS_JOYSTICK 11
206 #define SENS_ACTUATOR 12
212 #define SENS_VISIBLE 16
215 #define SENS_PULSE_CONT 0
216 #define SENS_PULSE_REPEAT 1
217 //#define SENS_PULSE_ONCE 2
218 #define SENS_NEG_PULSE_MODE 4
220 /* sensor->suppress */
221 #define SENS_SUPPRESS_POSITIVE (1 << 0)
222 #define SENS_SUPPRESS_NEGATIVE (1 << 1)
224 /* collision, ray sensor modes: */
225 /* A little bit fake: when property is active, the first bit is
226 * reset. Bite me :) So we don't actually use it, so we comment it out
227 * ... The reason for this is that we need to be backward compatible,
228 * and have a proper default value for this thing.
230 /* #define SENS_COLLISION_PROPERTY 0 */
231 #define SENS_COLLISION_MATERIAL 1
233 /* Some stuff for the mouse sensor Type: */
234 #define BL_SENS_MOUSE_LEFT_BUTTON 1
235 #define BL_SENS_MOUSE_MIDDLE_BUTTON 2
236 #define BL_SENS_MOUSE_RIGHT_BUTTON 4
237 #define BL_SENS_MOUSE_WHEEL_UP 5
238 #define BL_SENS_MOUSE_WHEEL_DOWN 6
239 #define BL_SENS_MOUSE_MOVEMENT 8
240 #define BL_SENS_MOUSE_MOUSEOVER 16
241 #define BL_SENS_MOUSE_MOUSEOVER_ANY 32
243 #define SENS_JOY_BUTTON 0
244 #define SENS_JOY_BUTTON_PRESSED 0
245 #define SENS_JOY_BUTTON_RELEASED 1
247 #define SENS_JOY_AXIS 1
248 #define SENS_JOY_X_AXIS 0
249 #define SENS_JOY_Y_AXIS 1
250 #define SENS_JOY_NEG_X_AXIS 2
251 #define SENS_JOY_NEG_Y_AXIS 3
252 #define SENS_JOY_PRECISION 4
254 #define SENS_JOY_HAT 2
255 #define SENS_JOY_HAT_DIR 0