我正在尝试编写一个 AFrame 组件来检查对象的旋转。但是,我不确定如何编写 if 语句进行检查。
我已经知道旋转属性返回一个集合中的 x,y,z。但是我不确定如何检查它。
var rotation = document.querySelector('#checkItem').getAttribute('rotation');
if (rotation === {x: 0, y: 90, z: 00}) {
document.querySelector('#key').setAttribute('visible');
}