@awayjs/scene 0.13.308 → 0.13.310

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.
Files changed (38) hide show
  1. package/bundle/awayjs-scene.umd.js +2 -2
  2. package/bundle/awayjs-scene.umd.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/lib/display/Billboard.d.ts +5 -19
  5. package/dist/lib/display/Billboard.d.ts.map +1 -1
  6. package/dist/lib/display/Billboard.js +14 -32
  7. package/dist/lib/display/DisplayObject.d.ts +3 -1
  8. package/dist/lib/display/DisplayObject.d.ts.map +1 -1
  9. package/dist/lib/display/DisplayObject.js +12 -8
  10. package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
  11. package/dist/lib/display/DisplayObjectContainer.js +2 -4
  12. package/dist/lib/display/LineSegment.d.ts +2 -20
  13. package/dist/lib/display/LineSegment.d.ts.map +1 -1
  14. package/dist/lib/display/LineSegment.js +12 -41
  15. package/dist/lib/display/MorphSprite.js +1 -1
  16. package/dist/lib/display/Skybox.d.ts +1 -12
  17. package/dist/lib/display/Skybox.d.ts.map +1 -1
  18. package/dist/lib/display/Skybox.js +6 -28
  19. package/dist/lib/events/FocusEvent.d.ts +3 -3
  20. package/dist/lib/events/FocusEvent.d.ts.map +1 -1
  21. package/dist/lib/events/MouseEvent.js +1 -1
  22. package/dist/lib/events/PointerEvent.d.ts +3 -3
  23. package/dist/lib/events/PointerEvent.d.ts.map +1 -1
  24. package/dist/lib/events/TouchEvent.js +1 -1
  25. package/dist/lib/managers/MouseManager.js +2 -2
  26. package/index.ts +1 -1
  27. package/lib/display/Billboard.ts +17 -44
  28. package/lib/display/DisplayObject.ts +14 -9
  29. package/lib/display/DisplayObjectContainer.ts +2 -4
  30. package/lib/display/LineSegment.ts +12 -55
  31. package/lib/display/MorphSprite.ts +1 -1
  32. package/lib/display/Skybox.ts +6 -30
  33. package/lib/events/FocusEvent.ts +3 -3
  34. package/lib/events/MouseEvent.ts +1 -1
  35. package/lib/events/PointerEvent.ts +3 -3
  36. package/lib/events/TouchEvent.ts +1 -1
  37. package/lib/managers/MouseManager.ts +2 -2
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FocusEvent.d.ts","sourceRoot":"","sources":["../../../lib/events/FocusEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAElE;;GAEG;AACH,qBAAa,UAAW,SAAQ,SAAS;IAExC;;OAEG;IACH,OAAc,QAAQ,EAAE,MAAM,CAAe;IAC7C;;OAEG;IACH,OAAc,SAAS,EAAE,MAAM,CAAgB;IAE/C;;OAEG;IACI,IAAI,EAAE,IAAI,CAAC;IAElB;;OAEG;IACI,MAAM,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACI,cAAc,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACI,WAAW,EAAE,YAAY,CAAC;IAE1B,cAAc,EAAE,KAAK,CAAC;IAE7B;;;OAGG;gBACS,IAAI,EAAE,MAAM;IAIxB;;OAEG;IACI,KAAK,IAAI,UAAU;IAcnB,cAAc,CAAC,UAAU,EAAE,KAAK;CAIvC"}
1
+ {"version":3,"file":"FocusEvent.d.ts","sourceRoot":"","sources":["../../../lib/events/FocusEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D;;GAEG;AACH,qBAAa,UAAW,SAAQ,SAAS;IAExC;;OAEG;IACH,OAAc,QAAQ,EAAE,MAAM,CAAe;IAC7C;;OAEG;IACH,OAAc,SAAS,EAAE,MAAM,CAAgB;IAE/C;;OAEG;IACI,IAAI,EAAE,IAAI,CAAC;IAElB;;OAEG;IACI,MAAM,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACI,cAAc,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACI,QAAQ,EAAE,SAAS,CAAC;IAEpB,cAAc,EAAE,KAAK,CAAC;IAE7B;;;OAGG;gBACS,IAAI,EAAE,MAAM;IAIxB;;OAEG;IACI,KAAK,IAAI,UAAU;IAcnB,cAAc,CAAC,UAAU,EAAE,KAAK;CAIvC"}
@@ -33,7 +33,7 @@ var MouseEvent = /** @class */ (function (_super) {
33
33
  result.view = this.view;
34
34
  result.containerNode = this.containerNode;
35
35
  result.rootNode = this.rootNode;
36
- result.traversable = this.traversable;
36
+ result.pickable = this.pickable;
37
37
  result.material = this.material;
38
38
  result.uv = this.uv;
39
39
  result.position = this.position;
@@ -1,5 +1,5 @@
1
1
  import { Point, Vector3D, EventBase } from '@awayjs/core';
2
- import { ContainerNode, INode, ITraversable, View, IContainer } from '@awayjs/view';
2
+ import { ContainerNode, INode, View, IContainer, IPickable } from '@awayjs/view';
3
3
  import { IMaterial } from '@awayjs/renderer';
4
4
  /**
5
5
  * A MouseEvent is dispatched when a mouse event occurs over a mouseEnabled object in View.
@@ -29,9 +29,9 @@ export declare class PointerEvent extends EventBase {
29
29
  */
30
30
  rootNode: INode;
31
31
  /**
32
- * The traversable owner inside which the event took place.
32
+ * The pickable owner inside which the event took place.
33
33
  */
34
- traversable: ITraversable;
34
+ pickable: IPickable;
35
35
  /**
36
36
  * The material of the 3d element inside which the event took place.
37
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PointerEvent.d.ts","sourceRoot":"","sources":["../../../lib/events/PointerEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EAAE,SAAS,EAAE,MAA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** @class */ (function (_super) {
33
33
  result.view = this.view;
34
34
  result.containerNode = this.containerNode;
35
35
  result.rootNode = this.rootNode;
36
- result.traversable = this.traversable;
36
+ result.pickable = this.pickable;
37
37
  result.material = this.material;
38
38
  result.uv = this.uv;
39
39
  result.position = this.position;
@@ -568,7 +568,7 @@ var MouseManager = /** @class */ (function () {
568
568
  event.containerNode = collision.containerNode;
569
569
  event.rootNode = collision.rootNode;
570
570
  // Object.
571
- event.traversable = collision.traversable;
571
+ event.pickable = collision.pickable;
572
572
  // UV.
573
573
  event.uv = collision.uv;
574
574
  // Position.
@@ -582,7 +582,7 @@ var MouseManager = /** @class */ (function () {
582
582
  // Set all to null.
583
583
  event.containerNode = null;
584
584
  event.rootNode = null;
585
- event.traversable = null;
585
+ event.pickable = null;
586
586
  event.uv = null;
587
587
  event.position = this._nullVector;
588
588
  event.normal = this._nullVector;
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- console.debug('AwayJS - Scene - 0.13.308');
1
+ console.debug('AwayJS - Scene - 0.13.310');
2
2
 
3
3
  export { IDisplayObjectAdapter } from './lib/adapters/IDisplayObjectAdapter';
4
4
  export { IMovieClipAdapter } from './lib/adapters/IMovieClipAdapter';
@@ -3,9 +3,9 @@ import {
3
3
  PickEntity,
4
4
  _Pick_PickableBase,
5
5
  IEntity,
6
+ IPickable,
6
7
  } from '@awayjs/view';
7
8
  import {
8
- RenderableEvent,
9
9
  MaterialEvent,
10
10
  IMaterial,
11
11
  StyleEvent,
@@ -60,11 +60,13 @@ import { DisplayObjectContainer } from './DisplayObjectContainer';
60
60
  * (in away3d Sprite3D extends on ObjectContainer3D)
61
61
  */
62
62
 
63
- export class Billboard extends DisplayObjectContainer {
63
+ export class Billboard extends DisplayObjectContainer implements IPickable {
64
64
  private static _billboards: Array<Billboard> = new Array<Billboard>();
65
65
 
66
66
  public static assetType: string = '[asset Billboard]';
67
67
 
68
+ public _pickObjects: Record<number, _Pick_PickableBase> = {};
69
+
68
70
  private _width: number;
69
71
  private _height: number;
70
72
  private _billboardWidth: number;
@@ -190,6 +192,13 @@ export class Billboard extends DisplayObjectContainer {
190
192
  this._sampler.smooth = smoothing;
191
193
  }
192
194
 
195
+ public invalidateElements(): void {
196
+ for (const key in this._pickObjects)
197
+ this._pickObjects[key]._onInvalidateElements();
198
+
199
+ super.invalidateElements();
200
+ }
201
+
193
202
  public advanceFrame(): void {
194
203
  //override for billboard
195
204
  }
@@ -423,42 +432,6 @@ export class _Render_Billboard extends _Render_RenderableBase {
423
432
  * @class away.pool._Render_Shape
424
433
  */
425
434
  export class _Pick_Billboard extends _Pick_PickableBase {
426
- private _billboardBox: Box;
427
- private _billboardBoxDirty: boolean = true;
428
- private _onInvalidateElementsDelegate: (event: RenderableEvent) => void;
429
-
430
- constructor() {
431
- super();
432
-
433
- this._onInvalidateElementsDelegate = (event: RenderableEvent) => this._onInvalidateElements(event);
434
- }
435
-
436
- /**
437
- * //TODO
438
- *
439
- * @param renderEntity
440
- * @param shape
441
- * @param level
442
- * @param indexOffset
443
- */
444
- public init(billboard: Billboard, pickEntity: PickEntity): void {
445
- super.init(billboard, pickEntity);
446
-
447
- this._asset.addEventListener(RenderableEvent.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate);
448
- }
449
-
450
- public _onInvalidateElements(event: RenderableEvent): void {
451
- this._billboardBoxDirty = true;
452
- }
453
-
454
- public onClear(event: AssetEvent): void {
455
- this._asset.removeEventListener(RenderableEvent.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate);
456
-
457
- super.onClear(event);
458
-
459
- this._billboardBox = null;
460
- this._billboardBoxDirty = true;
461
- }
462
435
 
463
436
  public hitTestPoint(x: number, y: number, z: number): boolean {
464
437
  return true;
@@ -467,19 +440,19 @@ export class _Pick_Billboard extends _Pick_PickableBase {
467
440
  public getBoxBounds(
468
441
  matrix3D: Matrix3D = null, strokeFlag: boolean = true, cache: Box = null, target: Box = null): Box {
469
442
 
470
- if (this._billboardBoxDirty) {
471
- this._billboardBoxDirty = false;
443
+ if (this._orientedBoxBoundsDirty) {
444
+ this._orientedBoxBoundsDirty = false;
472
445
 
473
446
  const billboardRect: Rectangle = (<Billboard> this._asset).billboardRect;
474
- this._billboardBox = new Box(
447
+ this._orientedBoxBounds = new Box(
475
448
  billboardRect.x, billboardRect.y, 0,
476
449
  billboardRect.width, billboardRect.height, 0);
477
450
  }
478
451
 
479
452
  return (
480
453
  matrix3D
481
- ? matrix3D.transformBox(this._billboardBox)
482
- : this._billboardBox).union(target, target || cache);
454
+ ? matrix3D.transformBox(this._orientedBoxBounds)
455
+ : this._orientedBoxBounds).union(target, target || cache);
483
456
  }
484
457
 
485
458
  public getSphereBounds(
@@ -496,7 +469,7 @@ export class _Pick_Billboard extends _Pick_PickableBase {
496
469
  collision.rayPosition.x + rayEntryDistance * collision.rayDirection.x,
497
470
  collision.rayPosition.y + rayEntryDistance * collision.rayDirection.y);
498
471
 
499
- collision.traversable = this._asset;
472
+ collision.pickable = <IPickable> this._asset;
500
473
  collision.rayEntryDistance = rayEntryDistance;
501
474
  collision.position = position;
502
475
  collision.normal = new Vector3D(0,0,1);
@@ -7,7 +7,6 @@ import {
7
7
  Vector3D,
8
8
  AssetBase,
9
9
  Loader,
10
- IAbstraction,
11
10
  } from '@awayjs/core';
12
11
 
13
12
  import { BlendMode } from '@awayjs/stage';
@@ -23,15 +22,16 @@ import {
23
22
  OrientationMode,
24
23
  IContainer,
25
24
  ContainerNode,
26
- View
27
25
  } from '@awayjs/view';
28
26
 
29
27
  import {
30
28
  IMaterial,
31
29
  Style,
32
30
  StyleEvent,
33
- RenderableEvent,
34
31
  ElementsType,
32
+ RenderEntity,
33
+ _Render_RenderableBase,
34
+ CacheRenderer,
35
35
  } from '@awayjs/renderer';
36
36
 
37
37
  import { DisplayObjectContainer } from './DisplayObjectContainer';
@@ -176,6 +176,9 @@ import { Settings } from '../Settings';
176
176
  */
177
177
  export class DisplayObject extends AssetBase implements IBitmapDrawable, IContainer {
178
178
 
179
+ public _renderObjects: Record<number, RenderEntity | _Render_RenderableBase | CacheRenderer> = {};
180
+ public _containerNodes: Record<number, ContainerNode> = {};
181
+
179
182
  private _mouseChildren: boolean = true;
180
183
  public _material: IMaterial;
181
184
  public _style: Style;
@@ -1775,9 +1778,8 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IContai
1775
1778
  }
1776
1779
 
1777
1780
  public _invalidateHierarchicalProperty(propDirty: HierarchicalProperty): void {
1778
- for (const key in this._abstractionPool)
1779
- if ((<ContainerNode> this._abstractionPool[key]).invalidateHierarchicalProperty)
1780
- (<ContainerNode> this._abstractionPool[key]).invalidateHierarchicalProperty(propDirty);
1781
+ for (const key in this._containerNodes)
1782
+ this._containerNodes[key].invalidateHierarchicalProperty(propDirty);
1781
1783
  }
1782
1784
 
1783
1785
  /**
@@ -1859,15 +1861,18 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IContai
1859
1861
  }
1860
1862
 
1861
1863
  public _invalidateMaterial(): void {
1862
- this.dispatchEvent(new RenderableEvent(RenderableEvent.INVALIDATE_MATERIAL, this));
1864
+ for (const key in this._renderObjects)
1865
+ this._renderObjects[key]._onInvalidateMaterial();
1863
1866
  }
1864
1867
 
1865
1868
  private _invalidateStyle(): void {
1866
- this.dispatchEvent(new RenderableEvent(RenderableEvent.INVALIDATE_STYLE, this));
1869
+ for (const key in this._renderObjects)
1870
+ this._renderObjects[key]._onInvalidateStyle();
1867
1871
  }
1868
1872
 
1869
1873
  public invalidateElements(): void {
1870
- this.dispatchEvent(new RenderableEvent(RenderableEvent.INVALIDATE_ELEMENTS, this));
1874
+ for (const key in this._renderObjects)
1875
+ this._renderObjects[key]._onInvalidateElements();
1871
1876
  }
1872
1877
 
1873
1878
  protected _onInvalidateProperties(_event: StyleEvent = null): void {
@@ -172,8 +172,7 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
172
172
  child._setParent(this);
173
173
 
174
174
  for (const key in this._abstractionPool)
175
- if ((<ContainerNode> this._abstractionPool[key]).addChildAt)
176
- (<ContainerNode> this._abstractionPool[key]).addChildAt(child, index);
175
+ this._containerNodes[key].addChildAt(child, index);
177
176
 
178
177
  return child;
179
178
  }
@@ -534,8 +533,7 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
534
533
  child._setParent(null);
535
534
 
536
535
  for (const key in this._abstractionPool)
537
- if ((<ContainerNode> this._abstractionPool[key]).removeChildAt)
538
- (<ContainerNode> this._abstractionPool[key]).removeChildAt(index);
536
+ this._containerNodes[key].removeChildAt(index);
539
537
 
540
538
  return child;
541
539
  }
@@ -3,7 +3,7 @@
3
3
  import { PickingCollision, _Pick_PickableBase,
4
4
  PickEntity, IEntityTraverser, IEntity } from '@awayjs/view';
5
5
 
6
- import { RenderableEvent, IMaterial } from '@awayjs/renderer';
6
+ import { IMaterial } from '@awayjs/renderer';
7
7
 
8
8
  import { DisplayObject } from './DisplayObject';
9
9
 
@@ -98,8 +98,6 @@ export class LineSegment extends DisplayObject {
98
98
  }
99
99
  }
100
100
 
101
- import { AssetEvent } from '@awayjs/core';
102
-
103
101
  import { LineElements } from '@awayjs/renderer';
104
102
 
105
103
  import { _Stage_ElementsBase, _Render_MaterialBase, _Render_RenderableBase,
@@ -156,47 +154,6 @@ export class _Render_LineSegment extends _Render_RenderableBase {
156
154
  * @class away.pool._Render_Shape
157
155
  */
158
156
  export class _Pick_LineSegment extends _Pick_PickableBase {
159
- private _lineSegmentBox: Box;
160
- private _lineSegmentBoxDirty: boolean = true;
161
- private _lineSegmentSphere: Sphere;
162
- private _lineSegmentSphereDirty: boolean = true;
163
- private _onInvalidateElementsDelegate: (event: RenderableEvent) => void;
164
-
165
- constructor() {
166
- super();
167
-
168
- this._onInvalidateElementsDelegate = (event: RenderableEvent) => this._onInvalidateElements(event);
169
- }
170
-
171
- /**
172
- * //TODO
173
- *
174
- * @param renderEntity
175
- * @param shape
176
- * @param level
177
- * @param indexOffset
178
- */
179
- public init(lineSegment: LineSegment, pickEntity: PickEntity): void {
180
- super.init(lineSegment, pickEntity);
181
-
182
- this._asset.addEventListener(RenderableEvent.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate);
183
- }
184
-
185
- public _onInvalidateElements(event: RenderableEvent): void {
186
- this._lineSegmentBoxDirty = true;
187
- this._lineSegmentSphereDirty = true;
188
- }
189
-
190
- public onClear(event: AssetEvent): void {
191
- this._asset.removeEventListener(RenderableEvent.INVALIDATE_ELEMENTS, this._onInvalidateElementsDelegate);
192
-
193
- super.onClear(event);
194
-
195
- this._lineSegmentBox = null;
196
- this._lineSegmentBoxDirty = true;
197
- this._lineSegmentSphere = null;
198
- this._lineSegmentSphereDirty = true;
199
- }
200
157
 
201
158
  public hitTestPoint(x: number, y: number, z: number): boolean {
202
159
  return true;
@@ -204,13 +161,13 @@ export class _Pick_LineSegment extends _Pick_PickableBase {
204
161
 
205
162
  public getBoxBounds(matrix3D: Matrix3D = null, strokeFlag: boolean = true,
206
163
  cache: Box = null, target: Box = null): Box {
207
- if (this._lineSegmentBoxDirty) {
208
- this._lineSegmentBoxDirty = false;
164
+ if (this._orientedBoxBoundsDirty) {
165
+ this._orientedBoxBoundsDirty = false;
209
166
 
210
167
  const startPosition: Vector3D = (<LineSegment> this._asset).startPosition;
211
168
  const endPosition: Vector3D = (<LineSegment> this._asset).endPosition;
212
169
 
213
- this._lineSegmentBox = new Box(Math.min(startPosition.x, endPosition.x),
170
+ this._orientedBoxBounds = new Box(Math.min(startPosition.x, endPosition.x),
214
171
  Math.min(startPosition.y, endPosition.y),
215
172
  Math.min(startPosition.z, endPosition.z),
216
173
  Math.abs(startPosition.x - endPosition.x),
@@ -219,14 +176,14 @@ export class _Pick_LineSegment extends _Pick_PickableBase {
219
176
  }
220
177
 
221
178
  return (matrix3D ?
222
- matrix3D.transformBox(this._lineSegmentBox) :
223
- this._lineSegmentBox).union(target, target || cache);
179
+ matrix3D.transformBox(this._orientedBoxBounds) :
180
+ this._orientedBoxBounds).union(target, target || cache);
224
181
  }
225
182
 
226
183
  public getSphereBounds(center: Vector3D, matrix3D: Matrix3D = null, strokeFlag: boolean = true,
227
184
  cache: Sphere = null, target: Sphere = null): Sphere {
228
- if (this._lineSegmentSphereDirty) {
229
- this._lineSegmentSphereDirty = false;
185
+ if (this._orientedSphereBoundsDirty) {
186
+ this._orientedSphereBoundsDirty = false;
230
187
 
231
188
  const startPosition: Vector3D = (<LineSegment> this._asset).startPosition;
232
189
  const endPosition: Vector3D = (<LineSegment> this._asset).endPosition;
@@ -235,19 +192,19 @@ export class _Pick_LineSegment extends _Pick_PickableBase {
235
192
  const halfHeight: number = (endPosition.y - startPosition.y) / 2;
236
193
  const halfDepth: number = (endPosition.z - startPosition.z) / 2;
237
194
 
238
- this._lineSegmentSphere = new Sphere(startPosition.x + halfWidth,
195
+ this._orientedSphereBounds = new Sphere(startPosition.x + halfWidth,
239
196
  startPosition.y + halfHeight,
240
197
  startPosition.z + halfDepth,
241
198
  Math.sqrt(halfWidth * halfWidth + halfHeight * halfHeight + halfDepth * halfDepth));
242
199
  }
243
200
 
244
201
  return (matrix3D ?
245
- matrix3D.transformSphere(this._lineSegmentSphere) :
246
- this._lineSegmentSphere).union(target, target || cache);
202
+ matrix3D.transformSphere(this._orientedSphereBounds) :
203
+ this._orientedSphereBounds).union(target, target || cache);
247
204
  }
248
205
 
249
206
  public testCollision(collision: PickingCollision, closestFlag: boolean): boolean {
250
- collision.traversable = null;
207
+ collision.pickable = null;
251
208
  //TODO
252
209
  return false;
253
210
  }
@@ -308,7 +308,7 @@ export class MorphSprite extends Sprite {
308
308
  this._blendStyle(startPath, endPath, newPath, ratio);
309
309
  this._blendContours(startPath, endPath, newPath, ratio);
310
310
 
311
- destination.add_queued_path(newPath);
311
+ destination.add_queued_path(newPath, true);
312
312
  }
313
313
 
314
314
  /**
@@ -4,7 +4,7 @@ import { BlendMode, ImageCube } from '@awayjs/stage';
4
4
 
5
5
  import { PickingCollision, BoundingVolumeType, INode, IEntity, ContainerNode } from '@awayjs/view';
6
6
 
7
- import { IAnimationSet, IMaterial, ITexture, RenderableEvent,
7
+ import { IAnimationSet, IMaterial, ITexture,
8
8
  MaterialEvent, Style, StyleEvent, IRenderContainer, ImageTextureCube, DefaultRenderer } from '@awayjs/renderer';
9
9
 
10
10
  import { DisplayObjectContainer } from './DisplayObjectContainer';
@@ -22,7 +22,6 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
22
22
  private _texture: ImageTextureCube;
23
23
  private _animationSet: IAnimationSet;
24
24
  public _blendMode: string = BlendMode.NORMAL;
25
- private _owners: Array<IRenderContainer>;
26
25
  private _onTextureInvalidateDelegate: (event: AssetEvent) => void;
27
26
 
28
27
  public animateUVs: boolean = false;
@@ -70,15 +69,6 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
70
69
  this.invalidate();
71
70
  }
72
71
 
73
- /**
74
- * A list of the IRenderables that use this material
75
- *
76
- * @private
77
- */
78
- public get iOwners(): Array<IRenderContainer> {
79
- return this._owners;
80
- }
81
-
82
72
  /**
83
73
  * The cube texture to use as the skybox.
84
74
  */
@@ -121,8 +111,6 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
121
111
 
122
112
  this._onTextureInvalidateDelegate = (event: AssetEvent) => this.onTextureInvalidate(event);
123
113
 
124
- this._owners = [this];
125
-
126
114
  this.style = new Style();
127
115
  if (imageColor instanceof ImageCube) {
128
116
  this._style.image = <ImageCube> imageColor;
@@ -149,18 +137,6 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
149
137
  this.dispatchEvent(new MaterialEvent(MaterialEvent.INVALIDATE_PASSES, this));
150
138
  }
151
139
 
152
- public invalidateElements(): void {
153
- this.dispatchEvent(new RenderableEvent(RenderableEvent.INVALIDATE_ELEMENTS, this));
154
- }
155
-
156
- public invalidateMaterial(): void {
157
- this.dispatchEvent(new RenderableEvent(RenderableEvent.INVALIDATE_MATERIAL, this));
158
- }
159
-
160
- public invalidateStyle(): void {
161
- this.dispatchEvent(new RenderableEvent(RenderableEvent.INVALIDATE_STYLE, this));
162
- }
163
-
164
140
  public addTexture(texture: ITexture): void {
165
141
  this._textures.push(texture);
166
142
 
@@ -182,7 +158,7 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
182
158
  }
183
159
 
184
160
  public _onInvalidateProperties(event: StyleEvent): void {
185
- this.invalidateMaterial();
161
+ this._invalidateMaterial();
186
162
  this.invalidatePasses();
187
163
  }
188
164
 
@@ -209,7 +185,7 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
209
185
  }
210
186
 
211
187
  public testCollision(collision: PickingCollision, closestFlag: boolean): boolean {
212
- collision.traversable = null;
188
+ collision.pickable = null;
213
189
 
214
190
  return false;
215
191
  }
@@ -244,10 +220,10 @@ export class _Render_SkyboxMaterial extends _Render_MaterialPassBase {
244
220
  this._pAddPass(this);
245
221
  }
246
222
 
247
- public onClear(event: AssetEvent): void {
248
- super.onClear(event);
223
+ public onClear(): void {
224
+ super.onClear();
249
225
 
250
- this._texture.onClear(null);
226
+ this._texture.onClear();
251
227
  this._texture = null;
252
228
 
253
229
  this._skybox = null;
@@ -1,6 +1,6 @@
1
1
  import { EventBase } from '@awayjs/core';
2
2
 
3
- import { IEntity, View, ITraversable, INode } from '@awayjs/view';
3
+ import { IEntity, View, INode, IPickable } from '@awayjs/view';
4
4
  import FrameScriptManager from '../managers/FrameScriptManager';
5
5
  /**
6
6
  * A FocusEvent is dispatched when a entity is focused
@@ -32,9 +32,9 @@ export class FocusEvent extends EventBase {
32
32
  public invokedByMouse: IEntity;
33
33
 
34
34
  /**
35
- * The traversable owner inside which the event took place.
35
+ * The pickable owner inside which the event took place.
36
36
  */
37
- public traversable: ITraversable;
37
+ public pickable: IPickable;
38
38
 
39
39
  public commonAncestor: INode;
40
40
 
@@ -118,7 +118,7 @@ export class MouseEvent extends PointerEvent {
118
118
  result.view = this.view;
119
119
  result.containerNode = this.containerNode;
120
120
  result.rootNode = this.rootNode;
121
- result.traversable = this.traversable;
121
+ result.pickable = this.pickable;
122
122
  result.material = this.material;
123
123
  result.uv = this.uv;
124
124
  result.position = this.position;
@@ -1,6 +1,6 @@
1
1
  import { Point, Vector3D, EventBase } from '@awayjs/core';
2
2
 
3
- import { ContainerNode, INode, ITraversable, View, IContainer } from '@awayjs/view';
3
+ import { ContainerNode, INode, View, IContainer, IPickable } from '@awayjs/view';
4
4
 
5
5
  import { IMaterial } from '@awayjs/renderer';
6
6
 
@@ -39,9 +39,9 @@ export class PointerEvent extends EventBase {
39
39
  public rootNode: INode;
40
40
 
41
41
  /**
42
- * The traversable owner inside which the event took place.
42
+ * The pickable owner inside which the event took place.
43
43
  */
44
- public traversable: ITraversable;
44
+ public pickable: IPickable;
45
45
 
46
46
  /**
47
47
  * The material of the 3d element inside which the event took place.
@@ -78,7 +78,7 @@ export class TouchEvent extends PointerEvent {
78
78
  result.view = this.view;
79
79
  result.containerNode = this.containerNode;
80
80
  result.rootNode = this.rootNode;
81
- result.traversable = this.traversable;
81
+ result.pickable = this.pickable;
82
82
  result.material = this.material;
83
83
  result.uv = this.uv;
84
84
  result.position = this.position;
@@ -682,7 +682,7 @@ export class MouseManager {
682
682
 
683
683
  event.rootNode = collision.rootNode;
684
684
  // Object.
685
- event.traversable = collision.traversable;
685
+ event.pickable = collision.pickable;
686
686
  // UV.
687
687
  event.uv = collision.uv;
688
688
  // Position.
@@ -695,7 +695,7 @@ export class MouseManager {
695
695
  // Set all to null.
696
696
  event.containerNode = null;
697
697
  event.rootNode = null;
698
- event.traversable = null;
698
+ event.pickable = null;
699
699
  event.uv = null;
700
700
  event.position = this._nullVector;
701
701
  event.normal = this._nullVector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awayjs/scene",
3
- "version": "0.13.308",
3
+ "version": "0.13.310",
4
4
  "description": "AwayJS scene classes",
5
5
  "main": "bundle/awayjs-scene.umd.js",
6
6
  "module": "dist/index.js",