arkit

swift 4.0: Overriding 'prepare' must be as available as declaration it overrides

时光怂恿深爱的人放手 提交于 2020-02-23 10:20:49
问题 I was trying to integrate Apple's ARKit example app into my app. As ARKit is only an additional feature, so I need to support lower versions of iOS. I added @available(iOS 11.0, *) tag to all the ARKit example app classes...It almost works except this 1 error: "Overriding 'prepare' must be as available as declaration it overrides". Any idea how can I resolve this issue ? Xcode error image 回答1: What worked for me was adding the @available attribute above the method like so: @available(iOS 11.3

swift 4.0: Overriding 'prepare' must be as available as declaration it overrides

只谈情不闲聊 提交于 2020-02-23 10:20:06
问题 I was trying to integrate Apple's ARKit example app into my app. As ARKit is only an additional feature, so I need to support lower versions of iOS. I added @available(iOS 11.0, *) tag to all the ARKit example app classes...It almost works except this 1 error: "Overriding 'prepare' must be as available as declaration it overrides". Any idea how can I resolve this issue ? Xcode error image 回答1: What worked for me was adding the @available attribute above the method like so: @available(iOS 11.3

How to use Raycast methods in RealityKit?

廉价感情. 提交于 2020-02-23 05:23:53
问题 There are three ways about Detecting Intersections in RealityKit framework, but I don't know how to use it in my project. 1. func raycast(origin: SIMD3<Float>, direction: SIMD3<Float>, length: Float, query: CollisionCastQueryType, mask: CollisionGroup, relativeTo: Entity?) -> [CollisionCastHit] 2. func raycast(from: SIMD3<Float>, to: SIMD3<Float>, query: CollisionCastQueryType, mask: CollisionGroup, relativeTo: Entity?) -> [CollisionCastHit] 3. func convexCast(convexShape: ShapeResource,

How to use Raycast methods in RealityKit?

前提是你 提交于 2020-02-23 05:23:19
问题 There are three ways about Detecting Intersections in RealityKit framework, but I don't know how to use it in my project. 1. func raycast(origin: SIMD3<Float>, direction: SIMD3<Float>, length: Float, query: CollisionCastQueryType, mask: CollisionGroup, relativeTo: Entity?) -> [CollisionCastHit] 2. func raycast(from: SIMD3<Float>, to: SIMD3<Float>, query: CollisionCastQueryType, mask: CollisionGroup, relativeTo: Entity?) -> [CollisionCastHit] 3. func convexCast(convexShape: ShapeResource,

How to load SCN or glTF model at runtime in ARKit app?

情到浓时终转凉″ 提交于 2020-02-23 04:00:43
问题 What is the best way to load a 3d model from a URL inside of iOS at runtime. I have tried this .scn and .gtlf models importer. I am using this framework https://github.com/prolificinteractive/SamMitiAR-iOS I load the model like this: let virtualObjectGLTFNode = SamMitiVirtualObject(gltfUrl: URL(string: "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample- Models/master/2.0/Duck/glTF-Embedded/Duck.gltf")!, allowedAlignments: [.horizontal]) virtualObjectGLTFNode.name = "Duck"

Deferred Shadow doesn't work if detecting Multiple Transparent Planes

↘锁芯ラ 提交于 2020-02-22 07:46:44
问题 In my code, I detect the plane and show shadow for the object above the plane. If there is one plane, it works fine, but if it detects multiple planes, the redundant shadow will show. As the picture shows, on the plane #1, the shadow is right, but if I add another plane #2, the plane #2 has the wrong shadow, even if I remove the airplane, the shadow on plane #1 disappears, but the shadow on plane #2 is still there. I don't want to remove the plane #2, but how to remove the wrong shadow on

Can I track more than 4 images at a time with ARKit?

℡╲_俬逩灬. 提交于 2020-02-14 13:04:03
问题 Out of the box it's pretty clear ARKit doesn't allow for the tracking of more than 4 images at once. (You can "track" more markers than that but only 4 will function at a time). See this question for more details on that. However, I'm wondering if there is a possible work-around. Something like adding and removing anchors on a timer or getting the position information and then displaying the corresponding models without ARKit, etc. My knowledge of Swift is fairly limited so I haven't had much

Can I track more than 4 images at a time with ARKit?

馋奶兔 提交于 2020-02-14 13:03:07
问题 Out of the box it's pretty clear ARKit doesn't allow for the tracking of more than 4 images at once. (You can "track" more markers than that but only 4 will function at a time). See this question for more details on that. However, I'm wondering if there is a possible work-around. Something like adding and removing anchors on a timer or getting the position information and then displaying the corresponding models without ARKit, etc. My knowledge of Swift is fairly limited so I haven't had much

How to get values from methods written in IOS plugin in unity?

情到浓时终转凉″ 提交于 2020-02-07 01:16:07
问题 I am looking to get latitude and longitude values from an IOS plugin.The plugin code is given below which is a .mm file. #import "iPhone_Sensors.h" #import <CoreLocation/CoreLocation.h> #import <CoreMotion/CoreMotion.h> #include "iPhone_View.h" #include "iPhone_OrientationSupport.h" static bool gCompensateSensors = true; bool gEnableGyroscope = false; bool IsCompensatingSensors() { return gCompensateSensors; } void SetCompensatingSensors(bool val) { gCompensateSensors = val;} void

Add 3d node to sceneView following wwdc code, but the 3d node rotates 90 degrees

余生颓废 提交于 2020-02-06 07:42:35
问题 I use iPad to develop an AR app. I follow the wwdc code to add my first node on the sceneView. If the iPad is landscape, I can get the right result, but if the iPad is Portrait, it rotates 90 degrees. Anybody can help me, thanks? guard let frame = sceneView.session.currentFrame else { return } if let scnStr = noti.object as? String { // Create a new scene let scene = SCNScene(named: "art.scnassets/\(scnStr)")! let emojiNode = SCNNode() for node in scene.rootNode.childNodes { emojiNode