Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios SceneKit头发骨骼动态移动限制,头发动画_Ios_Swift_Animation_Scenekit - Fatal编程技术网

Ios SceneKit头发骨骼动态移动限制,头发动画

Ios SceneKit头发骨骼动态移动限制,头发动画,ios,swift,animation,scenekit,Ios,Swift,Animation,Scenekit,我有一个.dae模型的长头发,由几缕头发分开。每一条线都有自己的骨头树。我花了很多时间找一些 解决方案-使用GitHub中的rope在示例上构建it 所以我用分支节点设置了每个骨骼树 let strand_branch = SCNNode(geometry: SCNCylinder(radius: 0.007, height: CGFloat(_branchHeight))) strand_branch.name = "branch_\(branch.rawValue)" strand_bra

我有一个.dae模型的长头发,由几缕头发分开。每一条线都有自己的骨头树。我花了很多时间找一些 解决方案-使用GitHub中的rope在示例上构建it

所以我用分支节点设置了每个骨骼树

let strand_branch = SCNNode(geometry: SCNCylinder(radius: 0.007, height: CGFloat(_branchHeight)))
strand_branch.name = "branch_\(branch.rawValue)"
strand_branch.geometry!.firstMaterial!.diffuse.contents = SKColor.clear
strand_branch.physicsBody = SCNPhysicsBody.static()
strand_branch.physicsBody?.collisionBitMask = 0
strand_branch.position = first_bone_position
currentScene!.rootNode.addChildNode(strand_branch)
接下来,我把每一根骨头都设置成这样

bone.physicsBody = SCNPhysicsBody.dynamic()
bone.physicsBody?.friction = 0.5
bone.physicsBody?.restitution = 0
bone.physicsBody?.mass = mass
bone.physicsBody?.isAffectedByGravity = false
bone.physicsBody?.damping = 0.5
bone.physicsBody?.angularDamping = 0.5
然后,我将SCNPhysicsBallSocketJoint添加到分支和第一块骨骼,以及每对骨骼

所以现在对头发的物理模拟是可行的,但这是骨骼位置限制的问题。我想限制每一缕头发,以防它遮住脸。 我的目标是像Apple memodji中那样的光顺头发动画

请帮忙!谢谢