// 1. remember position of presentation node
var position = node.presentation.position;
// 2. do some changes on node, physics body, whatever
// 3. restore position (without losing original node position)
your_node.presentation.position = position
// ... or apply presentation position to original position
your_node.position = position
1 回答
当物理影响节点位置时,其原始位置(分配给节点
position
属性)保持不变,演示节点位置会更改。所有转换(rotation/scale/translate)都以这种方式工作。所以你可以做一些像这样的伪代码: