Advertisement
yskang

threejs-minecraft-20

Apr 21st, 2020
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bodyAnimate() {
  2.     if( !this.bodyScaling ) return;
  3.  
  4.     this.scaleHeadOffset += 0.04;
  5.  
  6.     const scaleRate = Math.abs( Math.sin( this.scaleHeadOffset ) ) / 16 + 1;
  7.     this.scale.set( scaleRate, scaleRate, scaleRate );
  8. }
  9.  
  10. toggleAnimate() {
  11.     this.headSwinging = !this.headSwinging;
  12.     this.bodyScaling = !this.bodyScaling;
  13.     this.walking = !this.walking;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement