@synthesize offset, scale;
- (id)initWithIndex:(int)newIndex offset:(float)offset_ scale:(float)scale_ {
if ((self = [super init])) {
@synthesize offset, scale;
- (id)initWithIndex:(int)newIndex offset:(float)offset_ scale:(float)scale_ {
if ((self = [super init])) {
- self.children = @[[[SubAction alloc] initWithIndex:0 name:@"Low" base:self],
- [[SubAction alloc] initWithIndex:1 name:@"High" base:self]];
+ self.children = @[[[JSAction alloc] initWithName:@"Low" base:self],
+ [[JSAction alloc] initWithName:@"High" base:self]];
- float parsed = [self getRealValue:raw];
- [self.children[0] setActive:parsed < -DEAD_ZONE];
- [self.children[1] setActive:parsed > DEAD_ZONE];
+ magnitude = offset + scale * raw;
+ [self.children[0] setActive:magnitude < -DEAD_ZONE];
+ [self.children[1] setActive:magnitude > DEAD_ZONE];