Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
OOJoystickProfile.h
Go to the documentation of this file.
1/*
2
3OOJoystickProfile.h
4
5JoystickProfile maintains settings such as deadzone and the mapping
6from joystick movement to response.
7
8JoystickSpline manages the mapping of the physical joystick movements
9to the joystick response. It holds a series of control points, with
10the points (0,0) and (1,1) being assumed. It then interpolates
11splines between the set of control points - the segment between (0,0)
12and the first control point is linear, the remaining segments
13quadratic with the gradients matching at the control point.
14
15Oolite
16Copyright (C) 2004-2013 Giles C Williams and contributors
17
18This program is free software; you can redistribute it and/or
19modify it under the terms of the GNU General Public License
20as published by the Free Software Foundation; either version 2
21of the License, or (at your option) any later version.
22
23This program is distributed in the hope that it will be useful,
24but WITHOUT ANY WARRANTY; without even the implied warranty of
25MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26GNU General Public License for more details.
27
28You should have received a copy of the GNU General Public License
29along with this program; if not, write to the Free Software
30Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
31MA 02110-1301, USA.
32
33*/
34
35#define STICKPROFILE_TYPE_STANDARD 1
36#define STICKPROFILE_TYPE_SPLINE 2
37#define STICKPROFILE_MAX_POWER 10.0
38
39@interface OOJoystickAxisProfile : NSObject <NSCopying>
40{
41@private
42 double deadzone;
44
45- (id) init;
46- (id) copyWithZone: (NSZone *) zone;
47- (double) rawValue: (double) x;
48- (double) value: (double) x;
49- (double) deadzone;
50- (void) setDeadzone: (double) newValue;
51
52@end
53
56@private
57 double power;
58 double parameter;
60
61- (id) init;
62- (id) copyWithZone: (NSZone *) zone;
63- (void) setPower: (double) newValue;
64- (double) power;
65- (void) setParameter: (double) newValue;
66- (double) parameter;
67- (double) rawValue: (double) x;
68
69@end
70
73@private
74 NSMutableArray *controlPoints;
75 NSArray *segments;
77
78- (id) init;
79- (void) dealloc;
80- (id) copyWithZone: (NSZone *) zone;
81- (int) addControl: (NSPoint) point;
82- (NSPoint) pointAtIndex: (NSInteger) index;
83- (int) countPoints;
84- (void) removeControl: (NSInteger) index;
85- (void) clearControlPoints;
86- (void) moveControl: (NSInteger) index point: (NSPoint) point;
87- (double) rawValue: (double) x;
88- (double) gradient: (double) x;
89- (NSArray *) controlPoints;
90
91@end
92
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque