ARKit-CoreLocation icon indicating copy to clipboard operation
ARKit-CoreLocation copied to clipboard

Decrease radius to only show nearest objects

Open giovannimartusciello opened this issue 6 years ago • 4 comments

Basically title. I'd like to load some pins and only show the ones relative to my position until a certain range (< 3km).

giovannimartusciello avatar Dec 10 '18 12:12 giovannimartusciello

did you found any solution for this

Parameshvadivel avatar Jan 11 '19 09:01 Parameshvadivel

You can check the distance to the nodes and hides all that situated is too far away, for example

maxDistance: Double = 3000
sceneLocationView.locationNodes.forEach{
    let p = $0.position
    let distance: Double = Double(sqrt(pow(p.x, 2) + pow(p.y, 2) + pow(p.z, 2)))
    $0.isHidden =  distance < maxDistance
}`

medlay avatar Apr 16 '19 19:04 medlay

This absolutely can be done in "your" app, but I can see how this feature would be really nice to have in the library.

intere avatar May 17 '19 18:05 intere

For a nice touch, this can be animated ...

sceneLocationView.locationNodes.forEach {
    let p = $0.position
    SCNTransaction.animationDuration = 0.25
    let distance: Double = Double(sqrt(pow(p.x, 2) + pow(p.y, 2) + pow(p.z, 2)))
    $0.opacity = (distance < maxDistance ? 1 : 0)
}

Pilot-Marc avatar Jul 17 '19 21:07 Pilot-Marc