MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / transform

Function transform

public/iframe/lib/js/mixinsThree.js:55–83  ·  view source on GitHub ↗
(targets, duration)

Source from the content-addressed store, hash-verified

53 },
54 methods: {
55 transform (targets, duration) {
56 const objLength = this.objects.length;
57 // this.nowStatus = status
58 TWEEN.removeAll();
59 for (let i = 0; i < objLength; ++i) {
60
61 const object = this.objects[i];
62 const target = targets[i];
63 new TWEEN.Tween(object.position)
64 .to({ x: target.position.x, y: target.position.y, z: target.position.z },
65 Math.random() * duration + duration)
66 .easing(TWEEN.Easing.Exponential.InOut)
67 .start();
68
69
70 new TWEEN.Tween(object.rotation)
71 .to({ x: target.rotation.x, y: target.rotation.y, z: target.rotation.z }, Math.random() * duration + duration)
72 .easing(TWEEN.Easing.Exponential.InOut)
73 .start();
74
75 }
76
77 // 这个补间用来在位置与旋转补间同步执行,通过onUpdate在每次更新数据后渲染scene和camera
78 new TWEEN.Tween({})
79 .to({}, duration * 2)
80 .onUpdate(this.render)
81 .start();
82
83 },
84 onWindowResize () {
85 const { camera, renderer } = this
86 const height = document.getElementById(this.id).clientHeight;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected