• Stars
    star
    120
  • Rank 295,983 (Top 6 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ready-and-easy-to-use ARKit framework for the best user experience.

Cocoapods Compatible Platform

SamMiti AR on iOS

Ready-and-easy-to-use ARKit framework for the best user experience.

Overview

Augmented Reality in iOS has been a very big topic since Apple announced ARKit in WWDC 2017. The API has widely used to leverage 3D immersive user experience; however, in order to implement a good ARKit experience, there are a lot of small components to consider, and it takes a lot of time and effort. SamMiti-AR on iOS is an ARKit framework that has been made based on most of the basic user experiences aligning to Apple human interface guidelines and common functions ready for engineers to use.

Notable Features

Placing Multiple Virtual Objects

Placing Multiple Virtual Objects

The framework comes with the multiple-virtual-object handler that is ready to use with the SamMiti AR placing feature right away.

Quick Drop, Preview in AR with No Effort

Quick Drop, Preview in AR with No Effort

Influenced by AR Quick Look feature in iOS 12, with this feature, the virtual object can be placed without tapping anything on screen. When previewing one virtual object in AR, this would be the ideal way that most minimize all steps into one.

Interaction with Fluidity

Interaction with Fluidity

No more jumpy effect when virtual objects dragged. There is a smooth transition for all interactions even if the object gets dragged from the table to the floor.

Interaction with Snapy Zoom

All-in-one Virtual Objects Manipulating Interaction

Customizable AR Focus Point

Debug Mode, Really Know What’s Going on

Debug Mode, Really Know What’s Going on

Support All Open 3D Content Formats (glTF-ready)

ARKit2-ready

And A Lot More to Play with

Description

SamMiti-AR on iOS has wrapped most of AR-and-3D-related functionalities in one place. That means a lot of time that needs to be spent on the basic structure will be reduced by using this framework.

For you information, the framework was made on top of ARSCNView (ARKit SceneView) which use SceneKit as an engine to render images, so you can expect a lot of sceneKit functions are referred in this framework.

Requirement

  • iOS 11.3+
  • Xcode 9.0+

Installation

CocoaPods

SamMitiAR is available through CocoaPods. To install it, simply add the following line to your Podfile:

#for Xcode9 (iOS 11.3+)
pod 'SamMitiAR', '~> 1.0'

#for Xcode10 Beta
pod 'SamMitiAR', :git => 'https://github.com/prolificinteractive/SamMitiAR-iOS.git', :branch => 'features/xcode10-compatible'

Example Projects

Usage

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis fringilla lectus. Nullam ornare erat eget ultrices rhoncus. Aenean eleifend euismod dolor, id tempus eros iaculis et. Aenean efficitur mi id nulla egestas mollis. Integer id tincidunt tortor.

SamMiti-AR for iOS Structure and How it works

This framework was made on top of ARSCNView which utilizes both functionalities of SceneKit and ARKit. Moreover, the framework has several helper classes to setup the basic necessory augmented reality experience, load and place virtual objects, allow users to interact with the objects. The classes in the framework consist of ......

Setup and Configure

To Use SamMitiARView, after install SamMiti pod, you can simply create new ARSCNView in the storyboard, change the view to subClass to SamMitiView and create IBOutlet linking to your storyboard, or programatically initialize SamMitiARView in your view controller.

In your view controller, you will need to import SamMiti framework along with ARKit and SceneKit.

import SamMiti
import ARKit
import SceneKit

In order to have SamMitiView be able to call back to your view controller, the delegate method need to be defined, and ViewDidLoad function is a good place for it.

// SamMiti AR View Delegate
sceneView.samMitiARDelegate = self

To config some behaviors, you can do that in ViewDidLoad function of view controller. There are a few functions that need to be called before the view is initialied ARSession which includes enabling the camera auto focus function isAutoFocusEnabled, .... and serveral optional functions that you can change when the ARSession is running.

// SamMiti AR View Configuration
sceneView.isAutoFocusEnabled = false

// SamMiti AR View Configuration can be changed along the ARSession is running
sceneView.hitTestPlacingPoint = CGPoint(x: 0.5, y: 0.5)
sceneView.isLightingIntensityAutomaticallyUpdated = true
sceneView.baseLightingEnvironmentIntensity = 6

To have SamMitiAR run, setup() need to be called in View Will Appeare.

sceneView.setup(withDebugOptions: [])

Besides the setup() function, session.pause() still needs to be called when view will disappere to stop processing the ARSession when users leave the the view controller.

// Pause the view's AR session.
sceneView.session.pause()

Work in Progress

Placing Mode

There are two modes of placing virtual objects. One is called quickDrop. This mode allows users to place virtual objects without tapping anything on screen, but it require users to move their devices to get ARKit initialize plane anchor. The other mode is called focusNode. This mode allows users to use Focus Node (indicator focus point) to indicate where the virtual object will be placed, and users need to tap on the screen in order to have the virtual object placed at the desired spot.

// WIP image example of quickDrop mode

Example of quickDrop mode

// WIP image example focusNode mode

Example of focusNode mode

To set placing mode of SamMitiAR View, the property placingMode need to be set to the desired mode. The best place to set this property is before function startAR() get called.

/// Example of setting SamMitiAR view to *quickDrop* mode
sceneView.placingMode = .quickDrop

Placing and Removing Virtual Objects

Work in Progress

func prepareToPlaceVirtualObject() {

let virtualObjectScene = SCNReferenceNode(named: "art.scnassets/stubhub_model/stadium_1223.scn")!
let virtualObjectNode = SamMitiVirtualObject(refferenceNode: refNode, allowedAlignments: .all)

/*
let virtualObjectGLTFNode = SamMitiVirtualObject(gltfUrl: URL(string: "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Embedded/Duck.gltf")!, allowedAlignments: [.horizontal])
*/

SamMitiVitualObjectLoader().loadVirtualObject(virtualObjectNode, loadedHandler: self.handleLoad)

}

func handleLoad(virtualNode: SamMitiVirtualObject?) {

guard let virtualNode = virtualNode else { return }
samMitiARView.currentVirtualObject = virtualNode

}

Work in Progress

func remove(virtualNode: SamMitiVirtualObject?) {

guard let virtualNode = virtualNode else { return }
samMitiARView.currentVirtualObject = virtualNode

if samMitiARView.placedVirtualObjects.contains(virtualNode) {
self.virtualObjectLoader.remove(virtualNode)
}

}

Work in Progress

Customize Focus Node

Work in Progress

Work in Progress

samMitiARView.focusNode = SamMitiFocusNode(withNotFoundNamed: "art.scnassets/focus_node_not_found.scn",
estimatedNamed: "art.scnassets/focus_node_estimated.scn",
existingNamed: "art.scnassets/focus_node_existing.scn")

Work in Progress

Leverage SamMiti-AR Callbacks

Work in Progress

func trackingStateReasonChanged(to trackingStateReason: ARCamera.TrackingState.Reason?) {
guard let trackingStateReason = trackingStateReason else { return }
switch trackingStateReason {
case ARCamera.TrackingState.Reason.excessiveMotion:
messageLabelDisplay("Please move your phone slower")
case ARCamera.TrackingState.Reason.initializing:
messageLabelDisplay("Initializing AR Experience")
case ARCamera.TrackingState.Reason.insufficientFeatures:
messageLabelDisplay("Seems like there isn't enough light")
case ARCamera.TrackingState.Reason.relocalizing:
messageLabelDisplay("Relocalizing AR Experience")
}
}

Work in Progress

func samMitiViewWillPlace(_ virtualObject: SamMitiVirtualObject, at transform: SCNMatrix4) {
guard let virtualObjectName = virtualObject.name else { return }
messageLabelDisplay("SamMiti will place \(virtualObjectName)")
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.impactOccurred()
}

Work in Progress

Contributing to SamMiti AR

To report a bug or enhancement request, feel free to file an issue under the respective heading.

If you wish to contribute to the project, fork this repo and submit a pull request.

License

prolific

Copyright (c) 2017 Prolific Interactive

SamMiti-AR-iOS is maintained and sponsored by Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.

More Repositories

1

material-calendarview

A Material design back port of Android's CalendarView
Java
5,903
star
2

ParallaxPager

Add some depth to your Android scrolling.
Java
779
star
3

Caishen

A Payment Card UI & Validator for iOS
Swift
762
star
4

Yoshi

A convenient wrapper around the UI code that is often needed for displaying debug menus.
Swift
267
star
5

Chandelier

A nice swipe layout that provides new actions with a material design look and feel
Java
240
star
6

swift-style-guide

A style guide for Swift.
176
star
7

node-html-to-json

Parses HTML strings into objects using flexible, composable filters.
JavaScript
119
star
8

PIDatePicker

[DEPRECATED] A customizable implementation of UIDatePicker, written in Swift.
Swift
39
star
9

navigation-conductor

A Conductor integration for the Navigation Architecture Component.
Kotlin
38
star
10

android-studio-templates

A set of templates for your Android Studio
FreeMarker
35
star
11

NavigationControllerBlurTransition

[DEPRECATED] A UINavigationController transition that utilizes a blur view for a simple interface.
Swift
35
star
12

HouseOfCards

Android tools for working with a house of (credit) cards
Java
27
star
13

Optik

A Swift library for displaying images from any source, local or remote.
Swift
25
star
14

PIAPIEnvironmentManager

[DEPRECATED] A simple manager for handling the various API Environments in your project.
Objective-C
20
star
15

SOLID-Principles

Exploring the SOLID Principles in Swift. Video: https://www.youtube.com/watch?v=gkxmeWvGEpU&t=2s
Swift
19
star
16

simcoe

A simple, light analytics framework for iOS.
Swift
19
star
17

anchored-behavior

A CoordinatorLayout Behavior to anchor views with an animation.
Kotlin
17
star
18

Marker

A light wrapper around NSAttributedString.
Swift
15
star
19

Kumi-iOS

Swift
15
star
20

TouchIDBlogPost

Accompanies the tutorial "Use Touch ID in Your Swift App"
Swift
12
star
21

Bellerophon

Swift
12
star
22

Pilas

A scrollable stackview.
Swift
9
star
23

applepay-demo

Objective-C
9
star
24

heimdall

A simple validation check overview for you password fields.
Java
8
star
25

mabi

Start your REST Mobile APIs Fast and Build as you Grow
C
8
star
26

PIVideoPlayer

[DEPRECATED] A custom wrapper around AVFoundation for playing silent video files without any chrome.
Objective-C
7
star
27

Velar

A custom alert view presenter.
Swift
6
star
28

geocoder

This is a device independent and plugable replacement for Android's builtin Geocoder.
Kotlin
6
star
29

ShimmerBlocks

Add blocked shimmering views to your view components.
Swift
5
star
30

Cake

[DEPRECATED] A Cocoapods wrapper allowing for greater control over your workspaces
Swift
5
star
31

ballad

Assemble API Blueprint specs with concatenation, templating, and inheritance.
HTML
4
star
32

patrons

SharedPreferences wrappers with an encryption package.
Kotlin
3
star
33

DeathStar

Sample project for the "Conquering the Testing Beast" talk for Swift Camp (http://swiftcamp.io/)
Swift
3
star
34

behalf

Emulate the way browsers make requests and manage cookies.
JavaScript
3
star
35

data-builder

A build tool for JSON and YAML that uses special keys to specify functions, i.e. $import.
JavaScript
2
star
36

TickerCounter

A counter with a ticker animation.
Swift
2
star
37

simplesamlphp-module-mongodb

SimpleSAML Store implementation for MongoDB PHP Library
PHP
2
star
38

flutter_debug_menu

Flutter Debug Menu
Dart
2
star
39

Birdo

Prolific's android wrapper around the UI code that is often needed for displaying debug menus.
Kotlin
1
star
40

glenlivet

Create flexible, reusable processing pipelines powered by plugins.
JavaScript
1
star
41

mabiSkeletonApi

PHP
1
star
42

Olapic-SDK-iOS

Objective-C
1
star
43

prolific-cleaner

Sets up javascript projects to be linted and checked for code styles based on commit and push git hooks.
JavaScript
1
star
44

IQKeyboardManager

Objective-C
1
star
45

simcoe-android

A simple, light analytics framework for Android.
Kotlin
1
star
46

DevKit

Collection of commonly used swift code
Swift
1
star
47

PIPassiveAlert

[DEPRECATED] A passive alert library in Objective-C. 🚨
Objective-C
1
star
48

pandroid-gradle-plugin

The PAndroid Gradle plugin allows all Prolific's Android project to run on our CI pipeline for different build variants.
Groovy
1
star
49

artgun-php

PHP ArtGun API Wrapper
PHP
1
star
50

simplesamlphp-module-mongo

SimpleSAML Store implementation for MongoDB
PHP
1
star