Skip to content

Focus Square attaching onto planes in point of view in RealityKit

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.origin
Notifications You must be signed in to change notification settings

deebov/FocusEntity

Repository files navigation

FocusEntity

This package was inspired by Apple's examples and Max Frazer's package and is alternative to FocusEntity except that this package uses RayCasting method instead of HitTest

build Swift Package Manager Swift 5.0

Minimum Requirements

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

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

Installation

Swift Package Manager

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

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


Usage

See the Example for a full working example using SwiftUI

  • After installing, import FocusEntity to your .swift file
  • Create an instance of let focusSquare = FocusSquare(), or another FocusEntity class.
  • Set focusSquare.arViewDelegate to the ARView it is to be rendered within.
  • Set the FocusEntity to auto-update: focusSquare.setAutoUpdate(to: true)

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.


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.

About

Focus Square attaching onto planes in point of view in RealityKit

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.origin

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages