我目前正在使用SKPhysicsJointSpring将多个节点连接在一起。我希望能用对数公式,而不是胡克定律来说明力。
有什么方法可以让我用子类SKPhysicsJoint来提供我自己的力计算吗?或者必须在update(..)中手动实现这一点。
非常感谢,
发布于 2015-08-14 21:17:47
您必须“在update中手动”或以其他方式实现它。SKPhysicsJoint及其明显的子类甚至都不是真实的。试着打印一个:
:; xcrun swift -framework SpriteKit
"crashlog" and "save_crashlog" command installed, use the "--help" option for detailed help
Welcome to Apple Swift version 2.0 (700.0.52.1 700.0.65). Type :help for assistance.
1> import SpriteKit
2> print(SKPhysicsJoint())
<PKPhysicsJoint: 0x1029006b0>
3> print(SKPhysicsJointSpring())
<PKPhysicsJointDistance: 0x102800530>实际上,您可以从私有PhysicsKit框架中获得类的实例,并且不能对这些类进行子类分类。
https://stackoverflow.com/questions/32018452
复制相似问题