GithubHelp home page GithubHelp logo

rzulkoski / focusentity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maxxfrazer/focusentity

0.0 1.0 0.0 4.16 MB

Bringing the scanning box from SceneKit to RealityKit

License: MIT License

Swift 97.80% Shell 2.20%

focusentity's Introduction

FocusEntity

This package is based on the package ARKit-FocusNode, but adapted to work in Apple's Augmented Reality framework, RealityKit.

Lint Status Build Status Swift Package Manager Swift 5.0

FocusEntity Example 1

The Example looks identical to the above GIF, which uses the FESquare class (Focus Entity Square).

⚠️ iOS 13.2 bug ⚠️

There is a crashing bug when using this library with iOS 13.2 and importing via Swift Package Manager

The Swift bug has been reported here: https://bugs.swift.org/browse/SR-11564

And there is a temporary solution, which involves setting the "Dead Code Stripping" property in your build's target to "No"

Target > Build Settings > Linking > Dead Code Stripping

Minimum Requirements

  • Swift 5.0
  • iOS 13.0 (RealityKit)
  • Xcode 11

If you're unfamiliar with using RealityKit, I would also recommend reading my articles on Getting Started with RealityKit.

Installation

Swift Package Manager

Add the URL of this repository to your Xcode 11+ Project.

https://github.com/maxxfrazer/FocusEntity.git


Usage

See the Example for a full working example as can be seen in the GIF above

  • After installing, import FocusEntity to your .swift file
  • Create an instance of FESquare(), or another FocusEntity class.
  • Add the ARSmartHitTest protocol to ARView or any subclass you might be using:
extension ARView: ARSmartHitTest {}
  • Set the FocusEntity's viewDelegate to the ARView & ARSmartHitTest class.
  • Using the ARSessionDelegate, define the session(_:didUpate:) function with a call to focusEntity.updateFocusNode()

If something's not making sense in the Example, send me a tweet or Fork & open a Pull Request on this repository to make something more clear.

I'm hoping to make the animations look a little smoother over time, but any and all contributions are welcome and encouraged.

Please follow the guide for creating GitHub Issues, otherwise I may simply close them.


The original code to create this repository has been adapted from one of Apple's examples from 2018, license also included. I have merely adapted the code to be used and distributed from within a Swift Package, and now further adapted to work with RealityKit.

focusentity's People

Contributors

maxxfrazer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.