-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5366ba1
commit b571cdf
Showing
57 changed files
with
1,298 additions
and
569 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
ARPlayer/Categories/SCNMaterial+Colors.m → ARPlayer/Categories/SCNMaterial+Contents.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// UIImpactFeedbackGenerator+Helpers.h | ||
// ARPlayer | ||
// | ||
// Created by Maxim Makhun on 04/03/2019. | ||
// Copyright © 2019 Maxim Makhun. All rights reserved. | ||
// | ||
|
||
@import UIKit; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface UIImpactFeedbackGenerator (Helpers) | ||
|
||
+ (void)lightImpactOccurred; | ||
|
||
+ (void)mediumImpactOccurred; | ||
|
||
+ (void)heavyImpactOccurred; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// UIImpactFeedbackGenerator+Helpers.m | ||
// ARPlayer | ||
// | ||
// Created by Maxim Makhun on 04/03/2019. | ||
// Copyright © 2019 Maxim Makhun. All rights reserved. | ||
// | ||
|
||
#import "UIImpactFeedbackGenerator+Helpers.h" | ||
|
||
@implementation UIImpactFeedbackGenerator (Helpers) | ||
|
||
+ (UIImpactFeedbackGenerator *)impactFeedbackGeneratorWithStyle:(UIImpactFeedbackStyle)style { | ||
return [[UIImpactFeedbackGenerator alloc] initWithStyle:style]; | ||
} | ||
|
||
+ (void)lightImpactOccurred { | ||
[[UIImpactFeedbackGenerator impactFeedbackGeneratorWithStyle:UIImpactFeedbackStyleLight] impactOccurred]; | ||
} | ||
|
||
+ (void)mediumImpactOccurred { | ||
[[UIImpactFeedbackGenerator impactFeedbackGeneratorWithStyle:UIImpactFeedbackStyleMedium] impactOccurred]; | ||
} | ||
|
||
+ (void)heavyImpactOccurred { | ||
[[UIImpactFeedbackGenerator impactFeedbackGeneratorWithStyle:UIImpactFeedbackStyleHeavy] impactOccurred]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// NodeInsertionHandler.h | ||
// ARPlayer | ||
// | ||
// Created by Maxim Makhun on 04/03/2019. | ||
// Copyright © 2019 Maxim Makhun. All rights reserved. | ||
// | ||
|
||
@import UIKit; | ||
|
||
#import "GestureHandleProtocol.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface NodeInsertionHandler : NSObject <GestureHandleProtocol> | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// NodeInsertionHandler.m | ||
// ARPlayer | ||
// | ||
// Created by Maxim Makhun on 04/03/2019. | ||
// Copyright © 2019 Maxim Makhun. All rights reserved. | ||
// | ||
|
||
@import ARKit; | ||
|
||
#import "NodeInsertionHandler.h" | ||
|
||
// Nodes | ||
#import "MediaPlayerNode.h" | ||
|
||
// Utils | ||
#import "PlaylistService.h" | ||
|
||
@implementation NodeInsertionHandler | ||
|
||
- (void)handleGesture:(UIGestureRecognizer *)gesture inSceneView:(ARSCNView *)sceneView { | ||
NSAssert([gesture isKindOfClass:[UILongPressGestureRecognizer class]], @"Different class type is expected."); | ||
|
||
if (gesture.state == UIGestureRecognizerStateBegan) { | ||
CGPoint tapPoint = [gesture locationInView:sceneView]; | ||
NSArray<ARHitTestResult *> *arHitTestResults = [sceneView hitTest:tapPoint | ||
types:ARHitTestResultTypeExistingPlaneUsingExtent]; | ||
|
||
if (arHitTestResults.count != 0) { | ||
ARHitTestResult *hitResult = [arHitTestResults firstObject]; | ||
simd_float4 column = hitResult.anchor.transform.columns[3]; | ||
|
||
MediaPlayerNode *mediaPlayerNode = [[MediaPlayerNode alloc] initWithPlaylist:[PlaylistService playlist]]; | ||
mediaPlayerNode.position = SCNVector3Make(column.x, column.y, column.z); | ||
[mediaPlayerNode play]; | ||
[sceneView.scene.rootNode addChildNode:mediaPlayerNode]; | ||
} | ||
} | ||
} | ||
|
||
@end |
Oops, something went wrong.