Oolite
Loading...
Searching...
No Matches
OOJoystickStandardAxisProfile Class Reference

#include <OOJoystickProfile.h>

Inheritance diagram for OOJoystickStandardAxisProfile:
Collaboration diagram for OOJoystickStandardAxisProfile:

Instance Methods

(id) - init
(id) - copyWithZone:
(void) - setPower:
(double) - power
(void) - setParameter:
(double) - parameter
(double) - rawValue:
Instance Methods inherited from OOJoystickAxisProfile
(double) - value:
(double) - deadzone
(void) - setDeadzone:

Private Attributes

double power
double parameter

Detailed Description

Definition at line 57 of file OOJoystickProfile.h.

Method Documentation

◆ copyWithZone:

- (id) copyWithZone: (NSZone*) zone

Reimplemented from OOJoystickAxisProfile.

Definition at line 134 of file OOJoystickProfile.m.

134 :(NSZone*)zone
135{
136 OOJoystickStandardAxisProfile* copy = [[[self class] alloc] init];
137 copy->power = power;
138 copy->parameter = parameter;
139 return copy;
140}

References parameter, and power.

◆ init

- (id) init

Reimplemented from OOJoystickAxisProfile.

Definition at line 125 of file OOJoystickProfile.m.

126{
127 if ((self = [super init])) {
128 power = 1.0;
129 parameter = 1.0;
130 }
131 return self;
132}

References init, parameter, and power.

Referenced by init.

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

◆ parameter

- (double) parameter

Definition at line 165 of file OOJoystickProfile.m.

166{
167 return parameter;
168}

◆ power

- (double) power

Definition at line 154 of file OOJoystickProfile.m.

155{
156 return power;
157}

◆ rawValue:

- (double) rawValue: (double) x

Reimplemented from OOJoystickAxisProfile.

Definition at line 170 of file OOJoystickProfile.m.

170 :(double)x
171{
172 if (x < 0) {
173 return -OOClamp_0_1_d(parameter * pow(-x, power) - (parameter - 1.0) * (-x));
174 }
175 return OOClamp_0_1_d(parameter * pow(x, power) - (parameter - 1.0) * (x));
176}
OOINLINE double OOClamp_0_1_d(double value) INLINE_CONST_FUNC
float x

References OOClamp_0_1_d(), parameter, power, and x.

Here is the call graph for this function:

◆ setParameter:

- (void) setParameter: (double) newValue

Definition at line 159 of file OOJoystickProfile.m.

159 :(double)newValue
160{
161 parameter = OOClamp_0_1_d(newValue);
162 return;
163}

References OOClamp_0_1_d(), and parameter.

Referenced by StickProfileScreen(StickProfileInternal)::DecreaseParam, StickProfileScreen(StickProfileInternal)::IncreaseParam, and OOJoystickManager::loadProfileForAxis:.

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

◆ setPower:

- (void) setPower: (double) newValue

Definition at line 142 of file OOJoystickProfile.m.

142 :(double)newValue
143{
144 if (newValue < 1.0) {
145 power = 1.0;
146 } else if (newValue > STICKPROFILE_MAX_POWER) {
148 } else {
149 power = newValue;
150 }
151 return;
152}
#define STICKPROFILE_MAX_POWER

References power, and STICKPROFILE_MAX_POWER.

Referenced by StickProfileScreen(StickProfileInternal)::DecreasePower, StickProfileScreen(StickProfileInternal)::IncreasePower, and OOJoystickManager::loadProfileForAxis:.

Here is the caller graph for this function:

Member Data Documentation

◆ parameter

◆ power


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