Skip to content

Commit 6f13d11

Browse files
committed
Bower deps.
1 parent d424226 commit 6f13d11

File tree

15 files changed

+2756
-6
lines changed

15 files changed

+2756
-6
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/**
2+
*
3+
* Creator of typical test AnimationClips / KeyframeTracks
4+
*
5+
* @author Ben Houston / http://clara.io/
6+
* @author David Sarno / http://lighthaus.us/
7+
*/
8+
9+
THREE.AnimationClipCreator = function() {
10+
};
11+
12+
THREE.AnimationClipCreator.CreateRotationAnimation = function( period, axis ) {
13+
14+
var keys = [];
15+
keys.push( { time: 0, value: 0 } );
16+
keys.push( { time: period, value: 360 } );
17+
18+
axis = axis || 'x';
19+
var trackName = '.rotation[' + axis + ']';
20+
21+
var track = new THREE.NumberKeyframeTrack( trackName, keys );
22+
23+
var clip = new THREE.AnimationClip( 'rotate.x', 10, [ track ] );
24+
//console.log( 'rotateClip', clip );
25+
26+
return clip;
27+
};
28+
29+
THREE.AnimationClipCreator.CreateScaleAxisAnimation = function( period, axis ) {
30+
31+
var keys = [];
32+
keys.push( { time: 0, value: 0 } );
33+
keys.push( { time: period, value: 360 } );
34+
35+
axis = axis || 'x';
36+
var trackName = '.scale[' + axis + ']';
37+
38+
var track = new THREE.NumberKeyframeTrack( trackName, keys );
39+
40+
var clip = new THREE.AnimationClip( 'scale.x', 10, [ track ] );
41+
//console.log( 'scaleClip', clip );
42+
43+
return clip;
44+
};
45+
46+
THREE.AnimationClipCreator.CreateShakeAnimation = function( duration, shakeScale ) {
47+
48+
var keys = [];
49+
50+
for( var i = 0; i < duration * 10; i ++ ) {
51+
52+
keys.push( {
53+
time: ( i / 10.0 ),
54+
value: new THREE.Vector3( Math.random() * 2.0 - 1.0, Math.random() * 2.0 - 1.0, Math.random() * 2.0 - 1.0 ).multiply( shakeScale )
55+
} );
56+
57+
}
58+
59+
var trackName = '.position';
60+
61+
var track = new THREE.VectorKeyframeTrack( trackName, keys );
62+
63+
var clip = new THREE.AnimationClip( 'shake' + duration, duration, [ track ] );
64+
//console.log( 'shakeClip', clip );
65+
66+
return clip;
67+
};
68+
69+
70+
THREE.AnimationClipCreator.CreatePulsationAnimation = function( duration, pulseScale ) {
71+
72+
var keys = [];
73+
74+
for( var i = 0; i < duration * 10; i ++ ) {
75+
76+
var scaleFactor = Math.random() * pulseScale;
77+
keys.push( {
78+
time: ( i / 10.0 ),
79+
value: new THREE.Vector3( scaleFactor, scaleFactor, scaleFactor )
80+
} );
81+
82+
}
83+
84+
var trackName = '.scale';
85+
86+
var track = new THREE.VectorKeyframeTrack( trackName, keys );
87+
88+
var clip = new THREE.AnimationClip( 'scale' + duration, duration, [ track ] );
89+
//console.log( 'scaleClip', clip );
90+
91+
return clip;
92+
};
93+
94+
95+
THREE.AnimationClipCreator.CreateVisibilityAnimation = function( duration ) {
96+
97+
var keys = [];
98+
keys.push( {
99+
time: 0,
100+
value: true
101+
} );
102+
keys.push( {
103+
time: duration - 1,
104+
value: false
105+
} );
106+
keys.push( {
107+
time: duration,
108+
value: true
109+
} );
110+
111+
var trackName = '.visible';
112+
113+
var track = new THREE.BooleanKeyframeTrack( trackName, keys );
114+
115+
var clip = new THREE.AnimationClip( 'visible' + duration, duration, [ track ] );
116+
//console.log( 'scaleClip', clip );
117+
118+
return clip;
119+
};
120+
121+
122+
THREE.AnimationClipCreator.CreateMaterialColorAnimation = function( duration, colors, loop ) {
123+
124+
var timeStep = duration / colors.length;
125+
var keys = [];
126+
for( var i = 0; i <= colors.length; i ++ ) {
127+
keys.push( { time: i * timeStep, value: colors[ i % colors.length ] } );
128+
}
129+
130+
var trackName = '.material[0].color';
131+
132+
var track = new THREE.ColorKeyframeTrack( trackName, keys );
133+
134+
var clip = new THREE.AnimationClip( 'colorDiffuse', 10, [ track ] );
135+
//console.log( 'diffuseClip', clip );
136+
137+
return clip;
138+
};
139+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/**
2+
* @author alteredq / http://alteredqualia.com/
3+
*/
4+
5+
THREE.MorphAnimMesh = function ( geometry, material ) {
6+
7+
THREE.Mesh.call( this, geometry, material );
8+
9+
this.type = 'MorphAnimMesh';
10+
11+
this.mixer = new THREE.AnimationMixer( this );
12+
this.activeAction = null;
13+
};
14+
15+
THREE.MorphAnimMesh.prototype = Object.create( THREE.Mesh.prototype );
16+
THREE.MorphAnimMesh.prototype.constructor = THREE.MorphAnimMesh;
17+
18+
THREE.MorphAnimMesh.prototype.setDirectionForward = function () {
19+
20+
this.mixer.timeScale = 1.0;
21+
22+
};
23+
24+
THREE.MorphAnimMesh.prototype.setDirectionBackward = function () {
25+
26+
this.mixer.timeScale = -1.0;
27+
28+
};
29+
30+
THREE.MorphAnimMesh.prototype.playAnimation = function ( label, fps ) {
31+
32+
if( this.activeAction ) {
33+
34+
this.mixer.removeAction( this.activeAction );
35+
this.activeAction = null;
36+
37+
}
38+
39+
var clip = THREE.AnimationClip.findByName( this.geometry.animations, label );
40+
41+
if ( clip ) {
42+
43+
var action = new THREE.AnimationAction( clip );
44+
action.timeScale = ( clip.tracks.length * fps ) / clip.duration;
45+
this.mixer.addAction( action );
46+
this.activeAction = action;
47+
48+
} else {
49+
50+
throw new Error( 'THREE.MorphAnimMesh: animations[' + label + '] undefined in .playAnimation()' );
51+
52+
}
53+
54+
};
55+
56+
THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) {
57+
58+
this.mixer.update( delta );
59+
60+
};
61+
62+
THREE.MorphAnimMesh.prototype.copy = function ( source ) {
63+
64+
THREE.Mesh.prototype.copy.call( this, source );
65+
66+
this.mixer = new THREE.AnimationMixer( this );
67+
68+
return this;
69+
70+
};
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/**
2+
* @author mrdoob / http://mrdoob.com
3+
* @author willy-vvu / http://willy-vvu.github.io
4+
*/
5+
6+
THREE.MorphAnimation = function ( mesh ) {
7+
8+
this.mesh = mesh;
9+
this.frames = mesh.morphTargetInfluences.length;
10+
this.currentTime = 0;
11+
this.duration = 1000;
12+
this.loop = true;
13+
this.lastFrame = 0;
14+
this.currentFrame = 0;
15+
16+
this.isPlaying = false;
17+
18+
};
19+
20+
THREE.MorphAnimation.prototype = {
21+
22+
constructor: THREE.MorphAnimation,
23+
24+
play: function () {
25+
26+
this.isPlaying = true;
27+
28+
},
29+
30+
pause: function () {
31+
32+
this.isPlaying = false;
33+
34+
},
35+
36+
update: function ( delta ) {
37+
38+
if ( this.isPlaying === false ) return;
39+
40+
this.currentTime += delta;
41+
42+
if ( this.loop === true && this.currentTime > this.duration ) {
43+
44+
this.currentTime %= this.duration;
45+
46+
}
47+
48+
this.currentTime = Math.min( this.currentTime, this.duration );
49+
50+
var frameTime = this.duration / this.frames;
51+
var frame = Math.floor( this.currentTime / frameTime );
52+
53+
var influences = this.mesh.morphTargetInfluences;
54+
55+
if ( frame !== this.currentFrame ) {
56+
57+
influences[ this.lastFrame ] = 0;
58+
influences[ this.currentFrame ] = 1;
59+
influences[ frame ] = 0;
60+
61+
this.lastFrame = this.currentFrame;
62+
this.currentFrame = frame;
63+
64+
}
65+
66+
var mix = ( this.currentTime % frameTime ) / frameTime;
67+
68+
influences[ frame ] = mix;
69+
influences[ this.lastFrame ] = 1 - mix;
70+
71+
}
72+
73+
};
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* @author zz85 / http://www.lab4games.net/zz85/blog
3+
* @author alteredq / http://alteredqualia.com/
4+
*
5+
* For creating 3D text geometry in three.js
6+
*
7+
* Text = 3D Text
8+
*
9+
* parameters = {
10+
* size: <float>, // size of the text
11+
* height: <float>, // thickness to extrude text
12+
* curveSegments: <int>, // number of points on the curves
13+
*
14+
* font: <string>, // font name
15+
* weight: <string>, // font weight (normal, bold)
16+
* style: <string>, // font style (normal, italics)
17+
*
18+
* bevelEnabled: <bool>, // turn on bevel
19+
* bevelThickness: <float>, // how deep into text bevel goes
20+
* bevelSize: <float>, // how far from text outline is bevel
21+
* }
22+
*
23+
*/
24+
25+
/* Usage Examples
26+
27+
// TextGeometry wrapper
28+
29+
var text3d = new TextGeometry( text, options );
30+
31+
// Complete manner
32+
33+
var textShapes = THREE.FontUtils.generateShapes( text, options );
34+
var text3d = new ExtrudeGeometry( textShapes, options );
35+
36+
*/
37+
38+
39+
THREE.TextGeometry = function ( text, parameters ) {
40+
41+
parameters = parameters || {};
42+
43+
var textShapes = THREE.FontUtils.generateShapes( text, parameters );
44+
45+
// translate parameters to ExtrudeGeometry API
46+
47+
parameters.amount = parameters.height !== undefined ? parameters.height : 50;
48+
49+
// defaults
50+
51+
if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10;
52+
if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8;
53+
if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false;
54+
55+
THREE.ExtrudeGeometry.call( this, textShapes, parameters );
56+
57+
this.type = 'TextGeometry';
58+
59+
};
60+
61+
THREE.TextGeometry.prototype = Object.create( THREE.ExtrudeGeometry.prototype );
62+
THREE.TextGeometry.prototype.constructor = THREE.TextGeometry;

bower_components/threejs/examples/js/libs/jszip.min.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)