@awayjs/scene 0.13.300 → 0.13.302

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 (67) 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/Scene.d.ts +6 -5
  5. package/dist/lib/Scene.d.ts.map +1 -1
  6. package/dist/lib/Scene.js +13 -15
  7. package/dist/lib/display/Billboard.d.ts +2 -2
  8. package/dist/lib/display/Billboard.d.ts.map +1 -1
  9. package/dist/lib/display/Billboard.js +2 -3
  10. package/dist/lib/display/Camera.d.ts +1 -10
  11. package/dist/lib/display/Camera.d.ts.map +1 -1
  12. package/dist/lib/display/Camera.js +1 -19
  13. package/dist/lib/display/DisplayObject.d.ts +6 -12
  14. package/dist/lib/display/DisplayObject.d.ts.map +1 -1
  15. package/dist/lib/display/DisplayObject.js +5 -11
  16. package/dist/lib/display/DisplayObjectContainer.d.ts +1 -1
  17. package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
  18. package/dist/lib/display/DisplayObjectContainer.js +5 -5
  19. package/dist/lib/display/LineSegment.d.ts +2 -2
  20. package/dist/lib/display/LineSegment.d.ts.map +1 -1
  21. package/dist/lib/display/LineSegment.js +3 -4
  22. package/dist/lib/display/MovieClip.d.ts.map +1 -1
  23. package/dist/lib/display/MovieClip.js +1 -3
  24. package/dist/lib/display/Skybox.d.ts +4 -4
  25. package/dist/lib/display/Skybox.d.ts.map +1 -1
  26. package/dist/lib/display/Skybox.js +7 -9
  27. package/dist/lib/display/Sprite.d.ts +2 -7
  28. package/dist/lib/display/Sprite.d.ts.map +1 -1
  29. package/dist/lib/display/Sprite.js +8 -20
  30. package/dist/lib/display/TextField.d.ts +2 -3
  31. package/dist/lib/display/TextField.d.ts.map +1 -1
  32. package/dist/lib/display/TextField.js +1 -46
  33. package/dist/lib/display/TextSprite.d.ts +2 -1
  34. package/dist/lib/display/TextSprite.d.ts.map +1 -1
  35. package/dist/lib/display/TextSprite.js +2 -2
  36. package/dist/lib/events/FocusEvent.d.ts +4 -4
  37. package/dist/lib/events/FocusEvent.d.ts.map +1 -1
  38. package/dist/lib/events/MouseEvent.d.ts +2 -2
  39. package/dist/lib/events/MouseEvent.d.ts.map +1 -1
  40. package/dist/lib/events/PointerEvent.d.ts +3 -3
  41. package/dist/lib/events/PointerEvent.d.ts.map +1 -1
  42. package/dist/lib/events/TouchEvent.d.ts +2 -2
  43. package/dist/lib/events/TouchEvent.d.ts.map +1 -1
  44. package/dist/lib/image/SceneImage2D.js +2 -2
  45. package/dist/lib/managers/MouseManager.d.ts +3 -3
  46. package/dist/lib/managers/MouseManager.d.ts.map +1 -1
  47. package/dist/lib/text/FNTGenerator.js +1 -1
  48. package/index.ts +1 -1
  49. package/lib/Scene.ts +18 -21
  50. package/lib/display/Billboard.ts +4 -7
  51. package/lib/display/Camera.ts +2 -16
  52. package/lib/display/DisplayObject.ts +12 -24
  53. package/lib/display/DisplayObjectContainer.ts +7 -6
  54. package/lib/display/LineSegment.ts +6 -7
  55. package/lib/display/MovieClip.ts +1 -5
  56. package/lib/display/Skybox.ts +10 -11
  57. package/lib/display/Sprite.ts +13 -27
  58. package/lib/display/TextField.ts +5 -55
  59. package/lib/display/TextSprite.ts +5 -3
  60. package/lib/events/FocusEvent.ts +4 -4
  61. package/lib/events/MouseEvent.ts +2 -2
  62. package/lib/events/PointerEvent.ts +3 -3
  63. package/lib/events/TouchEvent.ts +2 -2
  64. package/lib/image/SceneImage2D.ts +2 -2
  65. package/lib/managers/MouseManager.ts +14 -14
  66. package/lib/text/FNTGenerator.ts +1 -1
  67. package/package.json +1 -1
@@ -1,10 +1,8 @@
1
1
  import {
2
2
  PickingCollision,
3
- PartitionBase,
4
3
  PickEntity,
5
4
  _Pick_PickableBase,
6
- EntityNode,
7
- IPartitionEntity,
5
+ IEntity,
8
6
  } from '@awayjs/view';
