three-render-objects 1.28.5 → 1.28.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- // Version 1.28.5 three-render-objects - https://github.com/vasturiano/three-render-objects
1
+ // Version 1.28.6 three-render-objects - https://github.com/vasturiano/three-render-objects
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three')) :
4
4
  typeof define === 'function' && define.amd ? define(['three'], factory) :
@@ -32,7 +32,7 @@
32
32
  }
33
33
  }
34
34
 
35
- var css_248z = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
35
+ var css_248z = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
36
36
  styleInject(css_248z);
37
37
 
38
38
  function _iterableToArrayLimit$1(arr, i) {
@@ -2211,6 +2211,9 @@
2211
2211
 
2212
2212
  // API
2213
2213
 
2214
+ // Set to false to disable this control
2215
+ this.enabled = true;
2216
+
2214
2217
  this.movementSpeed = 1.0;
2215
2218
  this.rollSpeed = 0.005;
2216
2219
 
@@ -2238,7 +2241,7 @@
2238
2241
 
2239
2242
  this.keydown = function ( event ) {
2240
2243
 
2241
- if ( event.altKey ) {
2244
+ if ( event.altKey || this.enabled === false ) {
2242
2245
 
2243
2246
  return;
2244
2247
 
@@ -2276,6 +2279,8 @@
2276
2279
 
2277
2280
  this.keyup = function ( event ) {
2278
2281
 
2282
+ if ( this.enabled === false ) return;
2283
+
2279
2284
  switch ( event.code ) {
2280
2285
 
2281
2286
  case 'ShiftLeft':
@@ -2308,6 +2313,8 @@
2308
2313
 
2309
2314
  this.pointerdown = function ( event ) {
2310
2315
 
2316
+ if ( this.enabled === false ) return;
2317
+
2311
2318
  if ( this.dragToLook ) {
2312
2319
 
2313
2320
  this.status ++;
@@ -2329,6 +2336,8 @@
2329
2336
 
2330
2337
  this.pointermove = function ( event ) {
2331
2338
 
2339
+ if ( this.enabled === false ) return;
2340
+
2332
2341
  if ( ! this.dragToLook || this.status > 0 ) {
2333
2342
 
2334
2343
  const container = this.getContainerDimensions();
@@ -2346,6 +2355,8 @@
2346
2355
 
2347
2356
  this.pointerup = function ( event ) {
2348
2357
 
2358
+ if ( this.enabled === false ) return;
2359
+
2349
2360
  if ( this.dragToLook ) {
2350
2361
 
2351
2362
  this.status --;
@@ -2369,8 +2380,18 @@
2369
2380
 
2370
2381
  };
2371
2382
 
2383
+ this.contextMenu = function ( event ) {
2384
+
2385
+ if ( this.enabled === false ) return;
2386
+
2387
+ event.preventDefault();
2388
+
2389
+ };
2390
+
2372
2391
  this.update = function ( delta ) {
2373
2392
 
2393
+ if ( this.enabled === false ) return;
2394
+
2374
2395
  const moveMult = delta * scope.movementSpeed;
2375
2396
  const rotMult = delta * scope.rollSpeed;
2376
2397
 
@@ -2438,7 +2459,7 @@
2438
2459
 
2439
2460
  this.dispose = function () {
2440
2461
 
2441
- this.domElement.removeEventListener( 'contextmenu', contextmenu );
2462
+ this.domElement.removeEventListener( 'contextmenu', _contextmenu );
2442
2463
  this.domElement.removeEventListener( 'pointerdown', _pointerdown );
2443
2464
  this.domElement.removeEventListener( 'pointermove', _pointermove );
2444
2465
  this.domElement.removeEventListener( 'pointerup', _pointerup );
@@ -2448,13 +2469,14 @@
2448
2469
 
2449
2470
  };
2450
2471
 
2472
+ const _contextmenu = this.contextMenu.bind( this );
2451
2473
  const _pointermove = this.pointermove.bind( this );
2452
2474
  const _pointerdown = this.pointerdown.bind( this );
2453
2475
  const _pointerup = this.pointerup.bind( this );
2454
2476
  const _keydown = this.keydown.bind( this );
2455
2477
  const _keyup = this.keyup.bind( this );
2456
2478
 
2457
- this.domElement.addEventListener( 'contextmenu', contextmenu );
2479
+ this.domElement.addEventListener( 'contextmenu', _contextmenu );
2458
2480
  this.domElement.addEventListener( 'pointerdown', _pointerdown );
2459
2481
  this.domElement.addEventListener( 'pointermove', _pointermove );
2460
2482
  this.domElement.addEventListener( 'pointerup', _pointerup );
@@ -2469,12 +2491,6 @@
2469
2491
 
2470
2492
  }
2471
2493
 
2472
- function contextmenu( event ) {
2473
-
2474
- event.preventDefault();
2475
-
2476
- }
2477
-
2478
2494
  /**
2479
2495
  * Full-screen textured quad shader
2480
2496
  */
@@ -2511,8 +2527,8 @@
2511
2527
 
2512
2528
  void main() {
2513
2529
 
2514
- gl_FragColor = texture2D( tDiffuse, vUv );
2515
- gl_FragColor.a *= opacity;
2530
+ vec4 texel = texture2D( tDiffuse, vUv );
2531
+ gl_FragColor = opacity * texel;
2516
2532
 
2517
2533
 
2518
2534
  }`
@@ -2799,6 +2815,7 @@
2799
2815
  this.passes = [];
2800
2816
 
2801
2817
  this.copyPass = new ShaderPass( CopyShader );
2818
+ this.copyPass.material.blending = three$1.NoBlending;
2802
2819
 
2803
2820
  this.clock = new three$1.Clock();
2804
2821