|
@@ -28,7 +28,7 @@
|
|
|
</head>
|
|
|
<body>
|
|
|
<div id="info">
|
|
|
- <a href="http://threejs.org" target="_blank">three.js</a> - model by <a href="https://github.com/sunag/sea3d" style="color:#FFFFF" target="_blank">sea3d</a>
|
|
|
+ <a href="http://threejs.org" target="_blank">three.js</a> - asset by <a href="https://github.com/sunag/sea3d" style="color:#FFFFF" target="_blank">sea3d</a>
|
|
|
<div id="description">Click to play</div>
|
|
|
</div>
|
|
|
|
|
@@ -44,9 +44,6 @@
|
|
|
<script src="js/shaders/ColorCorrectionShader.js"></script>
|
|
|
<script src="js/shaders/VignetteShader.js"></script>
|
|
|
|
|
|
- <script src="js/MorphAnimMesh.js"></script>
|
|
|
- <script src="js/loaders/collada/Animation.js"></script>
|
|
|
-
|
|
|
<script src="js/loaders/sea3d/SEA3D.js"></script>
|
|
|
<script src="js/loaders/sea3d/SEA3DLZMA.js"></script>
|
|
|
<script src="js/loaders/sea3d/SEA3DLoader.js"></script>
|
|
@@ -90,9 +87,6 @@
|
|
|
|
|
|
controls = new THREE.OrbitControls( camera );
|
|
|
|
|
|
- // reset global animation time
|
|
|
- SEA3D.AnimationHandler.setTime( 0 );
|
|
|
-
|
|
|
// events
|
|
|
|
|
|
window.addEventListener('click', onMouseClick, false);
|
|
@@ -107,35 +101,38 @@
|
|
|
// Animation Functions
|
|
|
//
|
|
|
|
|
|
- function playAll(name, crossfade, offset) {
|
|
|
-
|
|
|
- // reset global time
|
|
|
- SEA3D.AnimationHandler.setTime( 0 );
|
|
|
+ function playAll(id, crossfade, offset) {
|
|
|
|
|
|
// play all animations
|
|
|
+
|
|
|
for(var i = 0; i < loader.meshes.length; i++) {
|
|
|
+
|
|
|
if (loader.meshes[i].animation)
|
|
|
- loader.meshes[i].animation.play(name, crossfade, offset);
|
|
|
+ loader.meshes[i].animation.play(id, crossfade, offset);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function setTimeScale( timeScale ) {
|
|
|
|
|
|
- // set in all active animations
|
|
|
- for(var i in SEA3D.AnimationHandler.animations) {
|
|
|
- SEA3D.AnimationHandler.animations[i].timeScale = timeScale;
|
|
|
+ for(var i = 0; i < loader.meshes.length; i++) {
|
|
|
+
|
|
|
+ if (loader.meshes[i].animation)
|
|
|
+ loader.meshes[i].animation.setTimeScale( timeScale );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function stopAll() {
|
|
|
|
|
|
- // reset global time
|
|
|
- SEA3D.AnimationHandler.setTime( 0 );
|
|
|
+ for(var i = 0; i < loader.meshes.length; i++) {
|
|
|
|
|
|
- // stop all active animations
|
|
|
- SEA3D.AnimationHandler.stop();
|
|
|
+ if (loader.meshes[i].animation)
|
|
|
+ loader.meshes[i].animation.stop();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -182,10 +179,6 @@
|
|
|
composer.addPass( copyPass );
|
|
|
copyPass.renderToScreen = true;
|
|
|
|
|
|
- // extra lights
|
|
|
-
|
|
|
- scene.add( new THREE.AmbientLight( 0x333333 ) );
|
|
|
-
|
|
|
// events
|
|
|
|
|
|
window.addEventListener( 'resize', onWindowResize, false );
|
|
@@ -246,18 +239,15 @@
|
|
|
|
|
|
var fracture99 = loader.getMesh("Object099");
|
|
|
|
|
|
- //fracture99.animation.time = 0;
|
|
|
- //fracture99.animation.timeScale = 1;
|
|
|
+ //fracture99.animation.setTimeScale( 1 );
|
|
|
//fracture99.animation.playing
|
|
|
- //fracture99.animation.states ...
|
|
|
- //fracture99.animation.currentState ...
|
|
|
-
|
|
|
- //fracture99.animation.node ...
|
|
|
- //fracture99.animation.node.duration
|
|
|
+ //fracture99.animation.currentAnimation
|
|
|
+ //fracture99.animation.previousAnimation
|
|
|
|
|
|
fracture99.animation.play("crash#2", .5, 0);
|
|
|
- //fracture99.animation.pause();
|
|
|
//fracture99.animation.stop();
|
|
|
+ //fracture99.animation.pause();
|
|
|
+ //fracture99.animation.resume();
|
|
|
|
|
|
description("crash#2 in single object - crossfade 0.5 seconds");
|
|
|
|