提交 59ff7367 编写于 作者: M Mr.doob

Trailing spaces clean up, formating and folder structure clean up.

上级 ebb30147
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
startTime, startTime,
progress = 0; progress = 0;
loader.load( './models/pump.dae', function( collada ) { loader.load( './models/collada/pump/pump.dae', function ( collada ) {
model = collada.scene; model = collada.scene;
animations = collada.animations; animations = collada.animations;
...@@ -109,9 +109,9 @@ ...@@ -109,9 +109,9 @@
// Grid // Grid
var line_material = new THREE.LineBasicMaterial( { color: 0xcccccc, opacity: 0.2 } ), var material = new THREE.LineBasicMaterial( { color: 0xcccccc, opacity: 0.2 } );
geometry = new THREE.Geometry(), var geometry = new THREE.Geometry();
floor = -0.04, step = 1, size = 14; var floor = -0.04, step = 1, size = 14;
for ( var i = 0; i <= size / step * 2; i ++ ) { for ( var i = 0; i <= size / step * 2; i ++ ) {
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
} }
var line = new THREE.Line( geometry, line_material, THREE.LinePieces ); var line = new THREE.Line( geometry, material, THREE.LinePieces );
scene.add( line ); scene.add( line );
// Add the COLLADA // Add the COLLADA
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
// Renderer // Renderer
renderer = new THREE.WebGLRenderer(); renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( window.innerWidth, window.innerHeight ); renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement ); container.appendChild( renderer.domElement );
...@@ -154,40 +154,40 @@ ...@@ -154,40 +154,40 @@
function start() { function start() {
for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { for ( var i = 0, il = kfAnimations.length; i < il; ++i ) {
var animation = kfAnimations[i]; var animation = kfAnimations[i];
for ( var h = 0, hl = animation.hierarchy.length; h < hl; h++ ) { for ( var h = 0, hl = animation.hierarchy.length; h < hl; h++ ) {
var keys = animation.data.hierarchy[ h ].keys, var keys = animation.data.hierarchy[ h ].keys,
sids = animation.data.hierarchy[ h ].sids, sids = animation.data.hierarchy[ h ].sids,
obj = animation.hierarchy[ h ]; obj = animation.hierarchy[ h ];
if ( keys.length && sids ) { if ( keys.length && sids ) {
for ( var s = 0; s < sids.length; s++ ) { for ( var s = 0; s < sids.length; s++ ) {
var sid = sids[ s ], var sid = sids[ s ],
next = animation.getNextKeyWith( sid, h, 0 ); next = animation.getNextKeyWith( sid, h, 0 );
if ( next ) { if ( next ) next.apply( sid );
next.apply( sid );
}
}
obj.matrixAutoUpdate = false; }
animation.data.hierarchy[ h ].node.updateMatrix();
obj.matrixWorldNeedsUpdate = true;
} obj.matrixAutoUpdate = false;
animation.data.hierarchy[ h ].node.updateMatrix();
obj.matrixWorldNeedsUpdate = true;
} }
animation.play( false, 0 ); }
animation.play( false, 0 );
lastTimestamp = Date.now(); lastTimestamp = Date.now();
} }
} }
function animate( timestamp ) { function animate( timestamp ) {
...@@ -196,23 +196,24 @@ ...@@ -196,23 +196,24 @@
if ( progress >= 0 && progress < 48 ) { if ( progress >= 0 && progress < 48 ) {
for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { for ( var i = 0, il = kfAnimations.length; i < il; ++i ) {
kfAnimations[ i ].update( frameTime ); kfAnimations[ i ].update( frameTime );
} }
} else if ( progress >= 48 ) { } else if ( progress >= 48 ) {
for ( var i = 0, il = kfAnimations.length; i < il; ++i ) { for ( var i = 0, il = kfAnimations.length; i < il; ++i ) {
kfAnimations[ i ].stop(); kfAnimations[ i ].stop();
} }
progress = 0; progress = 0;
start(); start();
}
}
progress += frameTime; progress += frameTime;
lastTimestamp = timestamp; lastTimestamp = timestamp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册