Oolite
Loading...
Searching...
No Matches
OOJoystickSplineSegment Class Reference
Inheritance diagram for OOJoystickSplineSegment:
Collaboration diagram for OOJoystickSplineSegment:

Instance Methods

(id) - init
(id) - initWithData:right:
(id) - initWithData:right:gradientleft:
(id) - initWithData:right:gradientright:
(id) - initWithData:right:gradientleft:gradientright:
(id) - copyWithZone:
(double) - start
(double) - end
(double) - value:
(double) - gradient:

Class Methods

(id) + segmentWithData:right:
(id) + segmentWithData:right:gradientleft:
(id) + segmentWithData:right:gradientright:
(id) + segmentWithData:right:gradientleft:gradientright:

Private Attributes

double start
double end
double a [4]

Detailed Description

Definition at line 33 of file OOJoystickProfile.m.

Method Documentation

◆ copyWithZone:

- (id) copyWithZone: (NSZone*) zone

Definition at line 195 of file OOJoystickProfile.m.

195 :(NSZone*)zone
196{
197 OOJoystickSplineSegment* copy = [[OOJoystickSplineSegment allocWithZone:zone] init];
198 copy->start = start;
199 copy->end = end;
200 copy->a[0] = a[0];
201 copy->a[1] = a[1];
202 copy->a[2] = a[2];
203 copy->a[3] = a[3];
204 return copy;
205}

References a, end, and start.

◆ end

- (double) end

References end.

◆ gradient:

- (double) gradient: (double) t

Definition at line 312 of file OOJoystickProfile.m.

312 :(double)x
313{
314 return a[1] + (2 * a[2] + 3 * a[3] * x) * x;
315}
float x

References a, and x.

Referenced by OOJoystickSplineAxisProfile::gradient:.

Here is the caller graph for this function:

◆ init

- (id) init

Definition at line 182 of file OOJoystickProfile.m.

183{
184 if ((self = [super init])) {
185 start = 0.0;
186 end = 1.0;
187 a[0] = 0.0;
188 a[1] = 1.0;
189 a[2] = 0.0;
190 a[3] = 0.0;
191 }
192 return self;
193}

References a, end, init, and start.

Referenced by init, initWithData:right:, initWithData:right:gradientleft:, initWithData:right:gradientleft:gradientright:, and initWithData:right:gradientright:.

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

◆ initWithData:right:

- (id) initWithData: (NSPoint) left
right: (NSPoint) right 

Definition at line 207 of file OOJoystickProfile.m.

207 :(NSPoint)left right:(NSPoint)right
208{
209 double dx = right.x - left.x;
210 if (dx <= 0.0) {
211 return nil;
212 }
213 if ((self = [super init])) {
214 start = left.x;
215 end = right.x;
216 a[1] = (right.y - left.y) / dx;
217 a[0] = left.y - a[1] * left.x;
218 a[2] = 0.0;
219 a[3] = 0.0;
220 }
221 return self;
222}
return nil
float y

References a, end, init, nil, and start.

Here is the call graph for this function:

◆ initWithData:right:gradientleft:

- (id) initWithData: (NSPoint) left
right: (NSPoint) right
gradientleft: (double) gradientleft 

Definition at line 224 of file OOJoystickProfile.m.

224 :(NSPoint)left right:(NSPoint)right gradientleft:(double)gradientleft
225{
226 double dx = right.x - left.x;
227 if (dx <= 0.0) {
228 return nil;
229 }
230 if ((self = [super init])) {
231 start = left.x;
232 end = right.x;
233 a[0] = left.y * right.x * (right.x - 2 * left.x) / (dx * dx) + right.y * left.x * left.x / (dx * dx) - gradientleft * left.x * right.x / dx;
234 a[1] = 2 * left.x * (left.y - right.y) / (dx * dx) + gradientleft * (left.x + right.x) / dx;
235 a[2] = (right.y - left.y) / (dx * dx) - gradientleft / dx;
236 }
237 return self;
238}

References a, end, init, nil, and start.

Here is the call graph for this function:

◆ initWithData:right:gradientleft:gradientright:

- (id) initWithData: (NSPoint) left
right: (NSPoint) right
gradientleft: (double) gradientleft
gradientright: (double) gradientright 

Definition at line 256 of file OOJoystickProfile.m.

