Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOJoystickAxisProfile Class Reference

#include <OOJoystickProfile.h>

+ Inheritance diagram for OOJoystickAxisProfile:
+ Collaboration diagram for OOJoystickAxisProfile:

Instance Methods

(id) - init
 
(id) - copyWithZone:
 
(double) - rawValue:
 
(double) - value:
 
(double) - deadzone
 
(void) - setDeadzone:
 

Private Attributes

double deadzone
 

Detailed Description

Definition at line 39 of file OOJoystickProfile.h.

Method Documentation

◆ copyWithZone:

- (id) copyWithZone: (NSZone *) zone

Reimplemented in OOJoystickSplineAxisProfile, and OOJoystickStandardAxisProfile.

Definition at line 39 of file OOJoystickProfile.m.

96{
97 OOJoystickAxisProfile *copy = [[[self class] alloc] init];
98 return copy;
99}
100

◆ deadzone

- (double) deadzone

◆ init

- (id) init

Reimplemented in OOJoystickSplineAxisProfile, and OOJoystickStandardAxisProfile.

Definition at line 39 of file OOJoystickProfile.m.

87{
88 if ((self = [super init]))
89 {
91 }
92 return self;
93}
94
#define STICK_DEADZONE

◆ rawValue:

- (double) rawValue: (double) x

Reimplemented in OOJoystickSplineAxisProfile, and OOJoystickStandardAxisProfile.

Definition at line 39 of file OOJoystickProfile.m.

103{
104 return x;
105}
106
float x

◆ setDeadzone:

- (void) setDeadzone: (double) newValue

Definition at line 39 of file OOJoystickProfile.m.

122{
123 deadzone = OOClamp_0_max_d(newValue, STICK_MAX_DEADZONE);
124}
125
#define STICK_MAX_DEADZONE

◆ value:

- (double) value: (double) x

Definition at line 39 of file OOJoystickProfile.m.

108{
109 if (fabs(x) < deadzone)
110 {
111 return 0.0;
112 }
113 return x < 0 ? -[self rawValue: (-x-deadzone)/(1.0-deadzone)] : [self rawValue: (x-deadzone)/(1.0-deadzone)];
114}
115
return self

Member Data Documentation

◆ deadzone

- (double) deadzone
private

Definition at line 43 of file OOJoystickProfile.h.


The documentation for this class was generated from the following files: