krntz
krntz

Reputation: 653

ARKit - Extend the reach of "hitTest"

I want to perform a hit testing from a point on the screen to a Cube in a 3D world. I've been using hitTest from ARKit. It works when I'm standing close to the cube, but when I start moving backwards, it stops working. I'm assuming this is because it's locked to the camera's zRange.

I've tried to set the clipToZRange option to false, like so:

let hits = self.sceneView.hitTest(loc, options: [SCNHitTestOption.clipToZRange: false])`

but it doesn't seem to have any effect.

Am I not setting the option right, or is this a bug?

I am using the latest Xcode and iOS betas.

Upvotes: 1

Views: 597

Answers (1)

krntz
krntz

Reputation: 653

Turns out the showFeaturePoints debug option from ARKit interferes with hitTest...

Upvotes: 4

Related Questions