Oolite 1.91.0.7677-250528-09ed63a
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
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 96 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 87 of file OOJoystickProfile.m.

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

References deadzone, init, and STICK_DEADZONE.

Referenced by init.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rawValue:

- (double) rawValue: (double) x

Reimplemented in OOJoystickSplineAxisProfile, and OOJoystickStandardAxisProfile.

Definition at line 103 of file OOJoystickProfile.m.

103{
104 return x;
105}
106
float x

References x.

Referenced by value:.

Here is the caller graph for this function:

◆ setDeadzone:

- (void) setDeadzone: (double) newValue

Definition at line 122 of file OOJoystickProfile.m.

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

References deadzone, and STICK_MAX_DEADZONE.

Referenced by StickProfileScreen(StickProfileInternal)::decreaseDeadzone, StickProfileScreen(StickProfileInternal)::increaseDeadzone, and OOJoystickManager::loadProfileForAxis:.

Here is the caller graph for this function:

◆ value:

- (double) value: (double) x

Definition at line 108 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

References deadzone, rawValue:, and x.

Referenced by OOJoystickManager::getAxisState:.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ deadzone


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