【发布时间】:2015-10-21 13:40:57
【问题描述】:
我正在一个盒子上运行物理模拟。当节点停止时,我改变它的位置,设置它的旋转并施加力。所有这 3 个参数总是相同,但物理模拟不同。差异不大,但肯定很明显。如何避免这种情况并每次都重现完全相同的物理模拟?感谢帮助
/// this code gets executed repeatedly
starNode.physicsBody?.velocity = SCNVector3Zero
applyForce() ///always the same
starNode.eulerAngles = SCNVector3Make(0, Float(90*(M_PI)/180.0), 0)
starNode.position = SCNVector3Make(-0.562, 5.578, -18.529)
【问题讨论】:
-
你能用 3 个不同的节点(startNode1、startNode2、startNode3)试试吗?另外,我认为 applyForce 函数调用需要在最后。
标签: ios game-physics scenekit