6b2cb7b7aec20ba22fb1f0fde47c4a7dbdda76a9
4 0: { tween
: { transform
: { yaw
: Math
.PI
} },
6 10: { tween
: { quad
: { alpha
: 0 } },
11 0: { tween1
: { scale
: [0.6, 0.3, 1.0] }, duration
: 20 },
12 20: [{ tween1
: { scale
: [0.3, 0.6, 1.0] }, duration
: 18 },
13 { tween1
: { xy
: 'target' }, duration
: 20 }],
14 38: { tween1
: { scale
: [0.5, 0.5, 1.0] }, duration
: 5 },
17 var FollowScene
= yT(yuu
.Scene
, {
18 constructor: function () {
20 var textMat
= new yuu
.Material("@text");
21 var faceMat
= new yuu
.Material("@face");
24 var textEntity
= new yuu
.E(
25 new yuu
.Transform().setScale([1, 1, 1]),
26 textQuad
= new yuu
.QuadC(textMat
));
27 this.faceEntity
= new yuu
.E(
28 new yuu
.Transform().setScale([0.5, 0.5, 1]),
29 new yuu
.QuadC(faceMat
));
30 this.entity0
.addChild(textEntity
);
31 this.entity0
.addChild(this.faceEntity
);
33 this.disappear = function () {
34 textEntity
.attach(new yuu
.Animation(DISAPPEAR
, {
35 transform
: textEntity
.transform
,
40 this.ready
= yuu
.ready([textMat
, faceMat
], this);
45 var base
= new yuu
.AABB(-1.5, -1.5, 1.5, 1.5);
46 var vp
= base
.matchAspectRatio(yuu
.viewport
);
47 this.layer0
.resize(vp
.x0
, vp
.y0
, vp
.w
, vp
.h
);
50 mousemove: function (p
) {
51 p
= this.layer0
.worldFromDevice(p
);
52 var d
= 0.75 * (p
.x
- this.faceEntity
.transform
.x
);
53 var angle
= Math
.PI
/ 2 * d
;
56 angle
= yf
.clamp(angle
, -Math
.PI
/ 2, Math
.PI
/ 2);
57 this.faceEntity
.transform
.roll
= angle
+ Math
.PI
/ 2;
60 touch: function (p
) { this.inputs
.mousemove
.call(this, p
); },
64 this.disappear
= yf
.I
;
65 p
= this.layer0
.worldFromDevice(p
);
66 this.faceEntity
.attach(new yuu
.Animation(JUMP
, {
67 $: this.faceEntity
.transform
,
75 yuu
.director
.pushScene(new FollowScene());
78 window
.addEventListener("load", function() {
79 yuu
.registerInitHook(load
);
80 yuu
.init({ backgroundColor
: [1, 1, 1, 0] })
81 .then(function () { yuu
.director
.start(); });