9
7
  import {
10
8
  RenderableEvent,
@@ -196,7 +194,7 @@ export class Billboard extends DisplayObjectContainer {
196
194
  //override for billboard
197
195
  }
198
196
 
199
- public getEntity(): IPartitionEntity {
197
+ public getEntity(): IEntity {
200
198
  return this;
201
199
  }
202
200
 
@@ -413,7 +411,7 @@ export class _Render_Billboard extends _Render_RenderableBase {
413
411
  protected _getRenderMaterial(): _Render_MaterialBase {
414
412
  const material: IMaterial = (<Billboard> this._asset).material || MaterialUtils.getDefaultColorMaterial();
415
413
  return material.getAbstraction<_Render_MaterialBase>(
416
- this.renderer.getRenderElements(this.stageElements.elements));
414
+ this.entity.renderer.getRenderElements(this.stageElements.elements));
417
415
  }
418
416
 
419
417
  protected _getStyle(): Style {
@@ -508,5 +506,4 @@ export class _Pick_Billboard extends _Pick_PickableBase {
508
506
  }
509
507
 
510
508
  RenderEntity.registerRenderable(_Render_Billboard, Billboard);
511
- PickEntity.registerPickable(_Pick_Billboard, Billboard);
512
- PartitionBase.registerAbstraction(EntityNode, Billboard);
509
+ PickEntity.registerPickable(_Pick_Billboard, Billboard);
@@ -1,6 +1,6 @@
1
1
  import { Vector3D, ProjectionBase, PerspectiveProjection } from '@awayjs/core';
2
2
 
3
- import { PartitionBase, BoundingVolumeType, IPartitionTraverser, EntityNode } from '@awayjs/view';
3
+ import { BoundingVolumeType } from '@awayjs/view';
4
4
 
5
5
  import { CameraEvent } from '../events/CameraEvent';
6
6
 
@@ -73,18 +73,4 @@ export class Camera extends DisplayObjectContainer {
73
73
  protected _getDefaultBoundingVolume(): BoundingVolumeType {
74
74
  return BoundingVolumeType.NULL;
75
75
  }
76
- }
77
-
78
- /**
79
- * @class away.partition.CameraNode
80
- */
81
- export class CameraNode extends EntityNode {
82
- /**
83
- * @inheritDoc
84
- */
85
- public acceptTraverser(traverser: IPartitionTraverser): void {
86
- // todo: dead end for now, if it has a debug sprite, then sure accept that
87
- }
88
- }
89
-
90
- PartitionBase.registerAbstraction(CameraNode, Camera);
76
+ }
@@ -16,14 +16,12 @@ import {
16
16
  BoundingBox,
17
17
  BoundingSphere,
18
18
  BoundingVolumeType,
19
- IPartitionEntity,
19
+ IEntity,
20
20
  BoundsPicker,
21
- HeirarchicalEvent,
22
21
  HierarchicalProperty,
23
22
  AlignmentMode,
24
23
  OrientationMode,
25
- BasicPartition,
26
- IPartitionContainer,
24
+ IContainer,
27
25
  ContainerNode
28
26
  } from '@awayjs/view';
29
27
 
@@ -43,7 +41,6 @@ import { PrimitiveCubePrefab } from '../prefabs/PrimitiveCubePrefab';
43
41
  import { PrimitiveSpherePrefab } from '../prefabs/PrimitiveSpherePrefab';
44
42
  import { PrimitivePrefabBase } from '../prefabs/PrimitivePrefabBase';
45
43
  import { IFilter } from '../adapters/IFilter';
46
- import { IPartitionClass } from '@awayjs/view';
47
44
  import { Sprite } from './Sprite';
48
45
  import { Settings } from '../Settings';
49
46
 
@@ -176,7 +173,7 @@ import { Settings } from '../Settings';
176
173
  * display is not rendering. This is the case when the
177
174
  * content is either minimized or obscured. </p>
178
175
  */
179
- export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartitionContainer {
176
+ export class DisplayObject extends AssetBase implements IBitmapDrawable, IContainer {
180
177
 
181
178
  private _mouseChildren: boolean = true;
182
179
  public _material: IMaterial;
@@ -201,15 +198,13 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
201
198
 
202
199
  public pickObjectFromTimeline: boolean;
203
200
 
204
- //public _implicitPartition: PartitionBase;
205
-
206
201
  private _alignmentMode: AlignmentMode = AlignmentMode.REGISTRATION_POINT;
207
202
  private _scale9Grid: Rectangle;
208
203
  protected _transform: Transform;
209
204
  private _visible: boolean = true;
210
205
  private _maskId: number = -1;
211
206
 
212
- protected _masks: Array<DisplayObject>;
207
+ protected _masks: DisplayObject[];
213
208
  protected _scriptMask: DisplayObject;
214
209
 
215
210
  private _mouseEnabled: boolean = true;
@@ -238,8 +233,6 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
238
233
  public avm1Symbol: any;
239
234
  public isAVMScene: boolean=false;
240
235
 
241
- public partitionClass: IPartitionClass;
242
-
243
236
  // this is needed for AVM1 - todo: maybe do this on adapters ?
244
237
  public placeObjectTag: any=null;
245
238
  public getScriptPrecedence(): number[] {
@@ -1236,7 +1229,7 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
1236
1229
  this.invalidate();
1237
1230
  }
1238
1231
 
1239
- public getScrollRectPrimitive(): IPartitionContainer {
1232
+ public getScrollRectPrimitive(): IContainer {
1240
1233
  if (this._scrollRectPrimitiveDirty) {
1241
1234
  this._scrollRectPrimitiveDirty = false;
1242
1235
 
@@ -1257,7 +1250,7 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
1257
1250
  return this._scrollRectPrimitive;
1258
1251
  }
1259
1252
 
1260
- public getBoundsPrimitive(picker: BoundsPicker): IPartitionContainer {
1253
+ public getBoundsPrimitive(picker: BoundsPicker): IContainer {
1261
1254
  if (this._boundsPrimitive == null) {
1262
1255
  switch (this._defaultBoundingVolume) {
1263
1256
  case BoundingVolumeType.BOX:
@@ -1624,7 +1617,10 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
1624
1617
  //default to do nothing
1625
1618
  }
1626
1619
 
1627
- public getEntity(): IPartitionEntity {
1620
+ public getEntity(): IEntity {
1621
+ if (this._iController)
1622
+ this._iController.update();
1623
+
1628
1624
  return;
1629
1625
  }
1630
1626
 
@@ -1778,15 +1774,8 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
1778
1774
  }
1779
1775
 
1780
1776
  public _invalidateHierarchicalProperty(propDirty: HierarchicalProperty): void {
1781
- this.dispatchEvent(new HeirarchicalEvent(HeirarchicalEvent.INVALIDATE_PROPERTY, propDirty));
1782
- }
1783
-
1784
- /**
1785
- *
1786
- */
1787
- public _iInternalUpdate(): void {
1788
- if (this._iController)
1789
- this._iController.update();
1777
+ for (const key in this._abstractionPool)
1778
+ (<ContainerNode> this._abstractionPool[key]).invalidateHierarchicalProperty(propDirty);
1790
1779
  }
1791
1780
 
1792
1781
  /**
@@ -1862,7 +1851,6 @@ export class DisplayObject extends AssetBase implements IBitmapDrawable, IPartit
1862
1851
  protected _updateMaskMode(): void {
1863
1852
  if (this._maskMode) {
1864
1853
  this._mouseEnabled = false;
1865
- this.partitionClass = BasicPartition;
1866
1854
  }
1867
1855
 
1868
1856
  this._invalidateHierarchicalProperty(HierarchicalProperty.MASK_ID);
@@ -1,6 +1,6 @@
1
1
  import { Point, ArgumentError, RangeError } from '@awayjs/core';
2
2
  import { IAnimator, IRenderContainer } from '@awayjs/renderer';
3
- import { PartitionBase, EntityNode, ContainerEvent, ContainerNode } from '@awayjs/view';
3
+ import { ContainerNode } from '@awayjs/view';
4
4
  import { DisplayObject } from './DisplayObject';
5
5
 
6
6
  /**
@@ -30,7 +30,7 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
30
30
  private static NO_CHILD_ERROR = new ArgumentError('Child parameter is not a child of the caller');
31
31
 
32
32
  private _animator: IAnimator;
33
- protected _children: Array<DisplayObject> = new Array<DisplayObject>();
33
+ protected _children: DisplayObject[] = [];
34
34
 
35
35
  public doingSwap: boolean = false;
36
36
 
@@ -171,7 +171,8 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
171
171
 
172
172
  child._setParent(this);
173
173
 
174
- this.dispatchEvent(new ContainerEvent(ContainerEvent.ADD_CHILD_AT, child, index));
174
+ for (const key in this._abstractionPool)
175
+ (<ContainerNode> this._abstractionPool[key]).addChildAt(child, index);
175
176
 
176
177
  return child;
177
178
  }
@@ -531,7 +532,8 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
531
532
 
532
533
  child._setParent(null);
533
534
 
534
- this.dispatchEvent(new ContainerEvent(ContainerEvent.REMOVE_CHILD_AT, child, index));
535
+ for (const key in this._abstractionPool)
536
+ (<ContainerNode> this._abstractionPool[key]).removeChildAt(index);
535
537
 
536
538
  return child;
537
539
  }
@@ -542,5 +544,4 @@ export class DisplayObjectContainer extends DisplayObject implements IRenderCont
542
544
 
543
545
  super._updateMaskMode();
544
546
  }
545
- }
546
- PartitionBase.registerAbstraction(EntityNode, DisplayObjectContainer);
547
+ }
@@ -1,7 +1,7 @@
1
1
  import { Vector3D, Matrix3D, Box, Sphere } from '@awayjs/core';
2
2
 
3
- import { PickingCollision, PartitionBase, _Pick_PickableBase,
4
- PickEntity, IEntityTraverser, EntityNode, IPartitionEntity } from '@awayjs/view';
3
+ import { PickingCollision, _Pick_PickableBase,
4
+ PickEntity, IEntityTraverser, IEntity } from '@awayjs/view';
5
5
 
6
6
  import { RenderableEvent, IMaterial } from '@awayjs/renderer';
7
7
 
@@ -89,7 +89,7 @@ export class LineSegment extends DisplayObject {
89
89
  this._halfThickness = thickness * 0.5;
90
90
  }
91
91
 
92
- public getEntity(): IPartitionEntity {
92
+ public getEntity(): IEntity {
93
93
  return this;
94
94
  }
95
95
 
@@ -109,7 +109,7 @@ import { _Stage_ElementsBase, _Render_MaterialBase, _Render_RenderableBase,
109
109
  * @class away.pool._Render_LineSegment
110
110
  */
111
111
  export class _Render_LineSegment extends _Render_RenderableBase {
112
- private static _lineGraphics: Object = new Object();
112
+ private static _lineGraphics: Object = {};
113
113
 
114
114
  /**
115
115
  * //TODO
@@ -144,7 +144,7 @@ export class _Render_LineSegment extends _Render_RenderableBase {
144
144
  protected _getRenderMaterial(): _Render_MaterialBase {
145
145
  const material: IMaterial = (<LineSegment> this._asset).material || MaterialUtils.getDefaultColorMaterial();
146
146
  return material.getAbstraction<_Render_MaterialBase>(
147
- this.renderer.getRenderElements(this.stageElements.elements));
147
+ this.entity.renderer.getRenderElements(this.stageElements.elements));
148
148
  }
149
149
 
150
150
  protected _getStyle(): Style {
@@ -254,5 +254,4 @@ export class _Pick_LineSegment extends _Pick_PickableBase {
254
254
  }
255
255
 
256
256
  RenderEntity.registerRenderable(_Render_LineSegment, LineSegment);
257
- PickEntity.registerPickable(_Pick_LineSegment, LineSegment);
258
- PartitionBase.registerAbstraction(EntityNode, LineSegment);
257
+ PickEntity.registerPickable(_Pick_LineSegment, LineSegment);
@@ -1,12 +1,10 @@
1
1
  import { WaveAudio, IAudioChannel, EventBase, BaseAudioChannel } from '@awayjs/core';
2
- import { PartitionBase, EntityNode } from '@awayjs/view';
3
2
  import { IMovieClipAdapter } from '../adapters/IMovieClipAdapter';
4
3
  import { Timeline } from '../base/Timeline';
5
4
  import { MouseEvent } from '../events/MouseEvent';
6
5
  import { FrameScriptManager } from '../managers/FrameScriptManager';
7
6
  import { DisplayObject } from './DisplayObject';
8
7
  import { Sprite } from './Sprite';
9
- import { DisplayObjectContainer } from './DisplayObjectContainer';
10
8
  import { MouseButtons } from '../base/MouseButtons';
11
9
 
12
10
  interface IScene {
@@ -24,7 +22,7 @@ export class MovieClip extends Sprite {
24
22
 
25
23
  public static movieClipSoundsManagerClass = null;
26
24
 
27
- private static _movieClips: Array<MovieClip> = new Array<MovieClip>();
25
+ private static _movieClips: MovieClip[] = [];
28
26
  private static _activeSounds: Record<number, WaveAudio> = {};
29
27
 
30
28
  public static stopSounds(sound?: WaveAudio) {
@@ -870,5 +868,3 @@ export class MovieClip extends Sprite {
870
868
  delete MovieClip._activeSounds[sound.id];
871
869
  }
872
870
  }
873
-
874
- PartitionBase.registerAbstraction(EntityNode, MovieClip);
@@ -2,7 +2,7 @@ import { AssetEvent } from '@awayjs/core';
2
2
 
3
3
  import { BlendMode, ImageCube } from '@awayjs/stage';
4
4
 
5
- import { PickingCollision, PartitionBase, BoundingVolumeType, INode, IPartitionEntity } from '@awayjs/view';
5
+ import { PickingCollision, BoundingVolumeType, INode, IEntity, ContainerNode } from '@awayjs/view';
6
6
 
7
7
  import { IAnimationSet, IMaterial, ITexture, RenderableEvent,
8
8
  MaterialEvent, Style, StyleEvent, IRenderContainer, ImageTextureCube, DefaultRenderer } from '@awayjs/renderer';
@@ -132,7 +132,7 @@ export class Skybox extends DisplayObjectContainer implements IMaterial {
132
132
  }
133
133
  }
134
134
 
135
- public getEntity(): IPartitionEntity {
135
+ public getEntity(): IEntity {
136
136
  return this;
137
137
  }
138
138
 
@@ -247,7 +247,7 @@ export class _Render_SkyboxMaterial extends _Render_MaterialPassBase {
247
247
  public onClear(event: AssetEvent): void {
248
248
  super.onClear(event);
249
249
 
250
- this._texture.onClear(new AssetEvent(AssetEvent.CLEAR, this._skybox.texture));
250
+ this._texture.onClear(null);
251
251
  this._texture = null;
252
252
 
253
253
  this._skybox = null;
@@ -259,10 +259,10 @@ export class _Render_SkyboxMaterial extends _Render_MaterialPassBase {
259
259
  public _pUpdateRender(): void {
260
260
  super._pUpdateRender();
261
261
 
262
- this.requiresBlending = (this._material.blendMode != BlendMode.NORMAL);
262
+ this.requiresBlending = ((<IMaterial> this._asset).blendMode != BlendMode.NORMAL);
263
263
 
264
- this.shader.setBlendMode((this._material.blendMode == BlendMode.NORMAL && this.requiresBlending) ?
265
- BlendMode.LAYER : this._material.blendMode);
264
+ this.shader.setBlendMode(((<IMaterial> this._asset).blendMode == BlendMode.NORMAL && this.requiresBlending) ?
265
+ BlendMode.LAYER : (<IMaterial> this._asset).blendMode);
266
266
  }
267
267
 
268
268
  public _includeDependencies(shader: ShaderBase): void {
@@ -332,7 +332,7 @@ export class _Render_Skybox extends _Render_RenderableBase {
332
332
 
333
333
  protected _getRenderMaterial(): _Render_SkyboxMaterial {
334
334
  return this._asset.getAbstraction<_Render_SkyboxMaterial>(
335
- this.renderer.getRenderElements(this.stageElements.elements));
335
+ this.entity.renderer.getRenderElements(this.stageElements.elements));
336
336
  }
337
337
 
338
338
  protected _getStyle(): Style {
@@ -341,7 +341,7 @@ export class _Render_Skybox extends _Render_RenderableBase {
341
341
  }
342
342
 
343
343
  import { Plane3D } from '@awayjs/core';
344
- import { IEntityTraverser, EntityNode, PickGroup } from '@awayjs/view';
344
+ import { IEntityTraverser, PickGroup } from '@awayjs/view';
345
345
  // import { CacheRenderer } from '@awayjs/renderer';
346
346
 
347
347
  /**
@@ -349,7 +349,7 @@ import { IEntityTraverser, EntityNode, PickGroup } from '@awayjs/view';
349
349
  *
350
350
  * @class away.partition.SkyboxNode
351
351
  */
352
- export class SkyboxNode extends EntityNode {
352
+ export class SkyboxNode extends ContainerNode {
353
353
  /**
354
354
  *
355
355
  * @param planes
@@ -376,5 +376,4 @@ export class SkyboxNode extends EntityNode {
376
376
 
377
377
  //CacheRenderer.registerMaterial(_Render_SkyboxMaterial, Skybox);
378
378
  DefaultRenderer.registerMaterial(_Render_SkyboxMaterial, Skybox);
379
- RenderEntity.registerRenderable(_Render_Skybox, Skybox);
380
- PartitionBase.registerAbstraction(SkyboxNode, Skybox);
379
+ RenderEntity.registerRenderable(_Render_Skybox, Skybox);
@@ -1,5 +1,5 @@
1
1
  import { Vector3D } from '@awayjs/core';
2
- import { EntityNode, IPartitionEntity, PartitionBase } from '@awayjs/view';
2
+ import { IEntity } from '@awayjs/view';
3
3
  import { IMaterial } from '@awayjs/renderer';
4
4
  import { Graphics } from '@awayjs/graphics';
5
5
  import { DisplayObjectContainer } from './DisplayObjectContainer';
@@ -14,7 +14,7 @@ export class Sprite extends DisplayObjectContainer {
14
14
 
15
15
  public _iSourcePrefab: PrefabBase;
16
16
 
17
- private static _sprites: Array<Sprite> = new Array<Sprite>();
17
+ private static _sprites: Sprite[] = [];
18
18
 
19
19
  public static assetType: string = '[asset Sprite]';
20
20
 
@@ -33,7 +33,6 @@ export class Sprite extends DisplayObjectContainer {
33
33
  Sprite._sprites = [];
34
34
  }
35
35
 
36
- private _center: Vector3D;
37
36
  public _graphics: Graphics;
38
37
 
39
38
  /**
@@ -49,10 +48,8 @@ export class Sprite extends DisplayObjectContainer {
49
48
  */
50
49
  public get graphics(): Graphics {
51
50
  //create new graphics object if none exists
52
- if (!this._graphics) {
51
+ if (!this._graphics)
53
52
  this.graphics = Graphics.getGraphics();
54
- this.invalidate();
55
- }
56
53
 
57
54
  return this._graphics;
58
55
  }
@@ -61,17 +58,13 @@ export class Sprite extends DisplayObjectContainer {
61
58
  if (this._graphics == value)
62
59
  return;
63
60
 
64
- if (this._graphics) {
65
- this._graphics.usages--;
66
-
67
- //if (!this._graphics.usages)
68
- // this.graphics.dispose();
69
- }
61
+ if (this._graphics)
62
+ this._graphics.removeOwner(this);
70
63
 
71
64
  this._graphics = value;
72
65
 
73
66
  if (this._graphics)
74
- this._graphics.usages++;
67
+ this._graphics.addOwner(this);
75
68
 
76
69
  this.invalidate();
77
70
  }
@@ -91,7 +84,12 @@ export class Sprite extends DisplayObjectContainer {
91
84
  // this.generateBitmapCache = this.generateBitmapCache.bind(this);
92
85
  }
93
86
 
94
- public getEntity(): IPartitionEntity {
87
+ public getEntity(): IEntity {
88
+ super.getEntity();
89
+
90
+ if (this._iSourcePrefab)
91
+ this._iSourcePrefab._iValidate();
92
+
95
93
  return this._graphics;
96
94
  }
97
95
 
@@ -144,16 +142,6 @@ export class Sprite extends DisplayObjectContainer {
144
142
  this._graphics.copyTo(sprite.graphics, cloneShapes);
145
143
  }
146
144
 
147
- /**
148
- *
149
- */
150
- public _iInternalUpdate(): void {
151
- super._iInternalUpdate();
152
-
153
- if (this._iSourcePrefab)
154
- this._iSourcePrefab._iValidate();
155
- }
156
-
157
145
  /**
158
146
  *
159
147
  */
@@ -161,6 +149,4 @@ export class Sprite extends DisplayObjectContainer {
161
149
  this._graphics.applyTransformation(this.transform.matrix3D);
162
150
  this.transform.clearMatrix3D();
163
151
  }
164
- }
165
-
166
- PartitionBase.registerAbstraction(EntityNode, Sprite);
152
+ }
@@ -2,7 +2,7 @@ import { ColorUtils, Matrix, Rectangle, Point, Vector3D } from '@awayjs/core';
2
2
 
3
3
  import { ImageSampler, Float2Attributes } from '@awayjs/stage';
4
4
 
5
- import { IPartitionEntity } from '@awayjs/view';
5
+ import { IEntity } from '@awayjs/view';
6
6
 
7
7
  import { Style, TriangleElements } from '@awayjs/renderer';
8
8
 
@@ -870,59 +870,6 @@ export class TextField extends DisplayObjectContainer {
870
870
  public get internalScale(): Vector3D {
871
871
  return this._internalScale;
872
872
  }
873
- // public getInternalScale(view:View = null):Vector3D
874
- // {
875
- // if(this.parent)
876
- // this._internalScale.copyFrom(this.parent.transform.concatenatedMatrix3D.decompose()[3]);
877
- // else
878
- // this._internalScale.identity();
879
-
880
- // if (view) {
881
- // this._internalScale.x *= view.focalLength*view.pixelRatio/1000;
882
- // this._internalScale.y *= view.focalLength/1000;
883
- // }
884
-
885
- // this._internalScale.x=1/this._internalScale.x;
886
- // this._internalScale.y=1/this._internalScale.y;
887
- // return this._internalScale;
888
- // }
889
- public _iInternalUpdate(): void {
890
- super._iInternalUpdate();
891
-
892
- //if (!this.inMaskMode) {
893
-
894
- this.reConstruct(true);
895
-
896
- /*if (this._textFormat
897
- && !this._textFormat.font_table.isAsset(TesselatedFontTable)
898
- && !this._textFormat.material) {
899
- // only for FNT font-tables
900
- // todo: do we still need this ?
901
-
902
- this.transform.colorTransform || (this.transform.colorTransform = new ColorTransform());
903
- this.transform.colorTransform.color = (this.textColor != null) ? this.textColor : this._textFormat.color;
904
- this._invalidateHierarchicalProperties(HierarchicalProperties.COLOR_TRANSFORM);
905
- }*/
906
- //}
907
- /*
908
- if (projection) {
909
- this._strokeScale.x = (<PerspectiveProjection> projection).hFocalLength/1000;
910
- this._strokeScale.y = (<PerspectiveProjection> projection).focalLength/1000;
911
- }else{
912
- this._strokeScale.x = 1;
913
- this._strokeScale.y = 1;
914
- }
915
- this._graphics.updateScale(projection);*/
916
-
917
- //const prevScaleX: number = this._internalScale.x;
918
- //const prevScaleY: number = this._internalScale.y;
919
- // var scale:Vector3D = this.getInternalScale(view);
920
- // if (scale.x == prevScaleX && scale.y == prevScaleY)
921
- // return;
922
- // this._internalScale=scale;
923
- // this._glyphsDirty=true;
924
-
925
- }
926
873
 
927
874
  /**
928
875
  *
@@ -1940,7 +1887,10 @@ export class TextField extends DisplayObjectContainer {
1940
1887
  //override for textfield
1941
1888
  }
1942
1889
 
1943
- public getEntity(): IPartitionEntity {
1890
+ public getEntity(): IEntity {
1891
+
1892
+ this.reConstruct(true);
1893
+
1944
1894
  return this._graphics;
1945
1895
  }
1946
1896
 
@@ -1,7 +1,7 @@
1
1
  import { Sprite } from './Sprite';
2
2
  import { TextField } from './TextField';
3
3
  import { TesselatedFontTable } from '../text/TesselatedFontTable';
4
- import { HierarchicalProperty } from '@awayjs/view';
4
+ import { HierarchicalProperty, IEntity } from '@awayjs/view';
5
5
 
6
6
  /**
7
7
  * TextSprite is used for masked text.
@@ -10,8 +10,8 @@ import { HierarchicalProperty } from '@awayjs/view';
10
10
  export class TextSprite extends Sprite {
11
11
  public parentTextField: TextField;
12
12
 
13
- public _iInternalUpdate(): void {
14
- super._iInternalUpdate();
13
+ public getEntity(): IEntity {
14
+
15
15
  const tf: TextField = this.parentTextField;
16
16
  //tf.reConstruct(true);
17
17
 
@@ -19,5 +19,7 @@ export class TextSprite extends Sprite {
19
19
  this.transform.colorTransform.color = (tf.textColor != null) ? tf.textColor : tf._textFormats[0].color;
20
20
  this._invalidateHierarchicalProperty(HierarchicalProperty.COLOR_TRANSFORM);
21
21
  }
22
+
23
+ return this._graphics;
22
24
  }
23
25
  }
@@ -1,6 +1,6 @@
1
1
  import { EventBase } from '@awayjs/core';
2
2
 
3
- import { IPartitionEntity, View, ITraversable, INode, ContainerNode } from '@awayjs/view';
3
+ import { IEntity, View, ITraversable, INode, ContainerNode } from '@awayjs/view';
4
4
  import FrameScriptManager from '../managers/FrameScriptManager';
5
5
  /**
6
6
  * A FocusEvent is dispatched when a entity is focused
@@ -24,12 +24,12 @@ export class FocusEvent extends EventBase {
24
24
  /**
25
25
  * The entity inside which the event took place.
26
26
  */
27
- public entity: IPartitionEntity;
27
+ public entity: IEntity;
28
28
 
29
29
  /**
30
30
  * True if the focus was set by mouse-interaction
31
31
  */
32
- public invokedByMouse: IPartitionEntity;
32
+ public invokedByMouse: IEntity;
33
33
 
34
34
  /**
35
35
  * The traversable owner inside which the event took place.
@@ -63,7 +63,7 @@ export class FocusEvent extends EventBase {
63
63
  return result;
64
64
  }
65
65
 
66
- public _dispatchEvent(dispatcher: ContainerNode) {
66
+ public _dispatchEvent(dispatcher: INode) {
67
67
  dispatcher.container.dispatchEvent(this);
68
68
  FrameScriptManager.execute_queue();
69
69
  }
@@ -1,4 +1,4 @@
1
- import { ContainerNode, IPartitionContainer } from '@awayjs/view';
1
+ import { ContainerNode, IContainer } from '@awayjs/view';
2
2
 
3
3
  import FrameScriptManager from '../managers/FrameScriptManager';
4
4
  import { MouseButtons } from '../base/MouseButtons';
@@ -136,7 +136,7 @@ export class MouseEvent extends PointerEvent {
136
136
  return result;
137
137
  }
138
138
 
139
- public _dispatchEvent(dispatcher: ContainerNode, target: IPartitionContainer) {
139
+ public _dispatchEvent(dispatcher: ContainerNode, target: IContainer) {
140
140
  if (!dispatcher.isMouseDisabled() || this.type == MouseEvent.MOUSE_OUT || this.type == MouseEvent.ROLL_OUT) {
141
141
  dispatcher.container.dispatchEvent(this, target);
142
142
  FrameScriptManager.execute_queue();
@@ -1,6 +1,6 @@
1
1
  import { Point, Vector3D, EventBase } from '@awayjs/core';
2
2
 
3
- import { ContainerNode, INode, ITraversable, View, IPartitionContainer } from '@awayjs/view';
3
+ import { ContainerNode, INode, ITraversable, View, IContainer } from '@awayjs/view';
4
4
 
5
5
  import { IMaterial } from '@awayjs/renderer';
6
6
 
@@ -36,7 +36,7 @@ export class PointerEvent extends EventBase {
36
36
  /**
37
37
  * The entity of the picker inside which the event took place.
38
38
  */
39
- public rootNode: ContainerNode;
39
+ public rootNode: INode;
40
40
 
41
41
  /**
42
42
  * The traversable owner inside which the event took place.
@@ -141,6 +141,6 @@ export class PointerEvent extends EventBase {
141
141
  return sceneNormal;
142
142
  }
143
143
 
144
- public _dispatchEvent(dispatcher: ContainerNode, target: IPartitionContainer) {
144
+ public _dispatchEvent(dispatcher: INode, target: IContainer) {
145
145
  }
146
146
  }
@@ -1,4 +1,4 @@
1
- import { ContainerNode, IPartitionContainer } from '@awayjs/view';
1
+ import { ContainerNode, IContainer } from '@awayjs/view';
2
2
 
3
3
  import FrameScriptManager from '../managers/FrameScriptManager';
4
4
  import { PointerEvent } from './PointerEvent';
@@ -95,7 +95,7 @@ export class TouchEvent extends PointerEvent {
95
95
  return result;
96
96
  }
97
97
 
98
- public _dispatchEvent(dispatcher: ContainerNode, target: IPartitionContainer) {
98
+ public _dispatchEvent(dispatcher: ContainerNode, target: IContainer) {
99
99
  if (!dispatcher.isMouseDisabled() || this.type == TouchEvent.TOUCH_OUT || this.type == TouchEvent.TOUCH_ROLL_OUT) {
100
100
  dispatcher.container.dispatchEvent(this, target);
101
101
  FrameScriptManager.execute_queue();
@@ -191,7 +191,7 @@ export class SceneImage2D extends BitmapImage2D {
191
191
  SceneImage2D._rootNode = SceneImage2D._view.getNode(SceneImage2D._root);
192
192
  SceneImage2D._renderer = <DefaultRenderer> RenderGroup
193
193
  .getInstance(DefaultRenderer)
194
- .getRenderer(SceneImage2D._rootNode.partition);
194
+ .getRenderer(SceneImage2D._rootNode);
195
195
 
196
196
  //set the view properties
197
197
  SceneImage2D._view.backgroundAlpha = 0;
@@ -218,7 +218,7 @@ export class SceneImage2D extends BitmapImage2D {
218
218
  SceneImage2D._billboardRoot = new DisplayObjectContainer();
219
219
  SceneImage2D._billboardRenderer = <DefaultRenderer> RenderGroup
220
220
  .getInstance(DefaultRenderer)
221
- .getRenderer(SceneImage2D._billboardView.getNode(SceneImage2D._billboardRoot).partition);
221
+ .getRenderer(SceneImage2D._billboardView.getNode(SceneImage2D._billboardRoot));
222
222
 
223
223
  //SceneImage2D._billboardRoot.partition = SceneImage2D._billboardRenderer.partition;
224
224