|
211 | 211 | object.material.roughness = 0.2;
|
212 | 212 | object.material.color.set( 1, 1, 1 );
|
213 | 213 | object.material.metalnessMap = object.material.map;
|
214 |
| - |
| 214 | + |
215 | 215 | } else {
|
216 | 216 |
|
217 | 217 | object.material.metalness = 1;
|
218 | 218 | object.material.roughness = 0;
|
219 | 219 | object.material.transparent = true;
|
220 | 220 | object.material.opacity = 0.8;
|
221 | 221 | object.material.color.set( 1, 1, 1 );
|
222 |
| - |
| 222 | + |
223 | 223 | }
|
224 |
| - |
| 224 | + |
225 | 225 | }
|
226 | 226 |
|
227 | 227 | } );
|
|
253 | 253 | actions[ m ].enabled = true;
|
254 | 254 | actions[ m ].setEffectiveTimeScale( 1 );
|
255 | 255 | if ( m !== 'Idle' ) actions[ m ].setEffectiveWeight( 0 );
|
256 |
| - |
| 256 | + |
257 | 257 | }
|
258 | 258 |
|
259 | 259 | actions.Idle.play();
|
|
272 | 272 | const ease = controls.ease;
|
273 | 273 | const rotate = controls.rotate;
|
274 | 274 | const position = controls.position;
|
275 |
| - const azimut = orbitControls.getAzimuthalAngle(); |
| 275 | + const azimuth = orbitControls.getAzimuthalAngle(); |
276 | 276 |
|
277 | 277 | const active = key[ 0 ] === 0 && key[ 1 ] === 0 ? false : true;
|
278 | 278 | const play = active ? ( key[ 2 ] ? 'Run' : 'Walk' ) : 'Idle';
|
|
293 | 293 | current.weight = 1.0;
|
294 | 294 | current.stopFading();
|
295 | 295 | old.stopFading();
|
296 |
| - // sycro if not idle |
| 296 | + // synchro if not idle |
297 | 297 | if ( play !== 'Idle' ) current.time = old.time * ( current.getClip().duration / old.getClip().duration );
|
298 | 298 | old._scheduleFading( fade, old.getEffectiveWeight(), 0 );
|
299 | 299 | current._scheduleFading( fade, current.getEffectiveWeight(), 1 );
|
|
320 | 320 | ease.set( key[ 1 ], 0, key[ 0 ] ).multiplyScalar( velocity * delta );
|
321 | 321 |
|
322 | 322 | // calculate camera direction
|
323 |
| - const angle = unwrapRad( Math.atan2( ease.x, ease.z ) + azimut ); |
| 323 | + const angle = unwrapRad( Math.atan2( ease.x, ease.z ) + azimuth ); |
324 | 324 | rotate.setFromAxisAngle( up, angle );
|
325 | 325 |
|
326 | 326 | // apply camera angle on ease
|
327 |
| - controls.ease.applyAxisAngle( up, azimut ); |
| 327 | + controls.ease.applyAxisAngle( up, azimuth ); |
328 | 328 |
|
329 | 329 | position.add( ease );
|
330 | 330 | camera.position.add( ease );
|
|
335 | 335 | orbitControls.target.copy( position ).add( { x: 0, y: 1, z: 0 } );
|
336 | 336 | followGroup.position.copy( position );
|
337 | 337 |
|
338 |
| - // decale floor at infinie |
| 338 | + // Move the floor without any limit |
339 | 339 | const dx = ( position.x - floor.position.x );
|
340 | 340 | const dz = ( position.z - floor.position.z );
|
341 | 341 | if ( Math.abs( dx ) > controls.floorDecale ) floor.position.x += dx;
|
|
344 | 344 | }
|
345 | 345 |
|
346 | 346 | if ( mixer ) mixer.update( delta );
|
347 |
| - |
| 347 | + |
348 | 348 | orbitControls.update();
|
349 | 349 |
|
350 | 350 | }
|
351 | 351 |
|
352 | 352 | function unwrapRad( r ) {
|
353 | 353 |
|
354 | 354 | return Math.atan2( Math.sin( r ), Math.cos( r ) );
|
355 |
| - |
| 355 | + |
356 | 356 | }
|
357 | 357 |
|
358 | 358 | function createPanel() {
|
|
364 | 364 | skeleton.visible = b;
|
365 | 365 |
|
366 | 366 | } );
|
367 |
| - |
| 367 | + |
368 | 368 | panel.add( settings, 'fixe_transition' );
|
369 | 369 |
|
370 | 370 | }
|
|
387 | 387 | case 'ArrowLeft': case 'KeyA': case 'KeyQ': key[ 1 ] = - 1; break;
|
388 | 388 | case 'ArrowRight': case 'KeyD': key[ 1 ] = 1; break;
|
389 | 389 | case 'ShiftLeft' : case 'ShiftRight' : key[ 2 ] = 1; break;
|
390 |
| - |
| 390 | + |
391 | 391 | }
|
392 | 392 |
|
393 | 393 | }
|
|
402 | 402 | case 'ArrowLeft': case 'KeyA': case 'KeyQ': key[ 1 ] = key[ 1 ] < 0 ? 0 : key[ 1 ]; break;
|
403 | 403 | case 'ArrowRight': case 'KeyD': key[ 1 ] = key[ 1 ] > 0 ? 0 : key[ 1 ]; break;
|
404 | 404 | case 'ShiftLeft' : case 'ShiftRight' : key[ 2 ] = 0; break;
|
405 |
| - |
| 405 | + |
406 | 406 | }
|
407 | 407 |
|
408 | 408 | }
|
|
0 commit comments