问题
Whenever I assign a Concave physics shape
let physicsShape = SCNPhysicsShape(node: starNode, options: [SCNPhysicsShapeTypeKey:SCNPhysicsShapeTypeConcavePolyhedron])
starNode.physicsBody = SCNPhysicsBody(type: SCNPhysicsBodyType.Dynamic, shape: physicsShape)
the starNode just falls through all other nodes. I created starNode in Blender. I also noticed that in Scene Editor I am unable to assign PhysicsShapeType of starNode to Concave. Why is this happening and how do I fix it? The Convex shape type is out of question because it is an inaccurate representation of geometry.
回答1:
From the 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 isSCNPhysicsBodyTypeStatic
).
If you need a dynamic shape to be concave, your best bet is to create a compound shape from multiple SCNPhysicsShape
objects (or from an hierarchy of nodes and their geometry).
来源:https://stackoverflow.com/questions/31648396/unable-to-use-concave-representation-of-physics-shape