256 :(NSPoint)left right:(NSPoint)right gradientleft:(double)gradientleft gradientright:(double)gradientright
257{
258 double dx = right.x - left.x;
259 if (dx <= 0.0) {
260 return nil;
261 }
262 if ((self = [super init])) {
263 start = left.x;
264 end = right.x;
265 a[0] = (left.y * right.x * right.x * (right.x - 3 * left.x) - right.y * left.x * left.x * (left.x - 3 * right.x)) / (dx * dx * dx) - (gradientleft * right.x + gradientright * left.x) * left.x * right.x / (dx * dx);
266 a[1] = 6 * left.x * right.x * (left.y - right.y) / (dx * dx * dx) + (gradientleft * right.x * (right.x + 2 * left.x) + gradientright * left.x * (left.x + 2 * right.x)) / (dx * dx);
267 a[2] = 3 * (left.x + right.x) * (right.y - left.y) / (dx * dx * dx) - (gradientleft * (2 * right.x + left.x) + gradientright * (2 * left.x + right.x)) / (dx * dx);
268 a[3] = 2 * (left.y - right.y) / (dx * dx * dx) + (gradientleft + gradientright) / (dx * dx);
269 }
270 return self;
271}

References a, end, init, nil, and start.

Here is the call graph for this function:

◆ initWithData:right:gradientright:

- (id) initWithData: (NSPoint) left
right: (NSPoint) right
gradientright: (double) gradientright 

Definition at line 240 of file OOJoystickProfile.m.

240 :(NSPoint)left right:(NSPoint)right gradientright:(double)gradientright
241{
242 double dx = right.x - left.x;
243 if (dx <= 0.0) {
244 return nil;
245 }
246 if ((self = [super init])) {
247 start = left.x;
248 end = right.x;
249 a[0] = (left.y * right.x * right.x + right.y * left.x * (left.x - 2 * right.x)) / (dx * dx) + gradientright * left.x * right.x / dx;
250 a[1] = 2 * right.x * (right.y - left.y) / (dx * dx) - gradientright * (left.x + right.x) / dx;
251 a[2] = (left.y - right.y) / (dx * dx) + gradientright / dx;
252 }
253 return self;
254}

References a, end, init, nil, and start.

Here is the call graph for this function:

◆ segmentWithData:right:

+ (id) segmentWithData: (NSPoint) left
right: (NSPoint) right 

Definition at line 273 of file OOJoystickProfile.m.

273 :(NSPoint)left right:(NSPoint)right
274{
275 OOJoystickSplineSegment* segment = [[OOJoystickSplineSegment alloc] initWithData:left right:right];
276 return [segment autorelease];
277}

Referenced by OOJoystickSplineAxisProfile(Private)::makeSegments.

Here is the caller graph for this function:

◆ segmentWithData:right:gradientleft:

+ (id) segmentWithData: (NSPoint) left
right: (NSPoint) right
gradientleft: (double) gradientleft 

Definition at line 279 of file OOJoystickProfile.m.

279 :(NSPoint)left right:(NSPoint)right gradientleft:(double)gradientleft
280{
281 OOJoystickSplineSegment* segment = [[OOJoystickSplineSegment alloc] initWithData:left right:right gradientleft:gradientleft];
282 return [segment autorelease];
283}

Referenced by OOJoystickSplineAxisProfile(Private)::makeSegments.

Here is the caller graph for this function:

◆ segmentWithData:right:gradientleft:gradientright:

+ (id) segmentWithData: (NSPoint) left
right: (NSPoint) right
gradientleft: (double) gradientleft
gradientright: (double) gradientright 

Definition at line 291 of file OOJoystickProfile.m.

291 :(NSPoint)left right:(NSPoint)right gradientleft:(double)gradientleft gradientright:(double)gradientright
292{
293 OOJoystickSplineSegment* segment = [[OOJoystickSplineSegment alloc] initWithData:left right:right gradientleft:gradientleft gradientright:gradientright];
294 return [segment autorelease];
295}

Referenced by OOJoystickSplineAxisProfile(Private)::makeSegments.

Here is the caller graph for this function:

◆ segmentWithData:right:gradientright:

+ (id) segmentWithData: (NSPoint) left
right: (NSPoint) right
gradientright: (double) gradientright 

Definition at line 285 of file OOJoystickProfile.m.

285 :(NSPoint)left right:(NSPoint)right gradientright:(double)gradientright
286{
287 OOJoystickSplineSegment* segment = [[OOJoystickSplineSegment alloc] initWithData:left right:right gradientright:gradientright];
288 return [segment autorelease];
289}

Referenced by OOJoystickSplineAxisProfile(Private)::makeSegments.

Here is the caller graph for this function:

◆ start

- (double) start

References start.

◆ value:

- (double) value: (double) t

Definition at line 307 of file OOJoystickProfile.m.

307 :(double)x
308{
309 return a[0] + (a[1] + (a[2] + a[3] * x) * x) * x;
310}

References a, and x.

Member Data Documentation

◆ a

◆ end

◆ start


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