简体   繁体   English

添加 SCNPhysicsBallSocketJoint 时 SceneKit 崩溃

[英]SceneKit crash when adding SCNPhysicsBallSocketJoint

I'm using ARKit and SceneKit to face tracking, so in some case I need to reset me scene.我正在使用 ARKit 和 SceneKit 进行面部跟踪,所以在某些情况下我需要重置我的场景。 This is my code for resetting:这是我的重置代码:

sceneView.scene.physicsWorld.removeAllBehaviors()

let configuration = ARFaceTrackingConfiguration()
configuration.isLightEstimationEnabled = true
sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])

Next step is setup my scene where I'm adding nodes and link them by SCNPhysicsBallSocketJoint .下一步是设置我添加节点并通过SCNPhysicsBallSocketJoint链接它们的场景。 But this step causes the crash但是这一步会导致崩溃

Thread 8 name:  com.apple.scenekit.scnview-renderer  Dispatch queue: com.apple.scenekit.renderingQueue.ARSCNView0x153d0a8d0
Thread 8 Crashed:
0   SceneKit                        0x00000001bad70600 btUnionFind::unite+ 2950656 (int, int) + 8
1   SceneKit                        0x00000001bad705cc btDiscreteDynamicsWorld::calculateSimulationIslands+ 2950604 () + 296
2   SceneKit                        0x00000001bad6f218 btDiscreteDynamicsWorld::internalSingleStepSimulation+ 2945560 (float) + 136
3   SceneKit                        0x00000001bad6f138 btDiscreteDynamicsWorld::stepSimulation+ 2945336 (float, int, float) + 276
4   SceneKit                        0x00000001babb7334 -[SCNPhysicsWorld _step:] + 180
5   SceneKit                        0x00000001babff774 -[SCNRenderer _update:] + 964
6   SceneKit                        0x00000001bac01c50 -[SCNRenderer _drawSceneWithNewRenderer:] + 196
7   SceneKit                        0x00000001bac02208 -[SCNRenderer _drawScene:] + 48
8   SceneKit                        0x00000001bac025b0 -[SCNRenderer _drawAtTime:] + 636
9   SceneKit                        0x00000001bac9c9bc -[SCNView _drawAtTime:] + 452
10  ARKit                           0x00000001c275b9cc -[ARSCNView _drawAtTime:] + 40
11  SceneKit                        0x00000001bab638d0 __69-[NSObject+ 800976 (SCN_DisplayLinkExtensions) 

it is strange that at first time scene setup there is no crash when adding SCNPhysicsBallSocketJoint joints to nodes.奇怪的是,在第一次场景设置时,将SCNPhysicsBallSocketJoint关节添加到节点时没有崩溃。 I think maybe there is the reason in wrong reset the scene.我想也许是错误重置场景的原因。 Please help.请帮忙。

The nodes in SCNPhysicsBallSocketJoint should have physicalBodyies. SCNPhysicsBallSocketJoint 中的节点应该有physicalBodyies。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM