Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions ARKitDemo/ARKitDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -31,6 +31,7 @@
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
6E0A53FE199DD3F400E2013C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6E0A53FD199DD3F400E2013C /* CoreMotion.framework */; };
CE169F581025704E00556F8F /* ARGeoCoordinate.m in Sources */ = {isa = PBXBuildFile; fileRef = CE169F571025704E00556F8F /* ARGeoCoordinate.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -58,6 +59,7 @@
28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
32CA4F630368D1EE00C91783 /* ARKitDemo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARKitDemo_Prefix.pch; sourceTree = "<group>"; };
6E0A53FD199DD3F400E2013C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
8D1107310486CEB800E47090 /* ARKitDemo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ARKitDemo-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
CE169F561025704E00556F8F /* ARGeoCoordinate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARGeoCoordinate.h; sourceTree = "<group>"; };
CE169F571025704E00556F8F /* ARGeoCoordinate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARGeoCoordinate.m; sourceTree = "<group>"; };
Expand All @@ -81,6 +83,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6E0A53FE199DD3F400E2013C /* CoreMotion.framework in Frameworks */,
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */,
Expand Down Expand Up @@ -172,6 +175,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
6E0A53FD199DD3F400E2013C /* CoreMotion.framework */,
1109BC301082F1B2006FFB4B /* QuartzCore.framework */,
116DC886102933A200EB5A0A /* MapKit.framework */,
111A141B1024C875002D39A1 /* CoreLocation.framework */,
Expand Down Expand Up @@ -226,11 +230,16 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = "Zac White";
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ARKitDemo" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -390,26 +399,29 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = iphoneos3.1;
SDKROOT = iphoneos;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
PREBINDING = NO;
SDKROOT = iphoneos3.1;
SDKROOT = iphoneos;
};
name = Release;
};
Expand Down
12 changes: 2 additions & 10 deletions ARKitDemo/Classes/ARCoordinate.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ + (ARCoordinate *)coordinateWithRadialDistance:(double)newRadialDistance inclina

newCoordinate.title = @"";

return [newCoordinate autorelease];
return newCoordinate;
}

- (NSUInteger)hash{
Expand All @@ -45,21 +45,13 @@ - (BOOL)isEqualToCoordinate:(ARCoordinate *)otherCoordinate {
equal = equal && self.inclination == otherCoordinate.inclination;
equal = equal && self.azimuth == otherCoordinate.azimuth;

if (self.title && otherCoordinate.title || self.title && !otherCoordinate.title || !self.title && otherCoordinate.title) {
if ((self.title && otherCoordinate.title) || (self.title && !otherCoordinate.title) || (!self.title && otherCoordinate.title)) {
equal = equal && [self.title isEqualToString:otherCoordinate.title];
}

return equal;
}

- (void)dealloc {

self.title = nil;
self.subtitle = nil;

[super dealloc];
}

- (NSString *)description {
return [NSString stringWithFormat:@"%@ r: %.3fm φ: %.3f° θ: %.3f°", self.title, self.radialDistance, radiansToDegrees(self.azimuth), radiansToDegrees(self.inclination)];
}
Expand Down
4 changes: 2 additions & 2 deletions ARKitDemo/Classes/ARGeoCoordinate.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (void)calibrateUsingOrigin:(CLLocation *)origin {

if (!self.geoLocation) return;

double baseDistance = [origin getDistanceFrom:self.geoLocation];
double baseDistance = [origin distanceFromLocation:self.geoLocation];

self.radialDistance = sqrt(pow(origin.altitude - self.geoLocation.altitude, 2) + pow(baseDistance, 2));

Expand All @@ -46,7 +46,7 @@ + (ARGeoCoordinate *)coordinateWithLocation:(CLLocation *)location {

newCoordinate.title = @"";

return [newCoordinate autorelease];
return newCoordinate;
}

+ (ARGeoCoordinate *)coordinateWithLocation:(CLLocation *)location fromOrigin:(CLLocation *)origin {
Expand Down
3 changes: 1 addition & 2 deletions ARKitDemo/Classes/ARGeoViewController.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ @implementation ARGeoViewController
@synthesize centerLocation;

- (void)setCenterLocation:(CLLocation *)newLocation {
[centerLocation release];
centerLocation = [newLocation retain];
centerLocation = newLocation;

for (ARGeoCoordinate *geoLocation in self.coordinates) {
if ([geoLocation isKindOfClass:[ARGeoCoordinate class]]) {
Expand Down
57 changes: 2 additions & 55 deletions ARKitDemo/Classes/ARKitDemoAppDelegate.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,27 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Denver";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:45.523875 longitude:-122.670399];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Portland";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:41.879535 longitude:-87.624333];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Chicago";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:30.268735 longitude:-97.745209];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Austin";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:51.500152 longitude:-0.126236];

Expand All @@ -79,8 +71,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"London";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:48.856667 longitude:2.350987];

Expand All @@ -89,17 +79,13 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Paris";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:47.620973 longitude:-122.347276];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Seattle";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:20.593684 longitude:78.96288];

Expand All @@ -108,8 +94,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"India";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:55.676294 longitude:12.568116];

Expand All @@ -118,8 +102,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Copenhagen";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:52.373801 longitude:4.890935];

Expand All @@ -128,8 +110,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Amsterdam";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:19.611544 longitude:-155.665283];

Expand All @@ -138,8 +118,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Hawaii";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:-40.900557 longitude:174.885971];

Expand All @@ -148,26 +126,20 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"New Zealand";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:40.756054 longitude:-73.986951];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"New York City";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:42.35892 longitude:-71.05781];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Boston";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:49.817492 longitude:15.472962];

Expand All @@ -176,8 +148,6 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Czech Republic";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:53.41291 longitude:-8.24389];

Expand All @@ -186,51 +156,40 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
tempCoordinate.title = @"Ireland";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:45.545447 longitude:-73.639076];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Montreal";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:38.892091 longitude:-77.024055];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Washington, DC";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


tempLocation = [[CLLocation alloc] initWithLatitude:-40.900557 longitude:174.885971];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Munich";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];

tempLocation = [[CLLocation alloc] initWithLatitude:32.781078 longitude:-96.797111];

tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = @"Dallas";

[tempLocationArray addObject:tempCoordinate];
[tempLocation release];


[viewController addCoordinates:tempLocationArray];
[tempLocationArray release];

CLLocation *newCenter = [[CLLocation alloc] initWithLatitude:37.41711 longitude:-122.02528];

viewController.centerLocation = newCenter;
[newCenter release];

[viewController startListening];

Expand All @@ -253,7 +212,7 @@ - (UIView *)viewForCoordinate:(ARCoordinate *)coordinate {
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, BOX_WIDTH, 20.0)];
titleLabel.backgroundColor = [UIColor colorWithWhite:.3 alpha:.8];
titleLabel.textColor = [UIColor whiteColor];
titleLabel.textAlignment = UITextAlignmentCenter;
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.text = coordinate.title;
[titleLabel sizeToFit];

Expand All @@ -266,19 +225,7 @@ - (UIView *)viewForCoordinate:(ARCoordinate *)coordinate {
[tempView addSubview:titleLabel];
[tempView addSubview:pointView];

[titleLabel release];
[pointView release];

return [tempView autorelease];
}


- (void)dealloc {

//NEW COMMENT!
[window release];
[super dealloc];
return tempView;
}


@end
Loading