Oolite
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 43 of file OOJoystickProfile.h.

Method Documentation

◆ copyWithZone:

- (id) copyWithZone: (NSZone*) zone

Reimplemented in OOJoystickSplineAxisProfile, and OOJoystickStandardAxisProfile.

Definition at line 92 of file OOJoystickProfile.m.

92 :(NSZone*)zone
93{
94 OOJoystickAxisProfile* copy = [[[self class] alloc] init];
95 return copy;
96}

◆ deadzone

- (double) deadzone

References deadzone.

◆ init

- (id) init

Reimplemented in OOJoystickSplineAxisProfile, and OOJoystickStandardAxisProfile.

Definition at line 84 of file OOJoystickProfile.m.

85{
86 if ((self = [super init])) {
88 }
89 return self;
90}
#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 98 of file OOJoystickProfile.m.

98 :(double)x
99{
100 return x;
101}
float x

References x.

Referenced by value:.

Here is the caller graph for this function:

◆ setDeadzone:

- (void) setDeadzone: (double) newValue

Definition at line 116 of file OOJoystickProfile.m.

116 :(double)newValue
117{
119}
OOINLINE double OOClamp_0_max_d(double value, double max) INLINE_CONST_FUNC
#define STICK_MAX_DEADZONE

References deadzone, OOClamp_0_max_d(), and STICK_MAX_DEADZONE.

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

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

◆ value:

- (double) value: (double) x

Definition at line 103 of file OOJoystickProfile.m.

103 :(double)x
104{
105 if (fabs(x) < deadzone) {
106 return 0.0;
107 }
108 return x < 0 ? -[self rawValue:(-x - deadzone) / (1.0 - deadzone)] : [self rawValue:(x - deadzone) / (1.0 - deadzone)];
109}
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: