Oolite 1.91.0.7646-241128-10e222e
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 55 of file OOJoystickProfile.h.

Method Documentation

◆ copyWithZone:

- (id) copyWithZone: (NSZone *) zone

Reimplemented from OOJoystickAxisProfile.

Definition at line 39 of file OOJoystickProfile.m.

141{
142 OOJoystickStandardAxisProfile *copy = [[[self class] alloc] init];
143 copy->power = power;
144 copy->parameter = parameter;
145 return copy;
146}
147

◆ init

- (id) init

Reimplemented from OOJoystickAxisProfile.

Definition at line 39 of file OOJoystickProfile.m.

131{
132 if ((self = [super init]))
133 {
134 power = 1.0;
135 parameter = 1.0;
136 }
137 return self;
138}
139

◆ parameter

- (double) parameter

Definition at line 39 of file OOJoystickProfile.m.

178{
179 return parameter;
180}
181

◆ power

- (double) power

Definition at line 39 of file OOJoystickProfile.m.

166{
167 return power;
168}
169

◆ rawValue:

- (double) rawValue: (double) x

Reimplemented from OOJoystickAxisProfile.

Definition at line 39 of file OOJoystickProfile.m.

184{
185 if (x < 0)
186 {
187 return -OOClamp_0_1_d(parameter * pow(-x,power)-(parameter - 1.0)*(-x));
188 }
189 return OOClamp_0_1_d(parameter * pow(x,power)-(parameter - 1.0)*(x));
190}
191
float x

◆ setParameter:

- (void) setParameter: (double) newValue

Definition at line 39 of file OOJoystickProfile.m.

172{
173 parameter = OOClamp_0_1_d(newValue);
174 return;
175}
176

◆ setPower:

- (void) setPower: (double) newValue

Definition at line 39 of file OOJoystickProfile.m.

149{
150 if (newValue < 1.0)
151 {
152 power = 1.0;
153 }
154 else if (newValue > STICKPROFILE_MAX_POWER)
155 {
157 }
158 else
159 {
160 power = newValue;
161 }
162 return;
163}
164
#define STICKPROFILE_MAX_POWER

Member Data Documentation

◆ parameter

- (double) parameter
private

Definition at line 59 of file OOJoystickProfile.h.

◆ power

- (double) power
private

Definition at line 58 of file OOJoystickProfile.h.


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