It seems you just can't add a physics body in code.
Not much more can be said than this, has anyone found this issue?
Some example code ...
class SomeSceneView: SCNView {
public var box: SCNNode!
..
var physBody = SCNPhysicsBody()
private func bringup() {
box = scene?.rootNode.childNode(withName: "box", recursively: true)
physBody.type = .dynamic
physBody.isAffectedByGravity = false
physBody.friction = 0
box.physicsBody = physBody
rendersContinuously = true
play(nil)
}
}
Any experience with this?