用户:
小屑鹿查看:1 回复:4 评论:1 创建时间:2023-01-19T16:59:58
async function ani(idname, ix, iy, iz, id){
world.querySelectorAll('*').forEach(async(e)=>{
if (e.id == (idname)){
e.collides = true;
e.fixed = true;
let s_l = `${ix},${iy},${iz},${id}`;let [x, y, z, d] = s_l.split(',').map(e => Number(e))
x /= d;y /= d;z /= d;d *= 9;
e.animate([
{ velocity: [-x, -y, -z].map(e => e), easeIn: Box3Easing.LINEAR, easeOut: Box3Easing.LINEAR, },
{ velocity: [x, y, z].map(e => e), easeIn: Box3Easing.LINEAR, easeOut: Box3Easing.LINEAR, },
], {
duration : d,
iterations: Infinity,
direction: Box3AnimationDirection.WRAP_REVERSE,
iterationStart: 0,
});
};
});
};