Initial Commit: CC - Moorcow Start Scene, rotate ball (ds7xhwnsao.js)

beta.r3js.org
-=yb4f310 2017-11-23 09:43:40 +01:00
parent ffb8a5f693
commit 4fee0752e4
1 changed files with 38 additions and 0 deletions

38
ds7xhwnsao.js Normal file
View File

@ -0,0 +1,38 @@
this.topBall = GameLib.EntityManager.Instance.findComponentById('gh1x1h7rot');
this.bottomBall = GameLib.EntityManager.Instance.findComponentById('796eyo44j8');
this.text0 = GameLib.EntityManager.Instance.findComponentById('hzr8jx7485');
this.text1 = GameLib.EntityManager.Instance.findComponentById('rlx2sebygk');
if (!this.initialized) {
this.initialized = true;
this.time = 0;
}
this.time += data.delta;
if (this.text1) {
this.text0.scale.x = 0.08 + Math.sin(2 * this.time) * 0.01;
this.text0.scale.y = 0.08 + Math.sin(2 * this.time) * 0.01;
this.text0.scale.z = 0.08 + Math.sin(2 * this.time) * 0.01;
this.text0.updateInstance('scale');
this.text1.scale.x = 0.09 + Math.cos(2 * this.time) * 0.01;
this.text1.scale.y = 0.09 + Math.cos(2 * this.time) * 0.01;
this.text1.scale.z = 0.09 + Math.cos(2 * this.time) * 0.01;
this.text1.updateInstance('scale');
}
if (this.topBall) {
this.topBall.rotation.y = Math.sin(this.time);
this.topBall.updateInstance('rotation');
}
if (this.bottomBall) {
this.bottomBall.rotation.y = Math.cos(this.time);
this.bottomBall.updateInstance('rotation');
}
//@ sourceURL=CustomCode (ds7xhwnsao).js