我正在尝试使用适用于iOS 11的ARKit进行简单的抛球游戏,并且我有一个场景可以保留三个节点(灯光,地板,它的物理体型是静态的,垃圾桶还是某些东西可以保持被抛出的球)

在飞机检测并将垃圾桶放在ARPlane上之后,每当用户点击按钮投掷球时,就会调用一种方法 . 球的物理体类型是动态的,并且正在使用SCNNode在视图控制器文件(未在.scn文件中创建)中创建和投掷,并使用physicsBody应用力 .

let ball = SCNSphere(radius: 0.025)
let ballNode = SCNNode(geometry: ball)
let forceDirection = SCNVector3Make(0, 0, -2)
let physicsBody = SCNPhysicsBody(type: .dynamic, shape: SCNPhysicsShape(geometry: ball, options: nil))
physicsBody.isAffectedByGravity = true
physicsBody.allowsResting = true
physicsBody.mass = 1
physicsBody.restitution = 1
physicsBody.friction = 0
physicsBody.applyForce(forceDirection, asImpulse: true)
ballNode.physicsBody = physicsBody
sceneView.scene.rootNode.addChildNode(ballNode)

.scn文件中的节点

场景中地板的物理主体属性:
enter image description here

Everything is fine with tossing the balls using the forces and adding them to the scene using sceneView but the PROBLEM is that the balls are keep passing through the trash can and the floor itself even though they're kinematic and/or static.

更新:为球和飞机(地板)设置碰撞比特后现在问题是球不会留在垃圾桶里,即使我已经减少了垃圾的归还