ARKit概念解析一: position vs worldPosition vs simdPosition

本文解释了ARKit中position、worldPosition和simdPosition的区别。position指节点相对于其父节点的位置;worldPosition则是相对于场景中世界中心的位置;simdPosition与position相同,但在simd相关的函数中提供更好的性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

position是节点相对于其父节点的位置。如果节点是rootNode的子节点,则该位置与worldPosition相同。如果节点是不在0,0,0和/或旋转的父节点的子节点,则位置将是父节点的偏移量,worldPosition将是子节点在场景中的实际位置。

The position is the position of a node relative to its parent node. If the node is a child of the rootNode, the position is the same as the worldPosition. If the node is a child of a parent that is not at 0,0,0 and/or rotated, the position will be the offset from the parentnode, and the worldPosition will be the child node’s actual position in the scene.

worldPosition是场景中相对于世界中心(0,0,0)的位置,这是场景的根节点所在的位置。

The worldPosition is the position in the scene, relative to the center of the world (0,0,0), which is where the rootNode of the scene is.

simdPositionposition相同,但是在simd相关函数可以使用的类型中,这提供了更好的性能,特别是如果你进行了大量的矢量数学运算。如果你确实使用了simdPosition,请记住你也应该使用任何矩阵的simd等价物并将它与其他向量相乘。

The simdPosition is the same as the position but in a type that can be used by simd related functions, which offer better performance especially if you do a lot of vector math. If you do use simdPosition keep in mind you also should use the simd equivalent of any matrices and other vectors you multiply it with.

参考链接: https://stackoverflow.com/questions/46375201/arkit-position-vs-worldposition-vs-simdposition

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值