gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 10:27:02 25 4
gpt4 key购买 nike

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

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com