@awayjs/scene 0.13.245 → 0.13.247
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/bundle/awayjs-scene.umd.js +98 -124
- package/bundle/awayjs-scene.umd.js.map +1 -1
- package/bundle/awayjs-scene.umd.min.js.map +1 -1
- package/bundle/awayjs-scene.umd.min.js.map.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/base/Timeline.d.ts +4 -6
- package/dist/lib/base/Timeline.d.ts.map +1 -1
- package/dist/lib/base/Timeline.js +7 -19
- package/dist/lib/display/Billboard.d.ts +2 -2
- package/dist/lib/display/Billboard.d.ts.map +1 -1
- package/dist/lib/display/Billboard.js +2 -2
- package/dist/lib/display/Camera.d.ts +0 -1
- package/dist/lib/display/Camera.d.ts.map +1 -1
- package/dist/lib/display/Camera.js +0 -3
- package/dist/lib/display/DisplayObject.d.ts +31 -7
- package/dist/lib/display/DisplayObject.d.ts.map +1 -1
- package/dist/lib/display/DisplayObject.js +41 -7
- package/dist/lib/display/DisplayObjectContainer.d.ts +2 -24
- package/dist/lib/display/DisplayObjectContainer.d.ts.map +1 -1
- package/dist/lib/display/DisplayObjectContainer.js +5 -37
- package/dist/lib/display/LineSegment.d.ts +2 -2
- package/dist/lib/display/LineSegment.d.ts.map +1 -1
- package/dist/lib/display/LineSegment.js +2 -2
- package/dist/lib/display/MorphSprite.d.ts.map +1 -1
- package/dist/lib/display/MorphSprite.js +1 -3
- package/dist/lib/display/MovieClip.d.ts +2 -2
- package/dist/lib/display/MovieClip.d.ts.map +1 -1
- package/dist/lib/display/MovieClip.js +2 -5
- package/dist/lib/display/Skybox.d.ts +3 -2
- package/dist/lib/display/Skybox.d.ts.map +1 -1
- package/dist/lib/display/Skybox.js +3 -2
- package/dist/lib/display/Sprite.d.ts +2 -3
- package/dist/lib/display/Sprite.d.ts.map +1 -1
- package/dist/lib/display/Sprite.js +4 -12
- package/dist/lib/display/TextField.d.ts +2 -3
- package/dist/lib/display/TextField.d.ts.map +1 -1
- package/dist/lib/display/TextField.js +11 -18
- package/dist/lib/events/MouseEvent.d.ts +3 -3
- package/dist/lib/events/MouseEvent.d.ts.map +1 -1
- package/dist/lib/events/MouseEvent.js +3 -3
- package/dist/lib/factories/DefaultSceneGraphFactory.d.ts +7 -4
- package/dist/lib/factories/DefaultSceneGraphFactory.d.ts.map +1 -1
- package/dist/lib/factories/DefaultSceneGraphFactory.js +10 -4
- package/dist/lib/factories/ISceneGraphFactory.d.ts +7 -8
- package/dist/lib/factories/ISceneGraphFactory.d.ts.map +1 -1
- package/dist/lib/managers/MouseManager.d.ts.map +1 -1
- package/dist/lib/managers/MouseManager.js +7 -7
- package/index.ts +1 -2
- package/lib/base/Timeline.ts +9 -21
- package/lib/display/Billboard.ts +3 -2
- package/lib/display/Camera.ts +0 -4
- package/lib/display/DisplayObject.ts +48 -12
- package/lib/display/DisplayObjectContainer.ts +6 -38
- package/lib/display/LineSegment.ts +3 -3
- package/lib/display/MorphSprite.ts +2 -5
- package/lib/display/MovieClip.ts +4 -4
- package/lib/display/Skybox.ts +5 -3
- package/lib/display/Sprite.ts +5 -16
- package/lib/display/TextField.ts +12 -21
- package/lib/events/MouseEvent.ts +5 -5
- package/lib/factories/DefaultSceneGraphFactory.ts +12 -8
- package/lib/factories/ISceneGraphFactory.ts +9 -9
- package/lib/managers/MouseManager.ts +8 -9
- package/package.json +1 -1
- package/dist/lib/base/ISymbolDecoder.d.ts +0 -8
- package/dist/lib/base/ISymbolDecoder.d.ts.map +0 -1
- package/dist/lib/base/ISymbolDecoder.js +0 -0
- package/lib/base/ISymbolDecoder.ts +0 -11
package/lib/events/MouseEvent.ts
CHANGED
|
@@ -121,9 +121,9 @@ export class MouseEvent extends EventBase {
|
|
|
121
121
|
public view: View;
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* The
|
|
124
|
+
* The container inside which the event took place.
|
|
125
125
|
*/
|
|
126
|
-
public
|
|
126
|
+
public containerNode: ContainerNode;
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* The entity of the picker inside which the event took place.
|
|
@@ -241,7 +241,7 @@ export class MouseEvent extends EventBase {
|
|
|
241
241
|
result.screenY = this.screenY;
|
|
242
242
|
|
|
243
243
|
result.view = this.view;
|
|
244
|
-
result.
|
|
244
|
+
result.containerNode = this.containerNode;
|
|
245
245
|
result.rootNode = this.rootNode;
|
|
246
246
|
result.traversable = this.traversable;
|
|
247
247
|
result.material = this.material;
|
|
@@ -265,14 +265,14 @@ export class MouseEvent extends EventBase {
|
|
|
265
265
|
* The position in scene space where the event took place
|
|
266
266
|
*/
|
|
267
267
|
public get scenePosition(): Vector3D {
|
|
268
|
-
return this.
|
|
268
|
+
return this.containerNode.getMatrix3D().transformVector(this.position);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* The normal in scene space where the event took place
|
|
273
273
|
*/
|
|
274
274
|
public get sceneNormal(): Vector3D {
|
|
275
|
-
const sceneNormal: Vector3D = this.
|
|
275
|
+
const sceneNormal: Vector3D = this.containerNode.getMatrix3D().deltaTransformVector(this.normal);
|
|
276
276
|
sceneNormal.normalize();
|
|
277
277
|
|
|
278
278
|
return sceneNormal;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { IAsset } from '@awayjs/core';
|
|
2
|
+
import { Image2D, DefaultStageFactory } from '@awayjs/stage';
|
|
3
3
|
import { IMaterial } from '@awayjs/renderer';
|
|
4
|
-
|
|
4
|
+
import { Graphics } from '@awayjs/graphics';
|
|
5
5
|
import { MethodMaterial } from '@awayjs/materials';
|
|
6
6
|
|
|
7
7
|
import { Timeline } from '../base/Timeline';
|
|
8
|
+
import { IFrameScript } from '../base/IFrameScript';
|
|
8
9
|
import { Billboard } from '../display/Billboard';
|
|
9
10
|
import { TextField } from '../display/TextField';
|
|
10
11
|
import { MovieClip } from '../display/MovieClip';
|
|
11
12
|
import { Sprite } from '../display/Sprite';
|
|
12
13
|
import { DisplayObjectContainer } from '../display/DisplayObjectContainer';
|
|
13
14
|
import { PrefabBase } from '../prefabs/PrefabBase';
|
|
14
|
-
|
|
15
15
|
import { ISceneGraphFactory } from './ISceneGraphFactory';
|
|
16
|
-
import { Graphics } from '@awayjs/graphics';
|
|
17
|
-
import { IFrameScript } from '../base/IFrameScript';
|
|
18
16
|
|
|
19
|
-
export class DefaultSceneGraphFactory extends
|
|
17
|
+
export class DefaultSceneGraphFactory extends DefaultStageFactory implements ISceneGraphFactory {
|
|
18
|
+
|
|
19
|
+
readonly awaySymbols: NumberMap<IAsset> = {};
|
|
20
20
|
|
|
21
21
|
createMovieClip(timeline: Timeline = null, symbol: any = null): MovieClip {
|
|
22
|
-
return new MovieClip(timeline);
|
|
22
|
+
return new MovieClip(timeline || new Timeline(this));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
createSprite(prefab: PrefabBase = null, graphics: Graphics = null, symbol: any = null): Sprite {
|
|
@@ -50,4 +50,8 @@ export class DefaultSceneGraphFactory extends DefaultGraphicsFactory implements
|
|
|
50
50
|
createFrameScripts(scripts: IFrameScript[], frameIdx: number, objName: string, objID: number): IFrameScript[] {
|
|
51
51
|
throw ('[DefaultSceneGraphFactory] - createFrameScripts should be overwritten by AVM');
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
createChildInstanceForTimeline(timeline: Timeline, symbolID: number, sessionID: number): IAsset {
|
|
55
|
+
throw ('[DefaultSceneGraphFactory] - createChildInstanceForTimeline should be overwritten by AVM');
|
|
56
|
+
}
|
|
53
57
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IMaterial } from '@awayjs/renderer';
|
|
1
|
+
import { IAsset } from '@awayjs/core';
|
|
2
|
+
import { IMaterial, IMaterialFactory } from '@awayjs/renderer';
|
|
3
|
+
import { Graphics } from '@awayjs/graphics';
|
|
4
|
+
|
|
3
5
|
import { Timeline } from '../base/Timeline';
|
|
6
|
+
import { IFrameScript } from '../base/IFrameScript';
|
|
4
7
|
import { Billboard } from '../display/Billboard';
|
|
5
8
|
import { TextField } from '../display/TextField';
|
|
6
9
|
import { MovieClip } from '../display/MovieClip';
|
|
7
10
|
import { Sprite } from '../display/Sprite';
|
|
8
|
-
import { PrefabBase } from '../prefabs/PrefabBase';
|
|
9
11
|
import { DisplayObjectContainer } from '../display/DisplayObjectContainer';
|
|
10
|
-
import {
|
|
11
|
-
import { IFrameScript } from '../base/IFrameScript';
|
|
12
|
+
import { PrefabBase } from '../prefabs/PrefabBase';
|
|
12
13
|
|
|
13
|
-
export interface ISceneGraphFactory extends
|
|
14
|
+
export interface ISceneGraphFactory extends IMaterialFactory
|
|
14
15
|
{
|
|
15
16
|
createMovieClip(timelime?: Timeline, symbol?: any): MovieClip;
|
|
16
17
|
|
|
@@ -22,8 +23,7 @@ export interface ISceneGraphFactory extends IGraphicsFactory
|
|
|
22
23
|
|
|
23
24
|
createBillboard(material?: IMaterial, symbol?: any): Billboard;
|
|
24
25
|
|
|
25
|
-
createMaterial(image?: Image2D, alpha?: number, symbol?: any): IMaterial;
|
|
26
|
-
createMaterial(color?: number, alpha?: number, symbol?: any): IMaterial;
|
|
27
|
-
|
|
28
26
|
createFrameScripts(scripts: IFrameScript[], frameIdx: number, objName: string, objID: number): IFrameScript[];
|
|
27
|
+
|
|
28
|
+
createChildInstanceForTimeline(timeline: Timeline, symbolID: number, sessionID: number): IAsset;
|
|
29
29
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Vector3D } from '@awayjs/core';
|
|
2
2
|
import { Stage } from '@awayjs/stage';
|
|
3
3
|
|
|
4
|
-
import { PickingCollision, RaycastPicker, ContainerNode
|
|
4
|
+
import { PickingCollision, RaycastPicker, ContainerNode } from '@awayjs/view';
|
|
5
5
|
import { FocusEvent } from '../events/FocusEvent';
|
|
6
6
|
|
|
7
7
|
import { KeyboardEvent } from '../events/KeyboardEvent';
|
|
8
8
|
import { MouseEvent as AwayMouseEvent } from '../events/MouseEvent';
|
|
9
|
-
import { FrameScriptManager } from './FrameScriptManager';
|
|
10
9
|
|
|
11
10
|
import { IInputRecorder } from './IInputRecorder';
|
|
12
11
|
|
|
@@ -348,13 +347,13 @@ export class MouseManager {
|
|
|
348
347
|
// @todo: at this point the object under the mouse might have been changed,
|
|
349
348
|
// so we need to recheck the collision ?
|
|
350
349
|
|
|
351
|
-
let
|
|
350
|
+
let upContainerNode: ContainerNode = null;
|
|
352
351
|
let upRootNode: ContainerNode = null;
|
|
353
352
|
if (this._isAVM1Dragging && this._mouseDragCollision) {
|
|
354
353
|
// avm1dragging is in process, dispatch the mouse-up on this.
|
|
355
354
|
// mouseDragEntity instead of the current collision
|
|
356
355
|
upRootNode = this._mouseDragCollision.rootNode;
|
|
357
|
-
|
|
356
|
+
upContainerNode = this._mouseDragCollision.containerNode;
|
|
358
357
|
} else if (this._mouseDragging && this._mouseDragCollision
|
|
359
358
|
&& this._mouseDragCollision.rootNode != dispatcher) {
|
|
360
359
|
// no avm1dragging is in process, but current collision
|
|
@@ -371,13 +370,13 @@ export class MouseManager {
|
|
|
371
370
|
// but current collision is not the same as collision that appeared on mouse-down,
|
|
372
371
|
// need to dispatch a MOUSE_UP_OUTSIDE on _mouseDragEntity
|
|
373
372
|
upRootNode = this._mouseDragCollision.rootNode;
|
|
374
|
-
|
|
373
|
+
upContainerNode = this._mouseDragCollision.containerNode;
|
|
375
374
|
}
|
|
376
375
|
|
|
377
376
|
if (this._mouseDragging && dispatcher)
|
|
378
377
|
this.setupAndDispatchEvent(this._mouseOver, event, collision);
|
|
379
378
|
|
|
380
|
-
if (this._isTouch &&
|
|
379
|
+
if (this._isTouch && upContainerNode)
|
|
381
380
|
this.setupAndDispatchEvent(this._mouseOut, this._mouseMoveEvent, this._mouseDragCollision);
|
|
382
381
|
|
|
383
382
|
if (upRootNode) {
|
|
@@ -388,7 +387,7 @@ export class MouseManager {
|
|
|
388
387
|
else if (this._eventBubbling)
|
|
389
388
|
this._stage.dispatchEvent(event);
|
|
390
389
|
|
|
391
|
-
if (
|
|
390
|
+
if (upContainerNode)
|
|
392
391
|
this.setupAndDispatchEvent(this._dragStop, event, this._mouseDragCollision);
|
|
393
392
|
|
|
394
393
|
this._mouseDragCollision = null;
|
|
@@ -688,7 +687,7 @@ export class MouseManager {
|
|
|
688
687
|
|
|
689
688
|
// 3D properties.
|
|
690
689
|
if (collision) {
|
|
691
|
-
event.
|
|
690
|
+
event.containerNode = collision.containerNode;
|
|
692
691
|
|
|
693
692
|
event.rootNode = collision.rootNode;
|
|
694
693
|
// Object.
|
|
@@ -703,7 +702,7 @@ export class MouseManager {
|
|
|
703
702
|
event.elementIndex = collision.elementIndex;
|
|
704
703
|
} else {
|
|
705
704
|
// Set all to null.
|
|
706
|
-
event.
|
|
705
|
+
event.containerNode = null;
|
|
707
706
|
event.rootNode = null;
|
|
708
707
|
event.traversable = null;
|
|
709
708
|
event.uv = null;
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IAsset } from '@awayjs/core';
|
|
2
|
-
import { IFrameScript } from './IFrameScript';
|
|
3
|
-
import { Timeline } from './Timeline';
|
|
4
|
-
export interface ISymbolDecoder {
|
|
5
|
-
createChildInstanceForTimeline(timeline: Timeline, symbolID: number, sessionID: number): IAsset;
|
|
6
|
-
prepareFrameScriptsForAVM1(source: IFrameScript[], frameIdx: number, objName: string, objID: number): IFrameScript[];
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ISymbolDecoder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ISymbolDecoder.d.ts","sourceRoot":"","sources":["../../../lib/base/ISymbolDecoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,cAAc;IAE9B,8BAA8B,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAEhG,0BAA0B,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,EAClE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAAC;CACjD"}
|
|
File without changes
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IAsset } from '@awayjs/core';
|
|
2
|
-
import { IFrameScript } from './IFrameScript';
|
|
3
|
-
import { Timeline } from './Timeline';
|
|
4
|
-
|
|
5
|
-
export interface ISymbolDecoder {
|
|
6
|
-
|
|
7
|
-
createChildInstanceForTimeline(timeline: Timeline, symbolID: number, sessionID: number): IAsset;
|
|
8
|
-
|
|
9
|
-
prepareFrameScriptsForAVM1(source: IFrameScript[], frameIdx: number,
|
|
10
|
-
objName: string, objID: number): IFrameScript[];
|
|
11
|
-
}
|