Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created May 21, 2018 19:03
Show Gist options
  • Save azamsharp/4dd7d235b2168a5f17747b7440d4ae0f to your computer and use it in GitHub Desktop.
Save azamsharp/4dd7d235b2168a5f17747b7440d4ae0f to your computer and use it in GitHub Desktop.
private func hitTestWithPlane(touch :CGPoint) {
let hitTestResults = sceneView.hitTest(touch, types: .existingPlane)
if !hitTestResults.isEmpty {
if let hitTestResult = hitTestResults.first {
print("plane hit test")
print(hitTestResult.worldTransform)
addAnchorWithTransform(transform: hitTestResult.worldTransform)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment