@awayjs/scene 0.13.284 → 0.13.286

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.284');
1
+ console.debug('AwayJS - Scene - 0.13.286');
2
2
  export { Timeline } from './lib/base/Timeline';
3
3
  export { ControllerBase } from './lib/controllers/ControllerBase';
4
4
  export { FirstPersonController } from './lib/controllers/FirstPersonController';
@@ -17,19 +17,12 @@ export declare class SceneImage2D extends BitmapImage2D {
17
17
  private static _rootNode;
18
18
  private static _billboardRoot;
19
19
  private static _billboard;
20
- private _imageDataDirty;
21
- private _asyncRead;
22
- private _initalFillColor;
23
- private _lastUsedFill;
24
- private _internalSync;
25
20
  protected _msaaNeedDrop: boolean;
26
21
  protected _enforceMSAASupport: boolean;
27
22
  protected _dropMSAA(): void;
28
23
  get canUseMSAAInternaly(): boolean;
29
24
  _antialiasQuality: number;
30
25
  get antialiasQuality(): number;
31
- protected syncData(async?: boolean): boolean | Promise<boolean>;
32
- getDataInternal(constructEmpty?: boolean, skipSync?: boolean): Uint8ClampedArray;
33
26
  /**
34
27
  *
35
28
  * @returns {string}
@@ -88,16 +81,6 @@ export declare class SceneImage2D extends BitmapImage2D {
88
81
  dispose(): void;
89
82
  unload(): void;
90
83
  protected deepClone(from: BitmapImage2D): void;
91
- /**
92
- * Fills a rectangular area of pixels with a specified ARGB color.
93
- *
94
- * @param rect The rectangular area to fill.
95
- * @param color The ARGB color value that fills the area. ARGB colors are
96
- * often specified in hexadecimal format; for example,
97
- * 0xFF336699.
98
- * @throws TypeError The rect is null.
99
- */
100
- fillRect(rect: Rectangle, color: number): void;
101
84
  /**
102
85
  * Provides a fast routine to perform pixel manipulation between images with
103
86
  * no stretching, rotation, or color effects. This method copies a
@@ -1 +1 @@
1
- {"version":3,"file":"SceneImage2D.d.ts","sourceRoot":"","sources":["../../../lib/image/SceneImage2D.ts"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S,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB;IAS3D,OAAO,CAAC,iBAAiB,CAAS;IAC3B,KAAK;IA0BZ;;OAEG;IACI,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAM/C;;OAEG;IACI,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAM7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuEG;IAGI,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO;IAC3I,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO;IAmBlJ,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiBrC,OAAO,CAAC,aAAa;IAgFrB,OAAO,CAAC,cAAc;IA0If,KAAK;IAEL,KAAK,IAAI,YAAY;CAc5B"}
@@ -5,7 +5,7 @@ import { DisplayObjectContainer } from '../display/DisplayObjectContainer';
5
5
  import { DisplayObject } from '../display/DisplayObject';
6
6
  import { Billboard } from '../display/Billboard';
7
7
  import { Settings } from '../Settings';
8
- import { Rectangle, Point, PerspectiveProjection, CoordinateSystem, Vector3D, Transform, ColorUtils } from '@awayjs/core';
8
+ import { Rectangle, Point, PerspectiveProjection, CoordinateSystem, Vector3D, Transform } from '@awayjs/core';
9
9
  import { Stage, BitmapImage2D, _Stage_BitmapImage2D, BlendMode } from '@awayjs/stage';
10
10
  import { DefaultRenderer, RenderGroup, Style } from '@awayjs/renderer';
11
11
  // empty matrix for transform reset
@@ -49,15 +49,10 @@ var SceneImage2D = /** @class */ (function (_super) {
49
49
  if (powerOfTwo === void 0) { powerOfTwo = true; }
50
50
  if (stage === void 0) { stage = null; }
51
51
  var _this = _super.call(this, width, height, transparent, null, powerOfTwo, stage) || this;
52
- _this._initalFillColor = null;
53
- _this._lastUsedFill = null;
54
- _this._internalSync = false;
55
52
  _this._msaaNeedDrop = false;
56
53
  _this._enforceMSAASupport = false;
57
54
  /*private*/ _this._antialiasQuality = Settings.ALLOW_FORCE_MSAA;
58
55
  _this._clearFromDispose = false;
59
- _this._initalFillColor = fillColor;
60
- _this._lastUsedFill = fillColor;
61
56
  return _this;
62
57
  }
63
58
  SceneImage2D.getImage = function (width, height, transparent, fillColor, powerOfTwo, stage, msaa) {
@@ -124,70 +119,6 @@ var SceneImage2D = /** @class */ (function (_super) {
124
119
  enumerable: false,
125
120
  configurable: true
126
121
  });
127
- SceneImage2D.prototype.syncData = function (async) {
128
- var _this = this;
129
- if (async === void 0) { async = false; }
130
- if (async && this._asyncRead) {
131
- return this._asyncRead;
132
- }
133
- if (!async && this._asyncRead) {
134
- throw '[SceneImage2D] Synced read not allowed while async read is requested!';
135
- }
136
- this.applySymbol();
137
- // update data from pixels from GPU
138
- if (!this._imageDataDirty) {
139
- return async ? Promise.resolve(false) : false;
140
- }
141
- var context = this._stage.context;
142
- this._stage.setRenderTarget(this, false);
143
- // when we call syncData, we already loose other data
144
- // not require apply symbol etc, because it already should be applied
145
- if (!this._data) {
146
- this._data = new Uint8ClampedArray(this.width * this.height * 4);
147
- }
148
- // mark that this internal call, avoid reqursion loop
149
- this._internalSync = true;
150
- this._asyncRead = context.drawToBitmapImage2D(this, false, async);
151
- this._internalSync = false;
152
- this._stage.setRenderTarget(null);
153
- if (!async) {
154
- this._imageDataDirty = false;
155
- // we store pixel buffer already as PMA.
156
- // we should prevent unpack what already is PMA
157
- this._unpackPMA = false;
158
- return true;
159
- }
160
- return this._asyncRead.then(function (_status) {
161
- _this._imageDataDirty = false;
162
- _this._unpackPMA = false;
163
- _this._asyncRead = null;
164
- return true;
165
- });
166
- };
167
- /* overide internal */ SceneImage2D.prototype.getDataInternal = function (constructEmpty, skipSync) {
168
- if (constructEmpty === void 0) { constructEmpty = true; }
169
- if (skipSync === void 0) { skipSync = false; }
170
- // if sync called, check that this is requried
171
- if (!skipSync && this._imageDataDirty && !this._internalSync) {
172
- // sync data already should fill _data
173
- this.syncData(false);
174
- return this._data;
175
- }
176
- if (this._initalFillColor === null) {
177
- return _super.prototype.getDataInternal.call(this, constructEmpty, true);
178
- }
179
- // disable empty buffer filling
180
- // and check that buffer is empyt (has now symbol or alpha)
181
- var data = _super.prototype.getDataInternal.call(this, false, true);
182
- // if it empty, fill with initlal value
183
- if (!data) {
184
- // fill rect constuct buffer inside
185
- _super.prototype.fillRect.call(this, this.rect, this._initalFillColor);
186
- this._initalFillColor = null;
187
- return this._data;
188
- }
189
- return data;
190
- };
191
122
  Object.defineProperty(SceneImage2D.prototype, "assetType", {
192
123
  /**
193
124
  *
@@ -299,28 +230,6 @@ var SceneImage2D = /** @class */ (function (_super) {
299
230
  SceneImage2D.prototype.deepClone = function (from) {
300
231
  this.copyPixels(from, this._rect, new Point(0, 0));
301
232
  };
302
- /**
303
- * Fills a rectangular area of pixels with a specified ARGB color.
304
- *
305
- * @param rect The rectangular area to fill.
306
- * @param color The ARGB color value that fills the area. ARGB colors are
307
- * often specified in hexadecimal format; for example,
308
- * 0xFF336699.
309
- * @throws TypeError The rect is null.
310
- */
311
- SceneImage2D.prototype.fillRect = function (rect, color) {
312
- this.dropAllReferences();
313
- var argb = ColorUtils.float32ColorToARGB(color);
314
- var alpha = this._transparent ? argb[0] / 255 : 1;
315
- var isCrop = rect !== this._rect && !this._rect.equals(rect);
316
- this._stage.setRenderTarget(this, true, 0, 0, true);
317
- this._stage.setScissor(rect);
318
- // we shure that color is fully filled when there are not any crops
319
- this._lastUsedFill = isCrop ? null : color;
320
- this._stage.clear((argb[1] / 0xff) * alpha, (argb[2] / 0xff) * alpha, (argb[3] / 0xff) * alpha, alpha);
321
- this._stage.setScissor(null);
322
- this._imageDataDirty = true;
323
- };
324
233
  /**
325
234
  * Provides a fast routine to perform pixel manipulation between images with
326
235
  * no stretching, rotation, or color effects. This method copies a
@@ -1 +1 @@
1
- {"version":3,"file":"MouseManager.d.ts","sourceRoot":"","sources":["../../../lib/managers/MouseManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM9E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;GAGG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAe;IACvC,OAAc,aAAa,EAAE,cAAc,CAAC;IAE5C,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoC;IAChE,OAAO,CAAC,aAAa,CAAoD;IACzE,OAAO,CAAC,iBAAiB,CAAmC;IAE5D,OAAO,CAAC,YAAY,CAAU;IAE9B,OAAO,CAAC,UAAU,CAAgB;IAE3B,aAAa,EAAE,OAAO,CAAM;IAEnC,OAAO,CAAC,cAAc,CAAe;IACrC,OAAO,CAAC,wBAAwB,CAAe;IAE/C,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,WAAW,CAA+B;IAElD,OAAO,CAAC,WAAW,CAA4B;IAE/C,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAI/B;IAED,OAAc,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAqBvD;IAED,OAAO,CAAC,QAAQ,CAA+D;IAC/E,OAAO,CAAC,SAAS,CAAgE;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BrB,OAAO,CAAC,qBAAqB;IAkBtB,eAAe,CAAC,WAAW,GAAE,aAAoB,GAAG,IAAI;IAU/D,OAAO,CAAC,wBAAwB;IAmNzB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAI3C,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAI7C,uBAAuB,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,GAAE,MAAU,GAAG,IAAI;IAyF9E,4BAA4B,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,GAAE,MAAU,GAAG,IAAI;IA4DtF,OAAO,CAAC,UAAU;IA2ClB,OAAO,CAAC,aAAa;IAyBd,SAAS,CAAC,KAAK,KAAA,GAAG,IAAI;IAgCtB,OAAO,CAAC,KAAK,KAAA,GAAG,IAAI;IAiCpB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAKjD,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAKnC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAKpC,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAUtC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAkBjD,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAkB/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAK5C,OAAO,CAAC,eAAe;CAyBvB"}
@@ -309,9 +309,6 @@ var MouseManager = /** @class */ (function () {
309
309
  this.dispatchEvent(event, dispatcher);
310
310
  if (pointerData.dragCollision)
311
311
  this.setupAndDispatchEvent(this._dragMove, pointerData, pointerData.dragCollision);
312
- // if bubbling is exist, fire to stage late
313
- if (this._eventBubbling)
314
- this._stage.dispatchEvent(event);
315
312
  }
316
313
  else {
317
314
  // MouseEvent.MOUSE_OVER / MouseEvent.MOUSE_OUT / MouseEvent.DRAG_OVER / MouseEvent.DRAG_OUT
@@ -601,6 +598,10 @@ var MouseManager = /** @class */ (function () {
601
598
  event.ctrlKey = sourceEvent.ctrlKey;
602
599
  event.altKey = sourceEvent.altKey;
603
600
  event.shiftKey = sourceEvent.shiftKey;
601
+ //restrict events fired to one type every animation frame
602
+ var index = pointerData.queuedEvents.indexOf(event);
603
+ if (index != -1)
604
+ pointerData.queuedEvents.splice(index, 1);
604
605
  pointerData.queuedEvents.push(event);
605
606
  pointerData.sourceEvent = sourceEvent;
606
607
  };
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.284');
1
+ console.debug('AwayJS - Scene - 0.13.286');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -81,16 +81,6 @@ export class SceneImage2D extends BitmapImage2D {
81
81
  private static _billboardRoot: DisplayObjectContainer;
82
82
  private static _billboard: Billboard;
83
83
 
84
- private _imageDataDirty: boolean;
85
-
86
- private _asyncRead: Promise<boolean>;
87
-
88
- private _initalFillColor: number = null;
89
-
90
- private _lastUsedFill: number = null;
91
-
92
- private _internalSync: boolean = false;
93
-
94
84
  protected _msaaNeedDrop: boolean = false;
95
85
 
96
86
  protected _enforceMSAASupport: boolean = false;
@@ -141,88 +131,6 @@ export class SceneImage2D extends BitmapImage2D {
141
131
  return this.canUseMSAAInternaly ? this._antialiasQuality : 0;
142
132
  }
143
133
 
144
- protected syncData(async = false): boolean | Promise<boolean> {
145
-
146
- if (async && this._asyncRead) {
147
- return this._asyncRead;
148
- }
149
-
150
- if (!async && this._asyncRead) {
151
- throw '[SceneImage2D] Synced read not allowed while async read is requested!';
152
- }
153
-
154
- this.applySymbol();
155
-
156
- // update data from pixels from GPU
157
- if (!this._imageDataDirty) {
158
- return async ? Promise.resolve(false) : false;
159
- }
160
-
161
- const context = <ContextWebGL> this._stage.context;
162
-
163
- this._stage.setRenderTarget(this, false);
164
-
165
- // when we call syncData, we already loose other data
166
- // not require apply symbol etc, because it already should be applied
167
- if (!this._data) {
168
- this._data = new Uint8ClampedArray(this.width * this.height * 4);
169
- }
170
-
171
- // mark that this internal call, avoid reqursion loop
172
- this._internalSync = true;
173
- this._asyncRead = context.drawToBitmapImage2D(this, false, async);
174
- this._internalSync = false;
175
-
176
- this._stage.setRenderTarget(null);
177
-
178
- if (!async) {
179
- this._imageDataDirty = false;
180
- // we store pixel buffer already as PMA.
181
- // we should prevent unpack what already is PMA
182
- this._unpackPMA = false;
183
- return true;
184
- }
185
-
186
- return this._asyncRead.then((_status: boolean) => {
187
- this._imageDataDirty = false;
188
- this._unpackPMA = false;
189
- this._asyncRead = null;
190
-
191
- return true;
192
- });
193
- }
194
-
195
- /* overide internal */getDataInternal (constructEmpty = true, skipSync = false) {
196
-
197
- // if sync called, check that this is requried
198
- if (!skipSync && this._imageDataDirty && !this._internalSync) {
199
- // sync data already should fill _data
200
- this.syncData(false);
201
-
202
- return this._data;
203
- }
204
-
205
- if (this._initalFillColor === null) {
206
- return super.getDataInternal(constructEmpty, true);
207
- }
208
-
209
- // disable empty buffer filling
210
- // and check that buffer is empyt (has now symbol or alpha)
211
- const data = super.getDataInternal(false, true);
212
-
213
- // if it empty, fill with initlal value
214
- if (!data) {
215
-
216
- // fill rect constuct buffer inside
217
- super.fillRect(this.rect, this._initalFillColor);
218
- this._initalFillColor = null;
219
-
220
- return this._data;
221
- }
222
-
223
- return data;
224
- }
225
-
226
134
  /**
227
135
  *
228
136
  * @returns {string}
@@ -265,8 +173,6 @@ export class SceneImage2D extends BitmapImage2D {
265
173
 
266
174
  super(width, height, transparent, null, powerOfTwo, stage);
267
175
 
268
- this._initalFillColor = fillColor;
269
- this._lastUsedFill = fillColor;
270
176
  }
271
177
 
272
178
  private createRenderer() {
@@ -388,39 +294,6 @@ export class SceneImage2D extends BitmapImage2D {
388
294
  this.copyPixels(from, this._rect, new Point(0,0));
389
295
  }
390
296
 
391
- /**
392
- * Fills a rectangular area of pixels with a specified ARGB color.
393
- *
394
- * @param rect The rectangular area to fill.
395
- * @param color The ARGB color value that fills the area. ARGB colors are
396
- * often specified in hexadecimal format; for example,
397
- * 0xFF336699.
398
- * @throws TypeError The rect is null.
399
- */
400
- public fillRect(rect: Rectangle, color: number): void {
401
- this.dropAllReferences();
402
-
403
- const argb = ColorUtils.float32ColorToARGB(color);
404
- const alpha = this._transparent ? argb[0] / 255 : 1;
405
- const isCrop = rect !== this._rect && !this._rect.equals(rect);
406
-
407
- this._stage.setRenderTarget(this, true, 0, 0, true);
408
- this._stage.setScissor(rect);
409
-
410
- // we shure that color is fully filled when there are not any crops
411
- this._lastUsedFill = isCrop ? null : color;
412
-
413
- this._stage.clear(
414
- (argb[1] / 0xff) * alpha,
415
- (argb[2] / 0xff) * alpha,
416
- (argb[3] / 0xff) * alpha,
417
- alpha
418
- );
419
-
420
- this._stage.setScissor(null);
421
- this._imageDataDirty = true;
422
- }
423
-
424
297
  /**
425
298
  * Provides a fast routine to perform pixel manipulation between images with
426
299
  * no stretching, rotation, or color effects. This method copies a
@@ -402,10 +402,6 @@ export class MouseManager {
402
402
  if (pointerData.dragCollision)
403
403
  this.setupAndDispatchEvent(this._dragMove, pointerData, pointerData.dragCollision);
404
404
 
405
- // if bubbling is exist, fire to stage late
406
- if (this._eventBubbling)
407
- this._stage.dispatchEvent(event);
408
-
409
405
  } else {
410
406
  // MouseEvent.MOUSE_OVER / MouseEvent.MOUSE_OUT / MouseEvent.DRAG_OVER / MouseEvent.DRAG_OUT
411
407
  this.dispatchEvent(event, dispatcher);
@@ -718,6 +714,12 @@ export class MouseManager {
718
714
  event.altKey = sourceEvent.altKey;
719
715
  event.shiftKey = sourceEvent.shiftKey;
720
716
 
717
+ //restrict events fired to one type every animation frame
718
+ const index = pointerData.queuedEvents.indexOf(event);
719
+
720
+ if (index != -1)
721
+ pointerData.queuedEvents.splice(index, 1);
722
+
721
723
  pointerData.queuedEvents.push(event);
722
724
 
723
725
  pointerData.sourceEvent = sourceEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.284",
3
+ "version": "0.13.286",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",