Skip to content

Commit

Permalink
Updated Code base for iOS 4.3 and added updates based on other forks.
Browse files Browse the repository at this point in the history
Added Icons Fixed Debug Warnings Fixed issue Exception issue with
SIGABRT Fixed found Memory leaks  I'd like to Thank kypselia, mtigas,
agami, JaredCrawford,Jaydeo,petersantino,rmd6502 and intonarumori for
keeping the project alive.    I kept the code base using the traditional
Objective C style and I don't plan on migration it to the "other" way
since I find this to be easier to read :)  Please let me know if you
have any more issues with building it in xCode 4.x.    I plan on making
changes again to the Kit now that my life is back to semi normal again!
  • Loading branch information
Niels Hansen committed Sep 10, 2011
1 parent a4443a5 commit 27e7143
Show file tree
Hide file tree
Showing 12 changed files with 50,953 additions and 27 deletions.
4 changes: 2 additions & 2 deletions ARKit/ARGeoCoordinate.m
Expand Up @@ -33,7 +33,7 @@ - (void)calibrateUsingOrigin:(CLLocation *)origin {
if (![self geoLocation])
return;

double baseDistance = [origin distanceFromLocation:[self geoLocation]];
double baseDistance = [origin distanceFromLocation:[self geoLocation]];
[self setRadialDistance: sqrt(pow([origin altitude] - [[self geoLocation] altitude], 2) + pow(baseDistance, 2))];

float angle = sin(ABS([origin altitude] - [[self geoLocation] altitude]) / [self radialDistance]);
Expand All @@ -44,7 +44,7 @@ - (void)calibrateUsingOrigin:(CLLocation *)origin {
[self setInclination: angle];
[self setAzimuth: [self angleFromCoordinate:[origin coordinate] toCoordinate:[[self geoLocation] coordinate]]];

NSLog(@"distance is %d, angle is %d, azimuth is %d",baseDistance,angle,[self azimuth]);
NSLog(@"distance is %f, angle is %f, azimuth is %f",baseDistance,angle,[self azimuth]);
}

+ (ARGeoCoordinate *)coordinateWithLocation:(CLLocation *)location locationTitle:(NSString *) titleOfLocation {
Expand Down
8 changes: 2 additions & 6 deletions ARKit/ARKit.m
Expand Up @@ -18,14 +18,10 @@ +(BOOL)deviceSupportsAR{
return NO;
}

//Detect compass, if not there, return NO
CLLocationManager *locMan = [[CLLocationManager alloc] init];
if(!locMan.headingAvailable){
[locMan release];
if(![CLLocationManager headingAvailable]){
return NO;
}
[locMan release];


//cannot detect presence of GPS
//I could look at location accuracy, but the GPS takes too long to
//initialize to be effective for a quick check
Expand Down
3 changes: 1 addition & 2 deletions ARKit/ARViewController.m
Expand Up @@ -73,8 +73,7 @@ - (void)didReceiveMemoryWarning {
}

- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
agController = nil;
}


Expand Down
12 changes: 10 additions & 2 deletions ARKit/AugmentedRealityController.m
Expand Up @@ -89,8 +89,16 @@ - (id)initWithViewController:(UIViewController *)vc {

// This is needed to start showing the Camera of the Augemented Reality Toolkit.
-(void) displayAR {
[rootViewController presentModalViewController:[self cameraController] animated:NO];
[displayView setFrame:[[[self cameraController] view] bounds]];
@try {
[rootViewController presentModalViewController:self.cameraController animated:NO];
[displayView setFrame: [[[self cameraController] view] bounds]];
}
@catch (NSException *exception) {
NSLog(@"displayAR exception: %@", exception);
}
@finally {
NSLog(@"No error");
}
}

- (void)startListening {
Expand Down
Binary file added ARKitDemo/AR-logo-114.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ARKitDemo/AR-logo-57.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion ARKitDemo/ARKitDemo-Info.plist
Expand Up @@ -10,6 +10,11 @@
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIconFiles</key>
<array>
<string>AR-logo-57.png</string>
<string>AR-logo-114.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>org.iphonear.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -18,13 +23,24 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.2</string>
<string>0.3</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
51 changes: 38 additions & 13 deletions ARKitDemo/ARKitDemo.xcodeproj/project.pbxproj
Expand Up @@ -25,6 +25,8 @@
7F4C19A1112674030093704B /* ARLocationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F4C19A0112674030093704B /* ARLocationDelegate.m */; };
7F4C19F6112677260093704B /* ARViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F4C19F5112677260093704B /* ARViewController.m */; };
7F4C19FA112678E50093704B /* ARKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F4C19F9112678E50093704B /* ARKit.m */; };
8C564DDE141BDC3C0092E120 /* AR-logo-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 8C564DDC141BDC3C0092E120 /* AR-logo-57.png */; };
8C564DDF141BDC3C0092E120 /* AR-logo-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 8C564DDD141BDC3C0092E120 /* AR-logo-114.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -57,6 +59,8 @@
7F4C19F5112677260093704B /* ARViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARViewController.m; sourceTree = "<group>"; };
7F4C19F8112678E50093704B /* ARKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARKit.h; sourceTree = "<group>"; };
7F4C19F9112678E50093704B /* ARKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARKit.m; sourceTree = "<group>"; };
8C564DDC141BDC3C0092E120 /* AR-logo-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AR-logo-57.png"; sourceTree = "<group>"; };
8C564DDD141BDC3C0092E120 /* AR-logo-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AR-logo-114.png"; sourceTree = "<group>"; };
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>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -119,6 +123,8 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8C564DDC141BDC3C0092E120 /* AR-logo-57.png */,
8C564DDD141BDC3C0092E120 /* AR-logo-114.png */,
1118AA4910257DCE00C94460 /* location.png */,
28AD733E0D9D9553002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* ARKitDemo-Info.plist */,
Expand Down Expand Up @@ -194,7 +200,11 @@
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ARKitDemo" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -211,6 +221,8 @@
files = (
28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
1118AA4A10257DCE00C94460 /* location.png in Resources */,
8C564DDE141BDC3C0092E120 /* AR-logo-57.png in Resources */,
8C564DDF141BDC3C0092E120 /* AR-logo-114.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -241,99 +253,112 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Mike Tigas (334LW6Y4GY)";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ARKitDemo_Prefix.pch;
HEADER_SEARCH_PATHS = ../iPhoneAugmentedRealityLib;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ARKitDemo-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\\\"$(SRCROOT)/../iPhoneAugmentedRealityLib/build/Debug-iphoneos\\\"",

);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ARKitDemo;
PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ARKitDemo_Prefix.pch;
HEADER_SEARCH_PATHS = ../iPhoneAugmentedRealityLib;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ARKitDemo-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\\\"$(SRCROOT)/../iPhoneAugmentedRealityLib/build/Debug-iphoneos\\\"",

);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ARKitDemo;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
};
name = Release;
};
696B955F1116ADDB007D7A0F /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
GCC_AUTO_VECTORIZATION = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_UNROLL_LOOPS = YES;
OTHER_LDFLAGS = "-ObjC";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos3.1.2;
SDKROOT = iphoneos4.3;
};
name = Distribution;
};
696B95601116ADDB007D7A0F /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ARKitDemo_Prefix.pch;
HEADER_SEARCH_PATHS = ../iPhoneAugmentedRealityLib;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ARKitDemo-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\\\"$(SRCROOT)/../iPhoneAugmentedRealityLib/build/Debug-iphoneos\\\"",

);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ARKitDemo;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
};
name = Distribution;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_C_LANGUAGE_STANDARD = c99;
OTHER_LDFLAGS = "-ObjC";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos3.1.2;
SDKROOT = iphoneos4.3;
VALIDATE_PRODUCT = YES;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_AUTO_VECTORIZATION = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_UNROLL_LOOPS = YES;
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos3.1.2;
SDKROOT = iphoneos4.3;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 27e7143

Please sign in to comment.