Aframe A轮上的帧动画组件错误(我已禁用)
我很确定这在Aframe的早期版本中是有效的,但不能确定。但是,当我尝试在组件上设置位置动画时,出现了一个奇怪的错误:Aframe A轮上的帧动画组件错误(我已禁用),aframe,Aframe,我很确定这在Aframe的早期版本中是有效的,但不能确定。但是,当我尝试在组件上设置位置动画时,出现了一个奇怪的错误: const positionAnimation = { property: 'position', from: this._threeElement.position, to: (reversed) ? this._initialPosition : this._targetPosition, dur:
const positionAnimation = {
property: 'position',
from: this._threeElement.position,
to: (reversed) ? this._initialPosition : this._targetPosition,
dur: 2000,
round: false,
easing: 'easeInOutCubic',
startEvents: ['---non-existent-event---'], //Avoid auto-play of the animation
}
//Set the animation on the element
this.el.setAttribute('animation__position', positionAnimation)
它似乎与position属性有关(如果我删除此项,则不会出现错误,但不会设置动画)
这是动画组件V4.2.0和帧0.8.2
编辑-这在框架0.5中确实有效
看看这把小提琴
这是预期的工作,但如果我升级一个帧,我会得到前面提到的错误
我已尝试使用frame.utils.clone来克隆向量,但这会产生不希望的结果。何时以及如何设置initialPosition、targetPosition、threeElement?看起来你是在设置了动画组件之后才这么做的,因为它似乎在工作——它们是在以前的函数中设置的,但是它们都在那里——我可以控制台记录它们。无论如何,他们现在是0。
Uncaught TypeError: Cannot read property 'x' of undefined
at round (aframe-master.js:8445)
at I (anime.min.js:13)
at ba (anime.min.js:18)
at anime.min.js:19
at Array.map (<anonymous>)
at da (anime.min.js:19)
at anime.min.js:20
at Array.map (<anonymous>)
at anime.min.js:20
at Array.map (<anonymous>)
at ea (anime.min.js:20)
at fa (anime.min.js:21)
at q (anime.min.js:24)
at NewComponent.createAndStartAnimation (index.js:164)
at NewComponent.update (index.js:122)
at NewComponent.updateProperties (aframe-master.js:72452)
at NewComponent.module.exports.Component (aframe-master.js:72222)
at new NewComponent (aframe-master.js:72646)
at HTMLElement.value (aframe-master.js:71059)
at HTMLElement.value (aframe-master.js:71215)
at HTMLElement.value (aframe-master.js:71386)
at NewComponent.tweenHotspotToCamera (zoom-front-camera.js:127)
from:Vector3
x:8.743012486033315
y:1.7184335476624883
z:-5.017845407952605
__proto__
:
Object
property
:
"position"
startEvents
:
["---non-existent-event---"]
to
:
Vector3
x:8.26445236188911
y:0.33004119004908694
z:-11.007824476509064