ios - 无法使用物理形状的凹面表示

标签 ios shapes scenekit

每当我分配一个凹形物理形状

let physicsShape = SCNPhysicsShape(node: starNode, options: [SCNPhysicsShapeTypeKey:SCNPhysicsShapeTypeConcavePolyhedron])
starNode.physicsBody = SCNPhysicsBody(type: SCNPhysicsBodyType.Dynamic, shape: physicsShape)

starNode 正好穿过所有其他节点。我在 Blender 中创建了 starNode。我还注意到,在场景编辑器中,我无法将 starNode 的 PhysicsShapeType 分配给 Concave。为什么会发生这种情况,我该如何解决? Convex 形状类型是毫无疑问的,因为它是几何的不准确表示。

最佳答案

来自docs :

SCNPhysicsShapeTypeConcavePolyhedron

The physics shape is a concave polyhedron closely following the surface of the geometry.

This option provides the highest level of detail, at a high cost to simulation performance. Use it only for irregularly shaped bodies where precise collision behavior is crucial to your app’s design.

This shape type may only be used for static physics bodies (that is, those whose type property is SCNPhysicsBodyTypeStatic).

如果您需要一个凹形的动态形状,最好的办法是从多个 SCNPhysicsShape 对象(或从节点及其几何结构的层次结构)创建一个复合形状。

关于ios - 无法使用物理形状的凹面表示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31648396/

相关文章:

iphone - 如何从我的应用程序访问 iphone 联系人?

ios - 尽管添加了自动布局约束,但 UIScrollView 不滚动

ios - 我是否需要 ios sdk 7.0 才能使用 swift 在 xcode 6 beta 中开发 ios 7 应用程序

r - 如何在给定的指定区域生成随机形状。(R语言)?

android - 具有圆角 xml 形状的掩码布局

swift - 我正在尝试检测 ARKit SceneKit 中两个节点之间的接触

ios - SceneKit——将 Objective-C block 转换为 Swift

objective-c - 以半径搜索位置(cocoa-touch)

objective-c - 旋转后如何获取SceneKit中子节点的真实位置?

WPF 形状矩形绑定(bind)