ARKit:位置 vs 世界位置 vs simdposition [英] ARKit: position vs worldposition vs simdposition

查看:29
本文介绍了ARKit:位置 vs 世界位置 vs simdposition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请用非常简单的语言解释上述 3 个位置之间的区别.我想知道什么时候使用一种和另一种.

please in very simple language explain the difference between the 3 aforementioned position. I would like to know when to use one versus another.

推荐答案

worldPosition 是场景中的位置,相对于世界中心 (0,0,0),也就是场景的 rootNode 所在的位置.

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.

位置是节点相对于其父节点的位置.如果节点是 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.

simdPosition 与位置相同,但类型可以被 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.

这篇关于ARKit:位置 vs 世界位置 vs simdposition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