@antv/g 1.0.0-alpha.20 → 1.0.0-alpha.24
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/es/Canvas.d.ts +40 -18
- package/es/Canvas.js +121 -65
- package/es/DisplayObjectPool.d.ts +2 -1
- package/es/DisplayObjectPool.js +4 -0
- package/{lib → es/camera}/Camera.d.ts +6 -3
- package/es/{Camera.js → camera/Camera.js} +22 -16
- package/es/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/es/{Landmark.js → camera/Landmark.js} +1 -1
- package/es/camera/index.d.ts +2 -0
- package/es/camera/index.js +2 -0
- package/es/components/Cullable.js +1 -1
- package/es/components/Geometry.d.ts +8 -1
- package/es/components/Renderable.d.ts +9 -8
- package/es/components/Renderable.js +2 -6
- package/es/components/Sortable.d.ts +6 -2
- package/es/display-objects/Circle.d.ts +2 -3
- package/es/display-objects/Circle.js +2 -5
- package/es/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/es/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{lib → es/display-objects}/DisplayObject.d.ts +136 -141
- package/es/{DisplayObject.js → display-objects/DisplayObject.js} +408 -292
- package/es/display-objects/Ellipse.d.ts +2 -3
- package/es/display-objects/Ellipse.js +2 -5
- package/es/display-objects/Group.d.ts +2 -1
- package/es/display-objects/Group.js +13 -5
- package/es/display-objects/HTML.d.ts +2 -2
- package/es/display-objects/HTML.js +4 -7
- package/es/display-objects/Image.d.ts +2 -2
- package/es/display-objects/Image.js +2 -6
- package/es/display-objects/Line.d.ts +2 -2
- package/es/display-objects/Line.js +8 -8
- package/es/display-objects/Path.d.ts +3 -2
- package/es/display-objects/Path.js +8 -8
- package/es/display-objects/Polygon.d.ts +2 -2
- package/es/display-objects/Polygon.js +2 -6
- package/es/display-objects/Polyline.d.ts +2 -2
- package/es/display-objects/Polyline.js +8 -8
- package/es/display-objects/Rect.d.ts +2 -2
- package/es/display-objects/Rect.js +2 -6
- package/es/display-objects/Text.d.ts +2 -3
- package/es/display-objects/Text.js +8 -7
- package/es/display-objects/index.d.ts +2 -0
- package/es/display-objects/index.js +2 -0
- package/es/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/es/{Animation.js → dom/Animation.js} +2 -3
- package/{lib → es/dom}/AnimationEffectTiming.d.ts +2 -0
- package/es/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -2
- package/es/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/es/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/es/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/es/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/es/dom/CustomElementRegistry.d.ts +15 -0
- package/es/dom/CustomElementRegistry.js +40 -0
- package/{lib → es/dom}/CustomEvent.d.ts +1 -1
- package/es/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/es/dom/Document.d.ts +36 -17
- package/es/dom/Document.js +98 -14
- package/es/dom/Element.d.ts +71 -92
- package/es/dom/Element.js +179 -195
- package/es/dom/EventTarget.d.ts +11 -6
- package/es/dom/EventTarget.js +12 -4
- package/es/dom/FederatedEvent.d.ts +15 -7
- package/es/dom/FederatedEvent.js +33 -0
- package/es/dom/FederatedMouseEvent.d.ts +1 -1
- package/es/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/es/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/es/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/es/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/es/dom/Node.d.ts +38 -23
- package/es/dom/Node.js +37 -33
- package/es/dom/index.d.ts +15 -2
- package/es/dom/index.js +16 -3
- package/es/dom/interfaces.d.ts +301 -0
- package/es/dom/interfaces.js +1 -0
- package/es/global-module.d.ts +0 -2
- package/es/global-module.js +31 -29
- package/es/index.d.ts +7 -14
- package/es/index.js +8 -15
- package/es/plugins/CullingPlugin.d.ts +2 -2
- package/es/plugins/CullingPlugin.js +13 -16
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/es/plugins/DirtyCheckPlugin.js +8 -7
- package/es/plugins/EventPlugin.js +52 -31
- package/es/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/es/plugins/FrustumCullingStrategy.js +5 -4
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/es/plugins/PrepareRendererPlugin.js +42 -38
- package/es/property-handlers/aabb.d.ts +2 -3
- package/es/property-handlers/aabb.js +29 -21
- package/es/property-handlers/anchor.d.ts +3 -0
- package/es/property-handlers/anchor.js +21 -0
- package/es/property-handlers/clipPath.d.ts +1 -1
- package/es/property-handlers/clipPath.js +3 -4
- package/es/property-handlers/color.d.ts +1 -1
- package/es/property-handlers/dimension.d.ts +1 -1
- package/es/property-handlers/dimension.js +6 -9
- package/es/property-handlers/filter.d.ts +1 -1
- package/es/property-handlers/index.d.ts +5 -4
- package/es/property-handlers/index.js +1 -0
- package/es/property-handlers/localPosition.d.ts +1 -1
- package/es/property-handlers/localPosition.js +1 -6
- package/es/property-handlers/offsetDistance.d.ts +1 -1
- package/es/property-handlers/offsetPath.d.ts +1 -1
- package/es/property-handlers/origin.d.ts +1 -1
- package/es/property-handlers/origin.js +9 -2
- package/es/property-handlers/path.d.ts +2 -2
- package/es/property-handlers/path.js +8 -4
- package/es/property-handlers/points.d.ts +1 -1
- package/es/property-handlers/transform.d.ts +1 -1
- package/es/property-handlers/zIndex.d.ts +1 -1
- package/es/services/ContextService.d.ts +3 -2
- package/es/services/EventService.d.ts +18 -13
- package/es/services/EventService.js +604 -384
- package/es/services/RenderingContext.d.ts +1 -1
- package/es/services/RenderingService.d.ts +23 -29
- package/es/services/RenderingService.js +63 -54
- package/es/services/SceneGraphSelector.d.ts +7 -7
- package/es/services/SceneGraphSelector.js +10 -6
- package/es/services/SceneGraphService.d.ts +73 -78
- package/es/services/SceneGraphService.js +165 -78
- package/es/services/aabb/PathUpdater.d.ts +1 -1
- package/es/services/aabb/RectUpdater.d.ts +2 -2
- package/es/services/aabb/interfaces.d.ts +1 -1
- package/es/shapes/Point.d.ts +4 -0
- package/es/shapes/Polygon.d.ts +9 -0
- package/es/shapes/Polygon.js +62 -0
- package/es/shapes/index.d.ts +1 -0
- package/es/shapes/index.js +2 -1
- package/es/types.d.ts +18 -6
- package/es/utils/animation.d.ts +1 -2
- package/es/utils/animation.js +5 -10
- package/es/utils/canvas.d.ts +1 -1
- package/es/utils/custom-easing.d.ts +3 -2
- package/es/utils/custom-easing.js +12 -6
- package/es/utils/event.js +1 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.d.ts +3 -4
- package/es/utils/interpolation.js +0 -16
- package/es/utils/path.d.ts +2 -2
- package/lib/Canvas.d.ts +40 -18
- package/lib/Canvas.js +131 -74
- package/lib/DisplayObjectPool.d.ts +2 -1
- package/lib/DisplayObjectPool.js +4 -0
- package/{es → lib/camera}/Camera.d.ts +6 -3
- package/lib/{Camera.js → camera/Camera.js} +25 -20
- package/lib/{Landmark.d.ts → camera/Landmark.d.ts} +2 -2
- package/lib/{Landmark.js → camera/Landmark.js} +2 -3
- package/lib/camera/index.d.ts +2 -0
- package/lib/camera/index.js +31 -0
- package/lib/components/Cullable.js +1 -1
- package/lib/components/Geometry.d.ts +8 -1
- package/lib/components/Renderable.d.ts +9 -8
- package/lib/components/Renderable.js +2 -6
- package/lib/components/Sortable.d.ts +6 -2
- package/lib/display-objects/Circle.d.ts +2 -3
- package/lib/display-objects/Circle.js +3 -6
- package/lib/{CustomElement.d.ts → display-objects/CustomElement.d.ts} +1 -1
- package/lib/{CustomElement.js → display-objects/CustomElement.js} +22 -12
- package/{es → lib/display-objects}/DisplayObject.d.ts +136 -141
- package/lib/{DisplayObject.js → display-objects/DisplayObject.js} +418 -299
- package/lib/display-objects/Ellipse.d.ts +2 -3
- package/lib/display-objects/Ellipse.js +3 -6
- package/lib/display-objects/Group.d.ts +2 -1
- package/lib/display-objects/Group.js +12 -4
- package/lib/display-objects/HTML.d.ts +2 -2
- package/lib/display-objects/HTML.js +4 -7
- package/lib/display-objects/Image.d.ts +2 -2
- package/lib/display-objects/Image.js +2 -6
- package/lib/display-objects/Line.d.ts +2 -2
- package/lib/display-objects/Line.js +8 -8
- package/lib/display-objects/Path.d.ts +3 -2
- package/lib/display-objects/Path.js +8 -8
- package/lib/display-objects/Polygon.d.ts +2 -2
- package/lib/display-objects/Polygon.js +2 -6
- package/lib/display-objects/Polyline.d.ts +2 -2
- package/lib/display-objects/Polyline.js +8 -8
- package/lib/display-objects/Rect.d.ts +2 -2
- package/lib/display-objects/Rect.js +2 -6
- package/lib/display-objects/Text.d.ts +2 -3
- package/lib/display-objects/Text.js +9 -8
- package/lib/display-objects/index.d.ts +2 -0
- package/lib/display-objects/index.js +26 -0
- package/lib/{Animation.d.ts → dom/Animation.d.ts} +3 -3
- package/lib/{Animation.js → dom/Animation.js} +2 -3
- package/{es → lib/dom}/AnimationEffectTiming.d.ts +2 -0
- package/lib/{AnimationEffectTiming.js → dom/AnimationEffectTiming.js} +3 -3
- package/lib/{AnimationEvent.d.ts → dom/AnimationEvent.d.ts} +3 -2
- package/lib/{AnimationEvent.js → dom/AnimationEvent.js} +1 -1
- package/lib/{Timeline.d.ts → dom/AnimationTimeline.d.ts} +1 -1
- package/lib/{Timeline.js → dom/AnimationTimeline.js} +1 -1
- package/lib/dom/CustomElementRegistry.d.ts +15 -0
- package/lib/dom/CustomElementRegistry.js +48 -0
- package/{es → lib/dom}/CustomEvent.d.ts +1 -1
- package/lib/{CustomEvent.js → dom/CustomEvent.js} +1 -1
- package/lib/dom/Document.d.ts +36 -17
- package/lib/dom/Document.js +99 -15
- package/lib/dom/Element.d.ts +71 -92
- package/lib/dom/Element.js +180 -198
- package/lib/dom/EventTarget.d.ts +11 -6
- package/lib/dom/EventTarget.js +20 -10
- package/lib/dom/FederatedEvent.d.ts +15 -7
- package/lib/dom/FederatedEvent.js +33 -0
- package/lib/dom/FederatedMouseEvent.d.ts +1 -1
- package/lib/{KeyframeEffect.d.ts → dom/KeyframeEffect.d.ts} +16 -5
- package/lib/{KeyframeEffect.js → dom/KeyframeEffect.js} +50 -4
- package/lib/{KeyframeList.d.ts → dom/KeyframeList.d.ts} +1 -1
- package/lib/{KeyframeList.js → dom/KeyframeList.js} +0 -0
- package/lib/dom/Node.d.ts +38 -23
- package/lib/dom/Node.js +37 -33
- package/lib/dom/index.d.ts +15 -2
- package/lib/dom/index.js +177 -8
- package/lib/dom/interfaces.d.ts +301 -0
- package/lib/dom/interfaces.js +5 -0
- package/lib/global-module.d.ts +0 -2
- package/lib/global-module.js +30 -30
- package/lib/index.d.ts +7 -14
- package/lib/index.js +44 -135
- package/lib/plugins/CullingPlugin.d.ts +2 -2
- package/lib/plugins/CullingPlugin.js +14 -16
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
- package/lib/plugins/DirtyCheckPlugin.js +9 -7
- package/lib/plugins/EventPlugin.js +52 -30
- package/lib/plugins/FrustumCullingStrategy.d.ts +1 -1
- package/lib/plugins/FrustumCullingStrategy.js +5 -4
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
- package/lib/plugins/PrepareRendererPlugin.js +41 -37
- package/lib/property-handlers/aabb.d.ts +2 -3
- package/lib/property-handlers/aabb.js +28 -22
- package/lib/property-handlers/anchor.d.ts +3 -0
- package/lib/property-handlers/anchor.js +34 -0
- package/lib/property-handlers/clipPath.d.ts +1 -1
- package/lib/property-handlers/clipPath.js +3 -4
- package/lib/property-handlers/color.d.ts +1 -1
- package/lib/property-handlers/dimension.d.ts +1 -1
- package/lib/property-handlers/dimension.js +6 -9
- package/lib/property-handlers/filter.d.ts +1 -1
- package/lib/property-handlers/index.d.ts +5 -4
- package/lib/property-handlers/index.js +14 -0
- package/lib/property-handlers/localPosition.d.ts +1 -1
- package/lib/property-handlers/localPosition.js +1 -7
- package/lib/property-handlers/offsetDistance.d.ts +1 -1
- package/lib/property-handlers/offsetPath.d.ts +1 -1
- package/lib/property-handlers/origin.d.ts +1 -1
- package/lib/property-handlers/origin.js +10 -2
- package/lib/property-handlers/path.d.ts +2 -2
- package/lib/property-handlers/path.js +8 -4
- package/lib/property-handlers/points.d.ts +1 -1
- package/lib/property-handlers/transform.d.ts +1 -1
- package/lib/property-handlers/zIndex.d.ts +1 -1
- package/lib/services/ContextService.d.ts +3 -2
- package/lib/services/EventService.d.ts +18 -13
- package/lib/services/EventService.js +616 -385
- package/lib/services/RenderingContext.d.ts +1 -1
- package/lib/services/RenderingService.d.ts +23 -29
- package/lib/services/RenderingService.js +66 -56
- package/lib/services/SceneGraphSelector.d.ts +7 -7
- package/lib/services/SceneGraphSelector.js +10 -6
- package/lib/services/SceneGraphService.d.ts +73 -78
- package/lib/services/SceneGraphService.js +166 -79
- package/lib/services/aabb/PathUpdater.d.ts +1 -1
- package/lib/services/aabb/RectUpdater.d.ts +2 -2
- package/lib/services/aabb/interfaces.d.ts +1 -1
- package/lib/shapes/Point.d.ts +4 -0
- package/lib/shapes/Polygon.d.ts +9 -0
- package/lib/shapes/Polygon.js +69 -0
- package/lib/shapes/index.d.ts +1 -0
- package/lib/shapes/index.js +13 -0
- package/lib/types.d.ts +18 -6
- package/lib/utils/animation.d.ts +1 -2
- package/lib/utils/animation.js +8 -16
- package/lib/utils/canvas.d.ts +1 -1
- package/lib/utils/custom-easing.d.ts +3 -2
- package/lib/utils/custom-easing.js +16 -8
- package/lib/utils/event.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/lib/utils/interpolation.d.ts +3 -4
- package/lib/utils/interpolation.js +0 -17
- package/lib/utils/path.d.ts +2 -2
- package/package.json +6 -6
- package/es/Batch.d.ts +0 -25
- package/es/Batch.js +0 -82
- package/es/shapes-type.d.ts +0 -175
- package/es/shapes-type.js +0 -18
- package/es/utils/matrix-decompose.d.ts +0 -3
- package/es/utils/matrix-decompose.js +0 -404
- package/lib/Batch.d.ts +0 -25
- package/lib/Batch.js +0 -91
- package/lib/shapes-type.d.ts +0 -175
- package/lib/shapes-type.js +0 -41
- package/lib/utils/matrix-decompose.d.ts +0 -3
- package/lib/utils/matrix-decompose.js +0 -414
package/es/Canvas.d.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { CanvasConfig } from './types';
|
|
2
|
-
import { DisplayObject } from './DisplayObject';
|
|
2
|
+
import { DisplayObject } from './display-objects/DisplayObject';
|
|
3
3
|
import { ContextService } from './services';
|
|
4
4
|
import { RenderingService } from './services/RenderingService';
|
|
5
5
|
import { RenderingContext } from './services/RenderingContext';
|
|
6
6
|
import { EventService } from './services/EventService';
|
|
7
|
+
import { Camera } from './camera';
|
|
7
8
|
import { AbstractRenderer } from './AbstractRenderer';
|
|
8
|
-
import {
|
|
9
|
-
import { EventTarget } from './dom
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import type { PointLike } from './shapes';
|
|
10
|
+
import { Document, EventTarget } from './dom';
|
|
11
|
+
import type { IElement, INode, ICanvas } from './dom/interfaces';
|
|
12
|
+
import { CustomElementRegistry } from './dom/CustomElementRegistry';
|
|
13
|
+
export declare enum CanvasEvent {
|
|
14
|
+
READY = "ready",
|
|
15
|
+
BEFORE_RENDER = "beforerender",
|
|
16
|
+
AFTER_RENDER = "afterrender",
|
|
17
|
+
BEFORE_DESTROY = "beforedestroy",
|
|
18
|
+
AFTER_DESTROY = "afterdestroy"
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* can be treated like Window in DOM
|
|
17
22
|
*
|
|
18
23
|
* prototype chains: Canvas(Window) -> EventTarget
|
|
19
24
|
*/
|
|
20
|
-
export declare class Canvas extends EventTarget {
|
|
25
|
+
export declare class Canvas extends EventTarget implements ICanvas {
|
|
21
26
|
/**
|
|
22
27
|
* child container of current canvas, use hierarchy container
|
|
23
28
|
*/
|
|
@@ -26,6 +31,10 @@ export declare class Canvas extends EventTarget {
|
|
|
26
31
|
* window.document
|
|
27
32
|
*/
|
|
28
33
|
document: Document;
|
|
34
|
+
/**
|
|
35
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
36
|
+
*/
|
|
37
|
+
customElements: CustomElementRegistry;
|
|
29
38
|
Element: typeof DisplayObject;
|
|
30
39
|
/**
|
|
31
40
|
* rAF in auto rendering
|
|
@@ -35,15 +44,16 @@ export declare class Canvas extends EventTarget {
|
|
|
35
44
|
private initRenderingContext;
|
|
36
45
|
private initDefaultCamera;
|
|
37
46
|
getConfig(): Partial<CanvasConfig>;
|
|
47
|
+
getContainer(): import("inversify/lib/container/container").Container;
|
|
38
48
|
/**
|
|
39
49
|
* get the root displayObject in scenegraph
|
|
40
50
|
* @alias this.document.documentElement
|
|
41
51
|
*/
|
|
42
|
-
getRoot(): import("
|
|
52
|
+
getRoot(): import(".").Group;
|
|
43
53
|
/**
|
|
44
54
|
* get the camera of canvas
|
|
45
55
|
*/
|
|
46
|
-
getCamera():
|
|
56
|
+
getCamera(): Camera;
|
|
47
57
|
getContextService(): ContextService<unknown>;
|
|
48
58
|
getEventService(): EventService;
|
|
49
59
|
getRenderingService(): RenderingService;
|
|
@@ -52,14 +62,15 @@ export declare class Canvas extends EventTarget {
|
|
|
52
62
|
destroy(destroyScenegraph?: boolean): void;
|
|
53
63
|
/**
|
|
54
64
|
* compatible with G 3.0
|
|
65
|
+
* @deprecated
|
|
66
|
+
* @alias resize
|
|
55
67
|
*/
|
|
56
68
|
changeSize(width: number, height: number): void;
|
|
57
69
|
resize(width: number, height: number): void;
|
|
58
|
-
appendChild(
|
|
59
|
-
insertBefore(
|
|
60
|
-
removeChild(
|
|
61
|
-
removeChildren(): void;
|
|
62
|
-
decorate(object: DisplayObject, renderingService: RenderingService, root: DisplayObject): void;
|
|
70
|
+
appendChild<T extends INode>(child: T, index?: number): T;
|
|
71
|
+
insertBefore<T extends INode>(newChild: T, refChild: IElement | null): T;
|
|
72
|
+
removeChild<T extends INode>(child: T, destroy?: boolean): T;
|
|
73
|
+
removeChildren(destroy?: boolean): void;
|
|
63
74
|
render(): void;
|
|
64
75
|
private run;
|
|
65
76
|
private initRenderer;
|
|
@@ -68,7 +79,18 @@ export declare class Canvas extends EventTarget {
|
|
|
68
79
|
setRenderer(renderer: AbstractRenderer): void;
|
|
69
80
|
private unmountChildren;
|
|
70
81
|
private mountChildren;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
82
|
+
client2Viewport(client: PointLike): PointLike;
|
|
83
|
+
viewport2Client(canvas: PointLike): PointLike;
|
|
84
|
+
viewport2Canvas(viewport: PointLike): PointLike;
|
|
85
|
+
canvas2Viewport(canvas: PointLike): PointLike;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated
|
|
88
|
+
* @alias client2Viewport
|
|
89
|
+
*/
|
|
90
|
+
getPointByClient(clientX: number, clientY: number): PointLike;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated
|
|
93
|
+
* @alias viewport2Client
|
|
94
|
+
*/
|
|
95
|
+
getClientByPoint(x: number, y: number): PointLike;
|
|
74
96
|
}
|
package/es/Canvas.js
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
import { __assign, __extends } from "tslib";
|
|
2
2
|
import { CanvasConfig } from './types';
|
|
3
3
|
import { cleanExistedCanvas } from './utils/canvas';
|
|
4
|
-
import { DisplayObject } from './DisplayObject';
|
|
4
|
+
import { DisplayObject } from './display-objects/DisplayObject';
|
|
5
5
|
import { ContextService } from './services';
|
|
6
6
|
import { container } from './inversify.config';
|
|
7
7
|
import { RenderingService } from './services/RenderingService';
|
|
8
8
|
import { RenderingContext, RENDER_REASON } from './services/RenderingContext';
|
|
9
9
|
import { EventService } from './services/EventService';
|
|
10
|
-
import { Camera, CAMERA_EVENT, CAMERA_PROJECTION_MODE, DefaultCamera } from './
|
|
10
|
+
import { Camera, CAMERA_EVENT, CAMERA_PROJECTION_MODE, DefaultCamera } from './camera';
|
|
11
11
|
import { containerModule as commonContainerModule } from './canvas-module';
|
|
12
12
|
import { cancelAnimationFrame } from './utils/raf';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
13
|
+
import { Document, EventTarget, ElementEvent } from './dom';
|
|
14
|
+
import { CustomElementRegistry } from './dom/CustomElementRegistry';
|
|
15
|
+
import { Renderable } from './components';
|
|
16
|
+
export var CanvasEvent;
|
|
17
|
+
|
|
18
|
+
(function (CanvasEvent) {
|
|
19
|
+
CanvasEvent["READY"] = "ready";
|
|
20
|
+
CanvasEvent["BEFORE_RENDER"] = "beforerender";
|
|
21
|
+
CanvasEvent["AFTER_RENDER"] = "afterrender";
|
|
22
|
+
CanvasEvent["BEFORE_DESTROY"] = "beforedestroy";
|
|
23
|
+
CanvasEvent["AFTER_DESTROY"] = "afterdestroy";
|
|
24
|
+
})(CanvasEvent || (CanvasEvent = {}));
|
|
17
25
|
/**
|
|
18
26
|
* can be treated like Window in DOM
|
|
19
27
|
*
|
|
20
28
|
* prototype chains: Canvas(Window) -> EventTarget
|
|
21
29
|
*/
|
|
22
30
|
|
|
31
|
+
|
|
23
32
|
var Canvas = function (_super) {
|
|
24
33
|
__extends(Canvas, _super);
|
|
25
34
|
|
|
@@ -48,20 +57,33 @@ var Canvas = function (_super) {
|
|
|
48
57
|
}
|
|
49
58
|
|
|
50
59
|
Canvas.prototype.initRenderingContext = function (mergedConfig) {
|
|
60
|
+
var _this = this;
|
|
61
|
+
|
|
51
62
|
this.container.bind(CanvasConfig).toConstantValue(mergedConfig);
|
|
52
63
|
this.document = new Document();
|
|
53
|
-
this.document.defaultView = this;
|
|
64
|
+
this.document.defaultView = this;
|
|
65
|
+
this.customElements = new CustomElementRegistry(); // bind rendering context, shared by all renderers
|
|
54
66
|
|
|
55
67
|
this.container.bind(RenderingContext).toConstantValue({
|
|
56
68
|
/**
|
|
57
69
|
* the root node in scene graph
|
|
58
70
|
*/
|
|
59
71
|
root: this.document.documentElement,
|
|
60
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* removed render bounds
|
|
75
|
+
*/
|
|
76
|
+
removedRenderBoundsList: [],
|
|
61
77
|
renderReasons: new Set(),
|
|
62
78
|
force: false,
|
|
63
79
|
dirty: false
|
|
64
80
|
});
|
|
81
|
+
this.document.documentElement.addEventListener(ElementEvent.CHILD_INSERTED, function (e) {
|
|
82
|
+
_this.mountChildren(e.detail.child);
|
|
83
|
+
});
|
|
84
|
+
this.document.documentElement.addEventListener(ElementEvent.CHILD_REMOVED, function (e) {
|
|
85
|
+
_this.unmountChildren(e.detail.child);
|
|
86
|
+
});
|
|
65
87
|
};
|
|
66
88
|
|
|
67
89
|
Canvas.prototype.initDefaultCamera = function (width, height) {
|
|
@@ -80,6 +102,10 @@ var Canvas = function (_super) {
|
|
|
80
102
|
Canvas.prototype.getConfig = function () {
|
|
81
103
|
return this.container.get(CanvasConfig);
|
|
82
104
|
};
|
|
105
|
+
|
|
106
|
+
Canvas.prototype.getContainer = function () {
|
|
107
|
+
return this.container;
|
|
108
|
+
};
|
|
83
109
|
/**
|
|
84
110
|
* get the root displayObject in scenegraph
|
|
85
111
|
* @alias this.document.documentElement
|
|
@@ -119,13 +145,11 @@ var Canvas = function (_super) {
|
|
|
119
145
|
};
|
|
120
146
|
|
|
121
147
|
Canvas.prototype.destroy = function (destroyScenegraph) {
|
|
122
|
-
var _this = this;
|
|
123
|
-
|
|
124
148
|
if (destroyScenegraph === void 0) {
|
|
125
149
|
destroyScenegraph = true;
|
|
126
150
|
}
|
|
127
151
|
|
|
128
|
-
this.emit(
|
|
152
|
+
this.emit(CanvasEvent.BEFORE_DESTROY, function () {});
|
|
129
153
|
|
|
130
154
|
if (this.frameId) {
|
|
131
155
|
cancelAnimationFrame(this.frameId);
|
|
@@ -133,25 +157,22 @@ var Canvas = function (_super) {
|
|
|
133
157
|
|
|
134
158
|
|
|
135
159
|
var root = this.getRoot();
|
|
136
|
-
|
|
160
|
+
this.unmountChildren(root);
|
|
137
161
|
|
|
138
162
|
if (destroyScenegraph) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}); // destroy timeline
|
|
142
|
-
|
|
143
|
-
this.document.timeline.destroy();
|
|
144
|
-
} else {
|
|
145
|
-
this.unmountChildren(root);
|
|
163
|
+
// destroy Document
|
|
164
|
+
this.document.destroy();
|
|
146
165
|
} // destroy services
|
|
147
166
|
|
|
148
167
|
|
|
149
168
|
this.getContextService().destroy();
|
|
150
|
-
|
|
151
|
-
this.emit(
|
|
169
|
+
this.getRenderingService().destroy();
|
|
170
|
+
this.emit(CanvasEvent.AFTER_DESTROY, {});
|
|
152
171
|
};
|
|
153
172
|
/**
|
|
154
173
|
* compatible with G 3.0
|
|
174
|
+
* @deprecated
|
|
175
|
+
* @alias resize
|
|
155
176
|
*/
|
|
156
177
|
|
|
157
178
|
|
|
@@ -178,46 +199,39 @@ var Canvas = function (_super) {
|
|
|
178
199
|
}; // proxy to document.documentElement
|
|
179
200
|
|
|
180
201
|
|
|
181
|
-
Canvas.prototype.appendChild = function (
|
|
182
|
-
return this.document.documentElement.appendChild(
|
|
202
|
+
Canvas.prototype.appendChild = function (child, index) {
|
|
203
|
+
return this.document.documentElement.appendChild(child, index);
|
|
183
204
|
};
|
|
184
205
|
|
|
185
|
-
Canvas.prototype.insertBefore = function (
|
|
186
|
-
return this.document.documentElement.insertBefore(
|
|
206
|
+
Canvas.prototype.insertBefore = function (newChild, refChild) {
|
|
207
|
+
return this.document.documentElement.insertBefore(newChild, refChild);
|
|
187
208
|
};
|
|
188
209
|
|
|
189
|
-
Canvas.prototype.removeChild = function (
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
Canvas.prototype.removeChild = function (child, destroy) {
|
|
211
|
+
if (destroy === void 0) {
|
|
212
|
+
destroy = true;
|
|
213
|
+
}
|
|
192
214
|
|
|
193
|
-
|
|
194
|
-
this.document.documentElement.removeChildren();
|
|
215
|
+
return this.document.documentElement.removeChild(child, destroy);
|
|
195
216
|
};
|
|
196
217
|
|
|
197
|
-
Canvas.prototype.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
_this.mountChild(child);
|
|
218
|
+
Canvas.prototype.removeChildren = function (destroy) {
|
|
219
|
+
if (destroy === void 0) {
|
|
220
|
+
destroy = true;
|
|
221
|
+
}
|
|
202
222
|
|
|
203
|
-
|
|
204
|
-
return _this.decorate(grandchild, renderingService, root);
|
|
205
|
-
});
|
|
206
|
-
child.on(DISPLAY_OBJECT_EVENT.ChildRemoved, function (grandchild) {
|
|
207
|
-
return _this.unmountChildren(grandchild);
|
|
208
|
-
});
|
|
209
|
-
});
|
|
223
|
+
this.document.documentElement.removeChildren(destroy);
|
|
210
224
|
};
|
|
211
225
|
|
|
212
226
|
Canvas.prototype.render = function () {
|
|
213
|
-
this.emit(
|
|
227
|
+
this.emit(CanvasEvent.BEFORE_RENDER, {});
|
|
214
228
|
|
|
215
229
|
if (this.container.isBound(RenderingService)) {
|
|
216
230
|
var renderingService = this.container.get(RenderingService);
|
|
217
231
|
renderingService.render();
|
|
218
232
|
}
|
|
219
233
|
|
|
220
|
-
this.emit(
|
|
234
|
+
this.emit(CanvasEvent.AFTER_RENDER, {});
|
|
221
235
|
};
|
|
222
236
|
|
|
223
237
|
Canvas.prototype.run = function () {
|
|
@@ -233,6 +247,8 @@ var Canvas = function (_super) {
|
|
|
233
247
|
};
|
|
234
248
|
|
|
235
249
|
Canvas.prototype.initRenderer = function (renderer) {
|
|
250
|
+
var _this = this;
|
|
251
|
+
|
|
236
252
|
if (!renderer) {
|
|
237
253
|
throw new Error('Renderer is required.');
|
|
238
254
|
}
|
|
@@ -244,12 +260,23 @@ var Canvas = function (_super) {
|
|
|
244
260
|
var contextService = this.container.get(ContextService);
|
|
245
261
|
var renderingService = this.container.get(RenderingService);
|
|
246
262
|
contextService.init();
|
|
247
|
-
renderingService.init()
|
|
263
|
+
renderingService.init().then(function () {
|
|
264
|
+
_this.emit(CanvasEvent.READY, {});
|
|
265
|
+
});
|
|
248
266
|
|
|
249
267
|
if (renderer.getConfig().enableAutoRendering) {
|
|
250
268
|
this.run();
|
|
251
|
-
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
this.getRoot().forEach(function (node) {
|
|
272
|
+
var renderable = node.entity.getComponent(Renderable);
|
|
252
273
|
|
|
274
|
+
if (renderable) {
|
|
275
|
+
renderable.renderBoundsDirty = true;
|
|
276
|
+
renderable.boundsDirty = true;
|
|
277
|
+
renderable.dirty = true; // element.emit(ElementEvent.BOUNDS_CHANGED, {});
|
|
278
|
+
}
|
|
279
|
+
}); // keep current scenegraph unchanged, just trigger mounted event
|
|
253
280
|
|
|
254
281
|
this.mountChildren(this.getRoot());
|
|
255
282
|
};
|
|
@@ -290,14 +317,18 @@ var Canvas = function (_super) {
|
|
|
290
317
|
this.initRenderer(renderer);
|
|
291
318
|
};
|
|
292
319
|
|
|
293
|
-
Canvas.prototype.unmountChildren = function (
|
|
294
|
-
var
|
|
295
|
-
|
|
320
|
+
Canvas.prototype.unmountChildren = function (parent) {
|
|
321
|
+
var path = [];
|
|
322
|
+
parent.forEach(function (child) {
|
|
296
323
|
if (child.isConnected) {
|
|
297
|
-
|
|
298
|
-
child.isConnected = false;
|
|
299
|
-
child.ownerDocument = null;
|
|
324
|
+
path.push(child);
|
|
300
325
|
}
|
|
326
|
+
}); // unmount from leaf to root
|
|
327
|
+
|
|
328
|
+
path.reverse().forEach(function (child) {
|
|
329
|
+
child.emit(ElementEvent.UNMOUNTED, {});
|
|
330
|
+
child.ownerDocument = null;
|
|
331
|
+
child.isConnected = false;
|
|
301
332
|
});
|
|
302
333
|
};
|
|
303
334
|
|
|
@@ -305,28 +336,53 @@ var Canvas = function (_super) {
|
|
|
305
336
|
var _this = this;
|
|
306
337
|
|
|
307
338
|
parent.forEach(function (child) {
|
|
308
|
-
|
|
339
|
+
if (!child.isConnected) {
|
|
340
|
+
child.ownerDocument = _this.document;
|
|
341
|
+
child.isConnected = true;
|
|
342
|
+
debugger;
|
|
343
|
+
child.emit(ElementEvent.MOUNTED, {});
|
|
344
|
+
}
|
|
309
345
|
});
|
|
310
346
|
};
|
|
311
347
|
|
|
312
|
-
Canvas.prototype.
|
|
313
|
-
|
|
314
|
-
if (!child.isConnected) {
|
|
315
|
-
var renderingService = this.container.get(RenderingService);
|
|
316
|
-
child.ownerDocument = this.document;
|
|
317
|
-
renderingService.hooks.mounted.call(child);
|
|
318
|
-
child.isConnected = true;
|
|
319
|
-
}
|
|
348
|
+
Canvas.prototype.client2Viewport = function (client) {
|
|
349
|
+
return this.getEventService().client2Viewport(client);
|
|
320
350
|
};
|
|
321
351
|
|
|
352
|
+
Canvas.prototype.viewport2Client = function (canvas) {
|
|
353
|
+
return this.getEventService().viewport2Client(canvas);
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
Canvas.prototype.viewport2Canvas = function (viewport) {
|
|
357
|
+
return this.getEventService().viewport2Canvas(viewport);
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
Canvas.prototype.canvas2Viewport = function (canvas) {
|
|
361
|
+
return this.getEventService().canvas2Viewport(canvas);
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated
|
|
365
|
+
* @alias client2Viewport
|
|
366
|
+
*/
|
|
367
|
+
|
|
368
|
+
|
|
322
369
|
Canvas.prototype.getPointByClient = function (clientX, clientY) {
|
|
323
|
-
|
|
324
|
-
|
|
370
|
+
return this.client2Viewport({
|
|
371
|
+
x: clientX,
|
|
372
|
+
y: clientY
|
|
373
|
+
});
|
|
325
374
|
};
|
|
375
|
+
/**
|
|
376
|
+
* @deprecated
|
|
377
|
+
* @alias viewport2Client
|
|
378
|
+
*/
|
|
379
|
+
|
|
326
380
|
|
|
327
381
|
Canvas.prototype.getClientByPoint = function (x, y) {
|
|
328
|
-
|
|
329
|
-
|
|
382
|
+
return this.viewport2Client({
|
|
383
|
+
x: x,
|
|
384
|
+
y: y
|
|
385
|
+
});
|
|
330
386
|
};
|
|
331
387
|
|
|
332
388
|
return Canvas;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { DisplayObject } from './
|
|
1
|
+
import type { DisplayObject } from './display-objects';
|
|
2
2
|
export declare class DisplayObjectPool {
|
|
3
3
|
private pool;
|
|
4
4
|
getByName(name: string): DisplayObject;
|
|
5
5
|
add(name: string, groupOrShape: DisplayObject): void;
|
|
6
|
+
remove(name: string): void;
|
|
6
7
|
}
|
package/es/DisplayObjectPool.js
CHANGED
|
@@ -14,6 +14,10 @@ var DisplayObjectPool = function () {
|
|
|
14
14
|
this.pool[name] = groupOrShape;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
DisplayObjectPool.prototype.remove = function (name) {
|
|
18
|
+
delete this.pool[name];
|
|
19
|
+
};
|
|
20
|
+
|
|
17
21
|
DisplayObjectPool = __decorate([injectable()], DisplayObjectPool);
|
|
18
22
|
return DisplayObjectPool;
|
|
19
23
|
}();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { mat4, vec3 } from 'gl-matrix';
|
|
3
|
-
import Landmark from './Landmark';
|
|
4
|
-
import { Frustum } from '
|
|
3
|
+
import { Landmark } from './Landmark';
|
|
4
|
+
import { Frustum } from '../shapes';
|
|
5
5
|
export declare const DefaultCamera = "DefaultCamera";
|
|
6
6
|
export declare enum CAMERA_TYPE {
|
|
7
7
|
ORBITING = "ORBITING",
|
|
@@ -108,7 +108,8 @@ export declare class Camera extends EventEmitter {
|
|
|
108
108
|
private rright;
|
|
109
109
|
private top;
|
|
110
110
|
private bottom;
|
|
111
|
-
private
|
|
111
|
+
private projectionMatrix;
|
|
112
|
+
private projectionMatrixInverse;
|
|
112
113
|
private jitteredProjectionMatrix;
|
|
113
114
|
private view;
|
|
114
115
|
private following;
|
|
@@ -131,8 +132,10 @@ export declare class Camera extends EventEmitter {
|
|
|
131
132
|
clone(): Camera;
|
|
132
133
|
getProjectionMode(): CAMERA_PROJECTION_MODE;
|
|
133
134
|
getPerspective(): mat4;
|
|
135
|
+
getPerspectiveInverse(): mat4;
|
|
134
136
|
getFrustum(): Frustum;
|
|
135
137
|
getPosition(): vec3;
|
|
138
|
+
getFocalPoint(): vec3;
|
|
136
139
|
getNear(): number;
|
|
137
140
|
getFar(): number;
|
|
138
141
|
getZoom(): number;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
3
|
import { mat3, mat4, quat, vec3, vec4 } from 'gl-matrix';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { requestAnimationFrame, cancelAnimationFrame } from './utils/raf';
|
|
4
|
+
import { Landmark } from './Landmark';
|
|
5
|
+
import { Frustum } from '../shapes';
|
|
6
|
+
import { createVec3, getAngle } from '../utils/math';
|
|
7
|
+
import { requestAnimationFrame, cancelAnimationFrame } from '../utils/raf';
|
|
9
8
|
export var DefaultCamera = 'DefaultCamera';
|
|
10
9
|
export var CAMERA_TYPE;
|
|
11
10
|
|
|
@@ -137,7 +136,8 @@ var Camera = function (_super) {
|
|
|
137
136
|
_this.near = 0.1;
|
|
138
137
|
_this.far = 10000;
|
|
139
138
|
_this.aspect = 1;
|
|
140
|
-
_this.
|
|
139
|
+
_this.projectionMatrix = mat4.create();
|
|
140
|
+
_this.projectionMatrixInverse = mat4.create();
|
|
141
141
|
_this.jitteredProjectionMatrix = undefined;
|
|
142
142
|
_this.following = undefined;
|
|
143
143
|
_this.type = CAMERA_TYPE.EXPLORING;
|
|
@@ -161,10 +161,8 @@ var Camera = function (_super) {
|
|
|
161
161
|
return _this;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
Camera_1 = Camera;
|
|
165
|
-
|
|
166
164
|
Camera.prototype.clone = function () {
|
|
167
|
-
var camera = new
|
|
165
|
+
var camera = new Camera();
|
|
168
166
|
camera.setType(this.type, undefined); // camera.interactor = this.interactor;
|
|
169
167
|
|
|
170
168
|
return camera;
|
|
@@ -176,7 +174,11 @@ var Camera = function (_super) {
|
|
|
176
174
|
|
|
177
175
|
Camera.prototype.getPerspective = function () {
|
|
178
176
|
// account for TAA
|
|
179
|
-
return this.jitteredProjectionMatrix || this.
|
|
177
|
+
return this.jitteredProjectionMatrix || this.projectionMatrix;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
Camera.prototype.getPerspectiveInverse = function () {
|
|
181
|
+
return this.projectionMatrixInverse;
|
|
180
182
|
};
|
|
181
183
|
|
|
182
184
|
Camera.prototype.getFrustum = function () {
|
|
@@ -187,6 +189,10 @@ var Camera = function (_super) {
|
|
|
187
189
|
return this.position;
|
|
188
190
|
};
|
|
189
191
|
|
|
192
|
+
Camera.prototype.getFocalPoint = function () {
|
|
193
|
+
return this.focalPoint;
|
|
194
|
+
};
|
|
195
|
+
|
|
190
196
|
Camera.prototype.getNear = function () {
|
|
191
197
|
return this.near;
|
|
192
198
|
};
|
|
@@ -268,7 +274,7 @@ var Camera = function (_super) {
|
|
|
268
274
|
|
|
269
275
|
Camera.prototype.jitterProjectionMatrix = function (x, y) {
|
|
270
276
|
var translation = mat4.fromTranslation(mat4.create(), [x, y, 0]);
|
|
271
|
-
this.jitteredProjectionMatrix = mat4.multiply(mat4.create(), translation, this.
|
|
277
|
+
this.jitteredProjectionMatrix = mat4.multiply(mat4.create(), translation, this.projectionMatrix);
|
|
272
278
|
};
|
|
273
279
|
|
|
274
280
|
Camera.prototype.clearJitterProjectionMatrix = function () {
|
|
@@ -395,7 +401,8 @@ var Camera = function (_super) {
|
|
|
395
401
|
// }
|
|
396
402
|
// flip Y
|
|
397
403
|
|
|
398
|
-
mat4.perspective(this.
|
|
404
|
+
mat4.perspective(this.projectionMatrix, -this.fov * DEG_2_RAD, -this.aspect, this.near, this.far);
|
|
405
|
+
mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
|
|
399
406
|
this.emit(CAMERA_EVENT.Updated);
|
|
400
407
|
return this;
|
|
401
408
|
};
|
|
@@ -426,7 +433,8 @@ var Camera = function (_super) {
|
|
|
426
433
|
bottom = top - scaleH * this.view.height;
|
|
427
434
|
}
|
|
428
435
|
|
|
429
|
-
mat4.ortho(this.
|
|
436
|
+
mat4.ortho(this.projectionMatrix, left, right, bottom, top, near, far);
|
|
437
|
+
mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
|
|
430
438
|
|
|
431
439
|
this._getOrthoMatrix();
|
|
432
440
|
|
|
@@ -943,12 +951,10 @@ var Camera = function (_super) {
|
|
|
943
951
|
mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix, rotZ, vec3.fromValues((this.rright - this.left) / 2 - position[0], (this.bottom - this.top) / 2 - position[1], 0), vec3.fromValues(this.zoom, this.zoom, 1), position);
|
|
944
952
|
};
|
|
945
953
|
|
|
946
|
-
var Camera_1;
|
|
947
954
|
Camera.ProjectionMode = {
|
|
948
955
|
ORTHOGRAPHIC: 'ORTHOGRAPHIC',
|
|
949
956
|
PERSPECTIVE: 'PERSPECTIVE'
|
|
950
957
|
};
|
|
951
|
-
Camera = Camera_1 = __decorate([injectable()], Camera);
|
|
952
958
|
return Camera;
|
|
953
959
|
}(EventEmitter);
|
|
954
960
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { vec3 } from 'gl-matrix';
|
|
2
|
-
import { Camera } from './Camera';
|
|
2
|
+
import type { Camera } from './Camera';
|
|
3
3
|
/**
|
|
4
4
|
* 保存相机状态,便于后续在多个 Landmark 间移动
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare class Landmark {
|
|
7
7
|
name: string;
|
|
8
8
|
private matrix;
|
|
9
9
|
private right;
|
|
@@ -2,5 +2,12 @@ import { Component } from '@antv/g-ecs';
|
|
|
2
2
|
import { AABB } from '../shapes';
|
|
3
3
|
export declare class Geometry extends Component {
|
|
4
4
|
static tag: string;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* excluding all children
|
|
7
|
+
*/
|
|
8
|
+
contentBounds: AABB | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* including extra rendering effects, eg. shadowBlur filters(drop-shadow, blur)
|
|
11
|
+
*/
|
|
12
|
+
renderBounds: AABB | undefined;
|
|
6
13
|
}
|
|
@@ -7,18 +7,19 @@ export declare class Renderable extends Component {
|
|
|
7
7
|
* 1. 包围盒会受 transform 影响。例如每次 transform 之后应该重新计算包围盒(center 发生偏移)。
|
|
8
8
|
* 2. 多个 Mesh 可以共享一个 Geometry,但可以各自拥有不同的 aabb
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
bounds: AABB | undefined;
|
|
11
|
+
boundsDirty: boolean;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* account for hierarchy, also including extra rendering effects
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
renderBounds: AABB | undefined;
|
|
16
|
+
renderBoundsDirty: boolean;
|
|
16
17
|
/**
|
|
17
|
-
* dirty
|
|
18
|
+
* dirty render bounds in last render frame
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
dirtyRenderBounds: AABB;
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* dirty rectangle flag
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
dirty: boolean;
|
|
24
25
|
}
|