Skip to content

Commit

Permalink
Bug Fixes from Git Issues
Browse files Browse the repository at this point in the history
Fixed issues zac#8, zac#11, zac#12.
Fixed an issue with the Debug Mode showing up if rotating the iOS
device.
The app now uses the proper orientation when the AG View is started.
Added code to only update the location of the Coordinate Views when
rotating the phone one (1) or more degrees.
  • Loading branch information
nielswh committed Nov 20, 2011
1 parent 503bfdb commit 9cd6518
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 148 deletions.
5 changes: 4 additions & 1 deletion ARKit/ARViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ - (void)loadView {

AugmentedRealityController* arc = [[AugmentedRealityController alloc] initWithViewController:self];

[arc setDebugMode:NO];
[arc setDebugMode:YES];
[arc setScaleViewsBasedOnDistance:YES];
[arc setMinimumScaleFactor:0.5];
[arc setRotateViewsBasedOnPerspective:YES];
[arc updateDebugMode:![arc debugMode]];

GEOLocations* locations = [[GEOLocations alloc] initWithDelegate:delegate];

Expand All @@ -50,6 +51,8 @@ - (void)loadView {
[self setAgController:arc];
[arc release];
[locations release];


}


Expand Down
92 changes: 50 additions & 42 deletions ARKit/AugmentedRealityController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,77 +18,84 @@

BOOL scaleViewsBasedOnDistance;
BOOL rotateViewsBasedOnPerspective;

double maximumScaleDistance;
double minimumScaleFactor;
double maximumRotationAngle;

CGPoint startPoint;
CGPoint endPoint;
float verticleDiff;
float prevHeading;
int totalDisplayed;
int prevTotalDisplayed;


ARCoordinate *centerCoordinate;
CLLocationManager *locationManager;
UIDeviceOrientation currentOrientation;

ARViewController *rootViewController;
UIAccelerometer *accelerometerManager;
CLLocation *centerLocation;
UIView *displayView;
UILabel *debugView;
UIButton *closeButton;
AVCaptureSession *captureSession;
AVCaptureVideoPreviewLayer *previewLayer;


@private
double latestHeading;
double degreeRange;
float viewAngle;
BOOL debugMode;
double latestHeading;
double degreeRange;

NSMutableArray *coordinates;
NSMutableArray *coordinateViews;
BOOL debugMode;

float viewAngle;
float verticleDiff;
float prevHeading;

int totalDisplayed;
int prevTotalDisplayed;
int cameraOrientation;

CGPoint startPoint;
CGPoint endPoint;

NSMutableArray *coordinates;
NSMutableArray *coordinateViews;

UILabel *debugView;
AVCaptureSession *captureSession;
AVCaptureVideoPreviewLayer *previewLayer;

UIAccelerometer *accelerometerManager;
CLLocation *centerLocation;
UIView *displayView;



}

@property BOOL scaleViewsBasedOnDistance;
@property BOOL rotateViewsBasedOnPerspective;
@property (nonatomic) BOOL debugMode;
@property BOOL debugMode;

@property double maximumScaleDistance;
@property double minimumScaleFactor;
@property double maximumRotationAngle;
@property double degreeRange;
@property double latestHeading;

@property float verticleDiff;
@property float prevHeading;
@property float viewAngle;

@property int totalDisplayed;
@property int prevTotalDisplayed;
@property double latestHeading;
@property float viewAngle;
@property int cameraOrientation;

@property CGPoint startPoint;
@property CGPoint endPoint;

@property (nonatomic, retain) UIAccelerometer *accelerometerManager;
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) ARCoordinate *centerCoordinate;
@property (nonatomic, retain) CLLocation *centerLocation;
@property (nonatomic, retain) UIView *displayView;
@property (nonatomic, retain) UIView *ARView;
@property (nonatomic, retain) ARViewController *rootViewController;
@property UIDeviceOrientation currentOrientation;
@property (nonatomic, retain) AVCaptureSession *captureSession;
@property (nonatomic, retain) UIAccelerometer *accelerometerManager;
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) ARCoordinate *centerCoordinate;
@property (nonatomic, retain) CLLocation *centerLocation;
@property (nonatomic, retain) UIView *displayView;
@property (nonatomic, retain) UIView *ARView;
@property (nonatomic, retain) ARViewController *rootViewController;
@property (nonatomic, retain) AVCaptureSession *captureSession;
@property (nonatomic, retain) AVCaptureVideoPreviewLayer *previewLayer;

@property (retain) UILabel *debugView;
@property (retain) UIButton *closeButton;

@property (retain) UILabel *debugView;

@property (nonatomic,retain) NSMutableArray *coordinates;
@property (nonatomic,retain) NSMutableArray *coordinateViews;

@property CGPoint startPoint;
@property CGPoint endPoint;

- (id)initWithViewController:(UIViewController *)theView;

- (void) setupDebugPostion;
Expand All @@ -102,6 +109,7 @@
- (void)removeCoordinate:(ARCoordinate *)coordinate;
- (void)removeCoordinate:(ARCoordinate *)coordinate animated:(BOOL)animated;
- (void)removeCoordinates:(NSArray *)coordinateArray;
- (void) updateDebugMode:(BOOL) flag;


@end
Loading

0 comments on commit 9cd6518

Please sign in to comment.