methods: {
setCameraPostion: (()=>{ let _eye = new Vector3(); let eyeDirection = new Vector3(); let target = new Vector3(); let distance, newDistance; return function setCameraPostion(args) {
_eye.copy(args.pos).sub(target);
eyeDirection.copy(_eye).normalize();
distance = _eye.length();
newDistance = ...(有点长,略过);
eyeDirection.setLength(newDistance).add(target); return eyeDirection;
}
})(),
}以上写法是可以执行的,我想问得是这种写法是否可取?需不需要优化?个人感觉这种辅助变量写在data里很别扭...强迫症了快但缺点是无法使用this——不知道怎么用谢谢
添加回答
举报
0/150
提交
取消