I have a subclass "ExSCNNode" of SCNNode to add more properties and behavior to the SCNNode.
class ExSCNNode : SCNNode {
...
}
I than build a scene with a ExSCNNode.
let testnode = ExSCNNode()
When hittesting the scene:
// check what nodes are tapped
let p = gestureRecognize.location(in: scnView)
let hitResults = scnView.hitTest(p, options: [:])
// check that we clicked on at least one object
if hitResults.count > 0 {
for hit in hitResults {
let hitnode = hit.node
...
hitnode is a SCNNode not a ExSCNNode. But I want to get the ExSCNNode to access the advance functionality.
How do I get access to the subclass instead of the SCNNode class ?
ExSCNNode
. You have not included the code where it is created. – Gary Makin