I am just documenting my discoveries in case it is of use to anyone else but I managed to perform a raycast from the node so that it detects things other than its child nodes, I run this function on update but I am not sure if there is a more efficient way of doing it.
func heightTest(){
let result = sceneNode?.hitTestWithSegment(from: sceneNode!.position, to: SCNVector3(x: sceneNode!.position.x, y: -100, z: sceneNode!.position.z), options: [SCNHitTestOption.rootNode.rawValue: scene.rootNode])
if let intersection = result?.first?.simdWorldCoordinates {
print(intersection)
}
}
Topic:
Graphics & Games
SubTopic:
General
Tags: