@antv/g 5.0.21 → 5.0.22-alpha.2
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/AbstractRenderer.js +1 -3
- package/es/Canvas.js +7 -11
- package/es/DisplayObjectPool.js +1 -3
- package/es/camera/Camera.d.ts +12 -7
- package/es/camera/Camera.js +54 -24
- package/es/camera/Landmark.d.ts +2 -0
- package/es/camera/Landmark.js +10 -6
- package/es/components/Cullable.js +1 -3
- package/es/components/Geometry.js +1 -3
- package/es/components/Renderable.js +1 -3
- package/es/components/Sortable.js +1 -3
- package/es/components/Transform.js +1 -3
- package/es/css/LayoutRegistry.js +1 -3
- package/es/css/StyleValueRegistry.js +1 -3
- package/es/css/cssom/CSSColorValue.js +1 -3
- package/es/css/cssom/CSSGradientValue.js +6 -8
- package/es/css/cssom/CSSKeywordValue.js +1 -3
- package/es/css/cssom/CSSMathInvert.js +1 -3
- package/es/css/cssom/CSSMathMax.js +1 -3
- package/es/css/cssom/CSSMathMin.js +1 -3
- package/es/css/cssom/CSSMathNegate.js +1 -3
- package/es/css/cssom/CSSMathProduct.js +1 -3
- package/es/css/cssom/CSSMathSum.js +1 -3
- package/es/css/cssom/CSSMathValue.js +1 -3
- package/es/css/cssom/CSSMathVariadic.js +1 -3
- package/es/css/cssom/CSSNumericValue.js +1 -3
- package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/es/css/cssom/CSSNumericValueType.js +1 -3
- package/es/css/cssom/CSSRGB.js +2 -4
- package/es/css/cssom/CSSStyleValue.d.ts +2 -2
- package/es/css/cssom/CSSStyleValue.js +2 -4
- package/es/css/cssom/CSSTransformComponent.js +1 -3
- package/es/css/cssom/CSSTransformValue.js +1 -3
- package/es/css/cssom/CSSTranslate.js +1 -3
- package/es/css/cssom/CSSUnitValue.js +2 -4
- package/es/css/parser/color.js +1 -1
- package/es/css/parser/dimension.js +1 -1
- package/es/css/parser/transform.d.ts +1 -1
- package/es/css/parser/transform.js +2 -2
- package/es/css/properties/CSSPropertyAnchor.js +1 -3
- package/es/css/properties/CSSPropertyClipPath.js +1 -3
- package/es/css/properties/CSSPropertyColor.js +1 -3
- package/es/css/properties/CSSPropertyFilter.js +1 -3
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
- package/es/css/properties/CSSPropertyLineDash.js +1 -3
- package/es/css/properties/CSSPropertyLocalPosition.js +1 -3
- package/es/css/properties/CSSPropertyOffsetDistance.js +1 -3
- package/es/css/properties/CSSPropertyOffsetPath.js +1 -3
- package/es/css/properties/CSSPropertyOpacity.js +1 -3
- package/es/css/properties/CSSPropertyPath.js +1 -3
- package/es/css/properties/CSSPropertyPoints.js +1 -3
- package/es/css/properties/CSSPropertyShadowBlur.js +1 -3
- package/es/css/properties/CSSPropertyText.js +2 -4
- package/es/css/properties/CSSPropertyTextTransform.js +1 -3
- package/es/css/properties/CSSPropertyTransform.js +1 -3
- package/es/css/properties/CSSPropertyTransformOrigin.js +1 -3
- package/es/css/properties/CSSPropertyVisibility.js +1 -3
- package/es/css/properties/CSSPropertyZIndex.js +1 -3
- package/es/display-objects/Circle.js +1 -3
- package/es/display-objects/CustomElement.js +1 -3
- package/es/display-objects/DisplayObject.js +10 -8
- package/es/display-objects/Ellipse.js +1 -3
- package/es/display-objects/Group.js +1 -3
- package/es/display-objects/HTML.js +3 -6
- package/es/display-objects/Image.js +1 -3
- package/es/display-objects/Line.js +1 -3
- package/es/display-objects/Path.js +1 -3
- package/es/display-objects/Polygon.js +1 -3
- package/es/display-objects/Polyline.js +1 -3
- package/es/display-objects/Rect.js +1 -3
- package/es/display-objects/Text.js +3 -6
- package/es/dom/Animation.js +2 -4
- package/es/dom/AnimationEffectTiming.js +1 -3
- package/es/dom/AnimationEvent.js +1 -3
- package/es/dom/AnimationTimeline.js +1 -3
- package/es/dom/CustomElementRegistry.js +1 -3
- package/es/dom/CustomEvent.js +1 -3
- package/es/dom/Document.js +1 -3
- package/es/dom/Element.js +4 -6
- package/es/dom/EventTarget.js +3 -5
- package/es/dom/FederatedEvent.js +1 -3
- package/es/dom/FederatedMouseEvent.js +1 -3
- package/es/dom/FederatedPointerEvent.js +1 -3
- package/es/dom/FederatedWheelEvent.js +1 -3
- package/es/dom/KeyframeEffect.js +1 -3
- package/es/dom/KeyframeList.js +1 -1
- package/es/dom/MutationEvent.js +1 -3
- package/es/dom/MutationObserver.js +3 -10
- package/es/dom/MutationRecord.js +1 -3
- package/es/dom/Node.js +2 -4
- package/es/plugins/CullingPlugin.js +1 -3
- package/es/plugins/DirtyCheckPlugin.js +1 -3
- package/es/plugins/EventPlugin.js +5 -4
- package/es/plugins/FrustumCullingStrategy.js +1 -3
- package/es/plugins/PrepareRendererPlugin.js +1 -3
- package/es/services/EventService.js +26 -7
- package/es/services/OffscreenCanvasCreator.js +1 -3
- package/es/services/RenderingContext.d.ts +2 -1
- package/es/services/RenderingContext.js +3 -1
- package/es/services/RenderingService.js +1 -3
- package/es/services/SceneGraphSelector.js +1 -3
- package/es/services/SceneGraphService.d.ts +2 -1
- package/es/services/SceneGraphService.js +3 -5
- package/es/services/TextService.js +3 -5
- package/es/services/aabb/CircleUpdater.js +1 -3
- package/es/services/aabb/EllipseUpdater.js +1 -3
- package/es/services/aabb/LineUpdater.js +1 -3
- package/es/services/aabb/PathUpdater.js +1 -3
- package/es/services/aabb/PolylineUpdater.js +1 -3
- package/es/services/aabb/RectUpdater.js +1 -3
- package/es/services/aabb/TextUpdater.js +1 -3
- package/es/services/aabb/interfaces.d.ts +3 -2
- package/es/services/aabb/interfaces.js +3 -2
- package/es/shapes/AABB.js +1 -3
- package/es/shapes/BoundingSphere.js +1 -3
- package/es/shapes/Frustum.js +1 -3
- package/es/shapes/Plane.js +1 -3
- package/es/shapes/Point.js +1 -3
- package/es/shapes/Ray.js +1 -3
- package/es/shapes/Rectangle.js +1 -3
- package/es/types.d.ts +2 -1
- package/es/types.js +2 -1
- package/es/utils/custom-easing.d.ts +0 -9
- package/es/utils/custom-easing.js +38 -54
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +3 -3
- package/es/utils/text.js +3 -3
- package/lib/AbstractRenderer.js +1 -3
- package/lib/Canvas.js +8 -12
- package/lib/DisplayObjectPool.js +1 -3
- package/lib/camera/Camera.d.ts +12 -7
- package/lib/camera/Camera.js +59 -25
- package/lib/camera/Landmark.d.ts +2 -0
- package/lib/camera/Landmark.js +10 -6
- package/lib/components/Cullable.js +2 -4
- package/lib/components/Geometry.js +1 -3
- package/lib/components/Renderable.js +1 -3
- package/lib/components/Sortable.js +1 -3
- package/lib/components/Transform.js +1 -3
- package/lib/css/LayoutRegistry.js +1 -3
- package/lib/css/StyleValueRegistry.js +1 -3
- package/lib/css/cssom/CSSColorValue.js +1 -3
- package/lib/css/cssom/CSSGradientValue.js +7 -9
- package/lib/css/cssom/CSSKeywordValue.js +1 -3
- package/lib/css/cssom/CSSMathInvert.js +1 -3
- package/lib/css/cssom/CSSMathMax.js +1 -3
- package/lib/css/cssom/CSSMathMin.js +1 -3
- package/lib/css/cssom/CSSMathNegate.js +1 -3
- package/lib/css/cssom/CSSMathOperator.js +1 -1
- package/lib/css/cssom/CSSMathProduct.js +1 -3
- package/lib/css/cssom/CSSMathSum.js +1 -3
- package/lib/css/cssom/CSSMathValue.js +1 -3
- package/lib/css/cssom/CSSMathVariadic.js +2 -4
- package/lib/css/cssom/CSSNumericValue.js +1 -3
- package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValueType.js +3 -5
- package/lib/css/cssom/CSSRGB.js +2 -4
- package/lib/css/cssom/CSSStyleValue.d.ts +2 -2
- package/lib/css/cssom/CSSStyleValue.js +108 -110
- package/lib/css/cssom/CSSTransformComponent.js +2 -4
- package/lib/css/cssom/CSSTransformValue.js +1 -3
- package/lib/css/cssom/CSSTranslate.js +1 -3
- package/lib/css/cssom/CSSUnitValue.js +2 -4
- package/lib/css/cssom/types.js +1 -1
- package/lib/css/parser/color.js +3 -3
- package/lib/css/parser/dimension.js +6 -7
- package/lib/css/parser/numeric.js +3 -3
- package/lib/css/parser/path.js +1 -1
- package/lib/css/parser/transform.d.ts +1 -1
- package/lib/css/parser/transform.js +11 -11
- package/lib/css/properties/CSSPropertyAnchor.js +1 -3
- package/lib/css/properties/CSSPropertyClipPath.js +1 -3
- package/lib/css/properties/CSSPropertyColor.js +1 -3
- package/lib/css/properties/CSSPropertyFilter.js +1 -3
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
- package/lib/css/properties/CSSPropertyLineDash.js +1 -3
- package/lib/css/properties/CSSPropertyLocalPosition.js +1 -3
- package/lib/css/properties/CSSPropertyOffsetDistance.js +1 -3
- package/lib/css/properties/CSSPropertyOffsetPath.js +1 -3
- package/lib/css/properties/CSSPropertyOpacity.js +1 -3
- package/lib/css/properties/CSSPropertyPath.js +1 -3
- package/lib/css/properties/CSSPropertyPoints.js +1 -3
- package/lib/css/properties/CSSPropertyShadowBlur.js +1 -3
- package/lib/css/properties/CSSPropertyText.js +2 -4
- package/lib/css/properties/CSSPropertyTextTransform.js +1 -3
- package/lib/css/properties/CSSPropertyTransform.js +1 -3
- package/lib/css/properties/CSSPropertyTransformOrigin.js +1 -3
- package/lib/css/properties/CSSPropertyVisibility.js +1 -3
- package/lib/css/properties/CSSPropertyZIndex.js +1 -3
- package/lib/display-objects/Circle.js +1 -3
- package/lib/display-objects/CustomElement.js +1 -3
- package/lib/display-objects/DisplayObject.js +9 -7
- package/lib/display-objects/Ellipse.js +1 -3
- package/lib/display-objects/Group.js +1 -3
- package/lib/display-objects/HTML.js +4 -6
- package/lib/display-objects/Image.js +1 -3
- package/lib/display-objects/Line.js +1 -3
- package/lib/display-objects/Path.js +1 -3
- package/lib/display-objects/Polygon.js +1 -3
- package/lib/display-objects/Polyline.js +1 -3
- package/lib/display-objects/Rect.js +1 -3
- package/lib/display-objects/Text.js +4 -6
- package/lib/dom/Animation.js +2 -4
- package/lib/dom/AnimationEffectTiming.js +1 -3
- package/lib/dom/AnimationEvent.js +1 -3
- package/lib/dom/AnimationTimeline.js +2 -4
- package/lib/dom/CustomElementRegistry.js +1 -3
- package/lib/dom/CustomEvent.js +1 -3
- package/lib/dom/Document.js +1 -3
- package/lib/dom/Element.js +4 -6
- package/lib/dom/EventTarget.js +3 -5
- package/lib/dom/FederatedEvent.js +1 -3
- package/lib/dom/FederatedMouseEvent.js +1 -3
- package/lib/dom/FederatedPointerEvent.js +1 -3
- package/lib/dom/FederatedWheelEvent.js +1 -3
- package/lib/dom/KeyframeEffect.js +2 -4
- package/lib/dom/KeyframeList.js +1 -1
- package/lib/dom/MutationEvent.js +1 -3
- package/lib/dom/MutationObserver.js +4 -11
- package/lib/dom/MutationRecord.js +1 -3
- package/lib/dom/Node.js +2 -4
- package/lib/index.js +1 -1
- package/lib/plugins/CullingPlugin.js +2 -4
- package/lib/plugins/DirtyCheckPlugin.js +1 -3
- package/lib/plugins/EventPlugin.js +5 -4
- package/lib/plugins/FrustumCullingStrategy.js +1 -3
- package/lib/plugins/PrepareRendererPlugin.js +1 -3
- package/lib/services/EventService.js +26 -7
- package/lib/services/OffscreenCanvasCreator.js +1 -3
- package/lib/services/RenderingContext.d.ts +2 -1
- package/lib/services/RenderingContext.js +4 -1
- package/lib/services/RenderingService.js +1 -3
- package/lib/services/SceneGraphSelector.js +2 -4
- package/lib/services/SceneGraphService.d.ts +2 -1
- package/lib/services/SceneGraphService.js +5 -6
- package/lib/services/TextService.js +3 -5
- package/lib/services/aabb/CircleUpdater.js +1 -3
- package/lib/services/aabb/EllipseUpdater.js +1 -3
- package/lib/services/aabb/LineUpdater.js +1 -3
- package/lib/services/aabb/PathUpdater.js +1 -3
- package/lib/services/aabb/PolylineUpdater.js +1 -3
- package/lib/services/aabb/RectUpdater.js +1 -3
- package/lib/services/aabb/TextUpdater.js +1 -3
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.d.ts +3 -2
- package/lib/services/aabb/interfaces.js +9 -3
- package/lib/shapes/AABB.js +1 -3
- package/lib/shapes/BoundingSphere.js +1 -3
- package/lib/shapes/Frustum.js +2 -4
- package/lib/shapes/Plane.js +1 -3
- package/lib/shapes/Point.js +1 -3
- package/lib/shapes/Ray.js +1 -3
- package/lib/shapes/Rectangle.js +1 -3
- package/lib/types.d.ts +2 -1
- package/lib/types.js +6 -2
- package/lib/utils/animation.js +2 -3
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.d.ts +0 -9
- package/lib/utils/custom-easing.js +42 -66
- package/lib/utils/math.js +9 -9
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +6 -6
- package/lib/utils/text.js +3 -3
- package/package.json +3 -3
- package/dist/index.umd.min.js +0 -30
package/es/shapes/Rectangle.js
CHANGED
package/es/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-o
|
|
|
4
4
|
import type { DisplayObject } from './display-objects';
|
|
5
5
|
import type { IRenderer } from './AbstractRenderer';
|
|
6
6
|
import type { CSSGlobalKeywords, CSSGradientValue, CSSKeywordValue, CSSRGB, CSSUnitValue } from './css';
|
|
7
|
+
import { Syringe } from 'mana-syringe';
|
|
7
8
|
export declare enum Shape {
|
|
8
9
|
GROUP = "g",
|
|
9
10
|
CIRCLE = "circle",
|
|
@@ -209,7 +210,7 @@ export interface RendererConfig {
|
|
|
209
210
|
*/
|
|
210
211
|
enableTAA: boolean;
|
|
211
212
|
}
|
|
212
|
-
export declare const CanvasConfig
|
|
213
|
+
export declare const CanvasConfig: Syringe.DefinedToken;
|
|
213
214
|
export interface CanvasConfig {
|
|
214
215
|
/**
|
|
215
216
|
* Renderer
|
package/es/types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Syringe } from 'mana-syringe';
|
|
1
2
|
export var Shape;
|
|
2
3
|
|
|
3
4
|
(function (Shape) {
|
|
@@ -49,4 +50,4 @@ export var TextAlign;
|
|
|
49
50
|
TextAlign["RIGHT"] = "right";
|
|
50
51
|
})(TextAlign || (TextAlign = {}));
|
|
51
52
|
|
|
52
|
-
export var CanvasConfig = 'CanvasConfig';
|
|
53
|
+
export var CanvasConfig = Syringe.defineToken('CanvasConfig');
|
|
@@ -38,7 +38,6 @@ export declare const parseEasingParameters: (str: string) => (string | number)[]
|
|
|
38
38
|
* easing functions, because of the nature of the function it can sometimes create an infinite loop, I suggest only using
|
|
39
39
|
* `getEasingDuration` for `spring`, specifically 'out-spring' and 'spring'
|
|
40
40
|
*/
|
|
41
|
-
export declare const getEasingDuration: (easing?: string | TypeEasingFunction) => number;
|
|
42
41
|
/**
|
|
43
42
|
These Easing Functions are based off of the Sozi Project's easing functions
|
|
44
43
|
https://github.com/sozi-projects/Sozi/blob/d72e44ebd580dc7579d1e177406ad41e632f961d/src/js/player/Timing.js
|
|
@@ -63,11 +62,3 @@ export declare const EasingFunctions: Record<string, TypeEasingFunction>;
|
|
|
63
62
|
export declare const complexEasingSyntax: (ease: string) => string;
|
|
64
63
|
/** Re-maps a number from one range to another. Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful. */
|
|
65
64
|
export declare const getEasingFunction: (ease: string) => TypeEasingFunction;
|
|
66
|
-
/**
|
|
67
|
-
* Allows you to register new easing functions
|
|
68
|
-
*/
|
|
69
|
-
export declare const registerEasingFunction: (key: string, fn: TypeEasingFunction) => void;
|
|
70
|
-
/**
|
|
71
|
-
* Allows you to register multiple new easing functions
|
|
72
|
-
*/
|
|
73
|
-
export declare const registerEasingFunctions: (...obj: (typeof EasingFunctions)[]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __read
|
|
1
|
+
import { __read } from "tslib";
|
|
2
2
|
/**
|
|
3
3
|
* ported from https://github.com/okikio/native/blob/master/packages/animate/src/custom-easing.ts
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ import { __read, __spreadArray } from "tslib";
|
|
|
6
6
|
import { bezier } from './bezier-easing';
|
|
7
7
|
export var convertToDash = function convertToDash(str) {
|
|
8
8
|
str = str.replace(/([A-Z])/g, function (letter) {
|
|
9
|
-
return "-"
|
|
9
|
+
return "-" + letter.toLowerCase();
|
|
10
10
|
}); // Remove first dash
|
|
11
11
|
|
|
12
12
|
return str.charAt(0) === '-' ? str.substr(1) : str;
|
|
@@ -128,36 +128,29 @@ export var parseEasingParameters = function parseEasingParameters(str) {
|
|
|
128
128
|
* easing functions, because of the nature of the function it can sometimes create an infinite loop, I suggest only using
|
|
129
129
|
* `getEasingDuration` for `spring`, specifically 'out-spring' and 'spring'
|
|
130
130
|
*/
|
|
131
|
+
// export const getEasingDuration = (easing: string | TypeEasingFunction = 'spring') => {
|
|
132
|
+
// if (EasingDurationCache.has(easing)) return EasingDurationCache.get(easing);
|
|
133
|
+
// // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
134
|
+
// const easingFunction = typeof easing == 'function' ? easing : getEasingFunction(easing as string);
|
|
135
|
+
// const params = typeof easing == 'function' ? [] : parseEasingParameters(easing);
|
|
136
|
+
// const frame = 1 / 6;
|
|
137
|
+
// let elapsed = 0;
|
|
138
|
+
// let rest = 0;
|
|
139
|
+
// let count = 0;
|
|
140
|
+
// while (++count < INTINITE_LOOP_LIMIT) {
|
|
141
|
+
// elapsed += frame;
|
|
142
|
+
// if (easingFunction(elapsed, params, undefined) === 1) {
|
|
143
|
+
// rest++;
|
|
144
|
+
// if (rest >= 16) break;
|
|
145
|
+
// } else {
|
|
146
|
+
// rest = 0;
|
|
147
|
+
// }
|
|
148
|
+
// }
|
|
149
|
+
// const duration = elapsed * frame * 1000;
|
|
150
|
+
// EasingDurationCache.set(easing, duration);
|
|
151
|
+
// return duration;
|
|
152
|
+
// };
|
|
131
153
|
|
|
132
|
-
export var getEasingDuration = function getEasingDuration(easing) {
|
|
133
|
-
if (easing === void 0) {
|
|
134
|
-
easing = 'spring';
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (EasingDurationCache.has(easing)) return EasingDurationCache.get(easing); // eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
138
|
-
|
|
139
|
-
var easingFunction = typeof easing == 'function' ? easing : getEasingFunction(easing);
|
|
140
|
-
var params = typeof easing == 'function' ? [] : parseEasingParameters(easing);
|
|
141
|
-
var frame = 1 / 6;
|
|
142
|
-
var elapsed = 0;
|
|
143
|
-
var rest = 0;
|
|
144
|
-
var count = 0;
|
|
145
|
-
|
|
146
|
-
while (++count < INTINITE_LOOP_LIMIT) {
|
|
147
|
-
elapsed += frame;
|
|
148
|
-
|
|
149
|
-
if (easingFunction(elapsed, params, undefined) === 1) {
|
|
150
|
-
rest++;
|
|
151
|
-
if (rest >= 16) break;
|
|
152
|
-
} else {
|
|
153
|
-
rest = 0;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
var duration = elapsed * frame * 1000;
|
|
158
|
-
EasingDurationCache.set(easing, duration);
|
|
159
|
-
return duration;
|
|
160
|
-
};
|
|
161
154
|
/**
|
|
162
155
|
These Easing Functions are based off of the Sozi Project's easing functions
|
|
163
156
|
https://github.com/sozi-projects/Sozi/blob/d72e44ebd580dc7579d1e177406ad41e632f961d/src/js/player/Timing.js
|
|
@@ -308,26 +301,17 @@ export var complexEasingSyntax = function complexEasingSyntax(ease) {
|
|
|
308
301
|
|
|
309
302
|
export var getEasingFunction = function getEasingFunction(ease) {
|
|
310
303
|
return EasingFunctions[complexEasingSyntax(ease)] || EasingFunctions.linear;
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
export var registerEasingFunctions = function registerEasingFunctions() {
|
|
326
|
-
var obj = [];
|
|
327
|
-
|
|
328
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
329
|
-
obj[_i] = arguments[_i];
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
Object.assign.apply(Object, __spreadArray([EasingFunctions], __read(obj), false));
|
|
333
|
-
};
|
|
304
|
+
}; // /**
|
|
305
|
+
// * Allows you to register new easing functions
|
|
306
|
+
// */
|
|
307
|
+
// export const registerEasingFunction = (key: string, fn: TypeEasingFunction) => {
|
|
308
|
+
// Object.assign(EasingFunctions, {
|
|
309
|
+
// [key]: fn,
|
|
310
|
+
// });
|
|
311
|
+
// };
|
|
312
|
+
// /**
|
|
313
|
+
// * Allows you to register multiple new easing functions
|
|
314
|
+
// */
|
|
315
|
+
// export const registerEasingFunctions = (...obj: typeof EasingFunctions[]) => {
|
|
316
|
+
// Object.assign(EasingFunctions, ...obj);
|
|
317
|
+
// };
|
package/es/utils/path.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
|
|
|
5
5
|
export declare function getPathArea(pathArray: PathCommand[]): number;
|
|
6
6
|
export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
|
|
7
7
|
export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
|
|
8
|
-
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["
|
|
8
|
+
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["c" | "C", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["Q" | "q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number])[];
|
|
9
9
|
/**
|
|
10
10
|
* convert object to path, should account for:
|
|
11
11
|
* * transform & origin
|
package/es/utils/path.js
CHANGED
|
@@ -216,7 +216,7 @@ function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
|
|
|
216
216
|
if (cur[0] === 'M' || cur[0] === 'L') {
|
|
217
217
|
var p = vec3.fromValues(cur[1] - defX, cur[2] - defY, 0);
|
|
218
218
|
vec3.transformMat4(p, p, localTransform);
|
|
219
|
-
path = ""
|
|
219
|
+
path = "" + cur[0] + p[0] + "," + p[1];
|
|
220
220
|
} else if (cur[0] === 'Z') {
|
|
221
221
|
path = cur[0];
|
|
222
222
|
} else if (cur[0] === 'C') {
|
|
@@ -226,11 +226,11 @@ function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
|
|
|
226
226
|
vec3.transformMat4(p1, p1, localTransform);
|
|
227
227
|
vec3.transformMat4(p2, p2, localTransform);
|
|
228
228
|
vec3.transformMat4(p3, p3, localTransform);
|
|
229
|
-
path = ""
|
|
229
|
+
path = "" + cur[0] + p1[0] + "," + p1[1] + "," + p2[0] + "," + p2[1] + "," + p3[0] + "," + p3[1];
|
|
230
230
|
} else if (cur[0] === 'A') {
|
|
231
231
|
var c = vec3.fromValues(cur[6] - defX, cur[7] - defY, 0);
|
|
232
232
|
vec3.transformMat4(c, c, localTransform);
|
|
233
|
-
path = ""
|
|
233
|
+
path = "" + cur[0] + cur[1] + "," + cur[2] + "," + cur[3] + "," + cur[4] + "," + cur[5] + "," + c[0] + "," + c[1];
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
return prev += path;
|
package/es/utils/text.js
CHANGED
|
@@ -7,7 +7,7 @@ export function toFontString(attributes) {
|
|
|
7
7
|
fontVariant = attributes.fontVariant,
|
|
8
8
|
fontWeight = attributes.fontWeight; // build canvas api font setting from individual components. Convert a numeric this.fontSize to px
|
|
9
9
|
|
|
10
|
-
var fontSizeString = isNumber(fontSize) ?
|
|
10
|
+
var fontSizeString = isNumber(fontSize) ? fontSize + "px" : fontSize.toString(); // Clean-up fontFamily property by quoting each font name
|
|
11
11
|
// this will support font names with spaces
|
|
12
12
|
// @ts-ignore
|
|
13
13
|
|
|
@@ -18,11 +18,11 @@ export function toFontString(attributes) {
|
|
|
18
18
|
var fontFamily_1 = fontFamilies[i].trim(); // Check if font already contains strings
|
|
19
19
|
|
|
20
20
|
if (!/([\"\'])[^\'\"]+\1/.test(fontFamily_1) && genericFontFamilies.indexOf(fontFamily_1) < 0) {
|
|
21
|
-
fontFamily_1 = "\""
|
|
21
|
+
fontFamily_1 = "\"" + fontFamily_1 + "\"";
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
fontFamilies[i] = fontFamily_1;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return fontStyle + " " + fontVariant + " " + fontWeight + " " + fontSizeString + " " + fontFamilies.join(',');
|
|
28
28
|
}
|
package/lib/AbstractRenderer.js
CHANGED
|
@@ -7,9 +7,7 @@ exports.AbstractRenderer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
10
|
-
var AbstractRenderer =
|
|
11
|
-
/** @class */
|
|
12
|
-
function () {
|
|
10
|
+
var AbstractRenderer = function () {
|
|
13
11
|
function AbstractRenderer(config) {
|
|
14
12
|
this.plugins = [];
|
|
15
13
|
this.config = (0, _tslib.__assign)({
|
package/lib/Canvas.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Canvas = exports.CanvasEvent = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -54,9 +54,7 @@ exports.CanvasEvent = CanvasEvent;
|
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var Canvas =
|
|
58
|
-
/** @class */
|
|
59
|
-
function (_super) {
|
|
57
|
+
var Canvas = function (_super) {
|
|
60
58
|
(0, _tslib.__extends)(Canvas, _super);
|
|
61
59
|
|
|
62
60
|
function Canvas(config) {
|
|
@@ -111,20 +109,18 @@ function (_super) {
|
|
|
111
109
|
|
|
112
110
|
|
|
113
111
|
_this.devicePixelRatio = dpr;
|
|
114
|
-
_this.requestAnimationFrame = requestAnimationFrame
|
|
115
|
-
_this.cancelAnimationFrame = cancelAnimationFrame
|
|
112
|
+
_this.requestAnimationFrame = requestAnimationFrame !== null && requestAnimationFrame !== void 0 ? requestAnimationFrame : _requestAnimationFramePolyfill.requestAnimationFrame.bind(globalThis);
|
|
113
|
+
_this.cancelAnimationFrame = cancelAnimationFrame !== null && cancelAnimationFrame !== void 0 ? cancelAnimationFrame : _requestAnimationFramePolyfill.cancelAnimationFrame.bind(globalThis);
|
|
116
114
|
/**
|
|
117
115
|
* limits query
|
|
118
116
|
*/
|
|
119
117
|
|
|
120
|
-
_this.supportTouchEvent = supportTouchEvent
|
|
121
|
-
_this.supportPointerEvent = supportPointerEvent
|
|
122
|
-
|
|
123
|
-
_this.isTouchEvent = isTouchEvent || function (event) {
|
|
118
|
+
_this.supportTouchEvent = supportTouchEvent !== null && supportTouchEvent !== void 0 ? supportTouchEvent : 'ontouchstart' in globalThis;
|
|
119
|
+
_this.supportPointerEvent = supportPointerEvent !== null && supportPointerEvent !== void 0 ? supportPointerEvent : !!globalThis.PointerEvent;
|
|
120
|
+
_this.isTouchEvent = isTouchEvent !== null && isTouchEvent !== void 0 ? isTouchEvent : function (event) {
|
|
124
121
|
return _this.supportTouchEvent && event instanceof globalThis.TouchEvent;
|
|
125
122
|
};
|
|
126
|
-
|
|
127
|
-
_this.isMouseEvent = isMouseEvent || function (event) {
|
|
123
|
+
_this.isMouseEvent = isMouseEvent !== null && isMouseEvent !== void 0 ? isMouseEvent : function (event) {
|
|
128
124
|
return !globalThis.MouseEvent || event instanceof globalThis.MouseEvent && (!_this.supportPointerEvent || !(event instanceof globalThis.PointerEvent));
|
|
129
125
|
};
|
|
130
126
|
|
package/lib/DisplayObjectPool.js
CHANGED
package/lib/camera/Camera.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
|
+
import type { vec2 } from 'gl-matrix';
|
|
2
3
|
import { mat4, vec3 } from 'gl-matrix';
|
|
3
4
|
import { Landmark } from './Landmark';
|
|
4
5
|
import { Frustum } from '../shapes';
|
|
5
6
|
import type { Canvas } from '../Canvas';
|
|
6
|
-
|
|
7
|
+
import { Syringe } from 'mana-syringe';
|
|
8
|
+
export declare const DefaultCamera: Syringe.DefinedToken;
|
|
7
9
|
export declare enum CAMERA_TYPE {
|
|
8
10
|
ORBITING = "ORBITING",
|
|
9
11
|
EXPLORING = "EXPLORING",
|
|
@@ -114,7 +116,6 @@ export declare class Camera extends EventEmitter {
|
|
|
114
116
|
private projectionMatrixInverse;
|
|
115
117
|
private jitteredProjectionMatrix;
|
|
116
118
|
private view;
|
|
117
|
-
private following;
|
|
118
119
|
private type;
|
|
119
120
|
private trackingMode;
|
|
120
121
|
private projectionMode;
|
|
@@ -239,13 +240,17 @@ export declare class Camera extends EventEmitter {
|
|
|
239
240
|
* 沿 n 轴移动,当距离视点远时移动速度较快,离视点越近速度越慢
|
|
240
241
|
*/
|
|
241
242
|
dolly(value: number): this;
|
|
242
|
-
createLandmark(name: string, params
|
|
243
|
-
position: vec3;
|
|
244
|
-
focalPoint: vec3;
|
|
243
|
+
createLandmark(name: string, params?: Partial<{
|
|
244
|
+
position: vec3 | vec2;
|
|
245
|
+
focalPoint: vec3 | vec2;
|
|
246
|
+
zoom?: number;
|
|
245
247
|
roll?: number;
|
|
246
|
-
}): Landmark;
|
|
248
|
+
}>): Landmark;
|
|
247
249
|
setLandmark(name: string): this;
|
|
248
|
-
gotoLandmark(name: string,
|
|
250
|
+
gotoLandmark(name: string | Landmark, options?: number | Partial<{
|
|
251
|
+
easing: string;
|
|
252
|
+
duration: number;
|
|
253
|
+
}>): void;
|
|
249
254
|
/**
|
|
250
255
|
* 根据相机矩阵重新计算各种相机参数
|
|
251
256
|
*/
|
package/lib/camera/Camera.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Camera = exports.CameraEvent = exports.CAMERA_PROJECTION_MODE = exports.CAMERA_TRACKING_MODE = exports.CAMERA_TYPE = exports.DefaultCamera = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -17,7 +17,14 @@ var _shapes = require("../shapes");
|
|
|
17
17
|
|
|
18
18
|
var _math = require("../utils/math");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _animation = require("../utils/animation");
|
|
21
|
+
|
|
22
|
+
var _util = require("@antv/util");
|
|
23
|
+
|
|
24
|
+
var _manaSyringe = require("mana-syringe");
|
|
25
|
+
|
|
26
|
+
var DefaultCamera = _manaSyringe.Syringe.defineToken('DefaultCamera');
|
|
27
|
+
|
|
21
28
|
exports.DefaultCamera = DefaultCamera;
|
|
22
29
|
var CAMERA_TYPE;
|
|
23
30
|
exports.CAMERA_TYPE = CAMERA_TYPE;
|
|
@@ -61,9 +68,7 @@ var RAD_2_DEG = 180 / Math.PI;
|
|
|
61
68
|
* 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互
|
|
62
69
|
*/
|
|
63
70
|
|
|
64
|
-
var Camera =
|
|
65
|
-
/** @class */
|
|
66
|
-
function (_super) {
|
|
71
|
+
var Camera = function (_super) {
|
|
67
72
|
(0, _tslib.__extends)(Camera, _super);
|
|
68
73
|
|
|
69
74
|
function Camera() {
|
|
@@ -157,8 +162,8 @@ function (_super) {
|
|
|
157
162
|
_this.aspect = 1;
|
|
158
163
|
_this.projectionMatrix = _glMatrix.mat4.create();
|
|
159
164
|
_this.projectionMatrixInverse = _glMatrix.mat4.create();
|
|
160
|
-
_this.jitteredProjectionMatrix = undefined;
|
|
161
|
-
|
|
165
|
+
_this.jitteredProjectionMatrix = undefined; // private following = undefined;
|
|
166
|
+
|
|
162
167
|
_this.type = CAMERA_TYPE.EXPLORING;
|
|
163
168
|
_this.trackingMode = CAMERA_TRACKING_MODE.DEFAULT;
|
|
164
169
|
_this.projectionMode = CAMERA_PROJECTION_MODE.PERSPECTIVE;
|
|
@@ -775,12 +780,24 @@ function (_super) {
|
|
|
775
780
|
};
|
|
776
781
|
|
|
777
782
|
Camera.prototype.createLandmark = function (name, params) {
|
|
783
|
+
if (params === void 0) {
|
|
784
|
+
params = {};
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
var position = params.position,
|
|
788
|
+
focalPoint = params.focalPoint,
|
|
789
|
+
roll = params.roll,
|
|
790
|
+
zoom = params.zoom;
|
|
778
791
|
var camera = this.clone();
|
|
779
|
-
camera.setPosition(
|
|
780
|
-
camera.setFocalPoint(
|
|
792
|
+
camera.setPosition(_glMatrix.vec3.fromValues(position[0], position[1], position[2] || this.position[2]));
|
|
793
|
+
camera.setFocalPoint(_glMatrix.vec3.fromValues(focalPoint[0], focalPoint[1], focalPoint[2] || this.focalPoint[2]));
|
|
781
794
|
|
|
782
|
-
if (
|
|
783
|
-
camera.setRoll(
|
|
795
|
+
if (!(0, _util.isUndefined)(roll)) {
|
|
796
|
+
camera.setRoll(roll);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
if (!(0, _util.isUndefined)(zoom)) {
|
|
800
|
+
camera.setZoom(zoom);
|
|
784
801
|
}
|
|
785
802
|
|
|
786
803
|
var landmark = new _Landmark.Landmark(name, camera);
|
|
@@ -794,19 +811,29 @@ function (_super) {
|
|
|
794
811
|
return this;
|
|
795
812
|
};
|
|
796
813
|
|
|
797
|
-
Camera.prototype.gotoLandmark = function (name,
|
|
814
|
+
Camera.prototype.gotoLandmark = function (name, options) {
|
|
798
815
|
var _this = this;
|
|
799
816
|
|
|
800
|
-
if (
|
|
801
|
-
|
|
817
|
+
if (options === void 0) {
|
|
818
|
+
options = {};
|
|
802
819
|
}
|
|
803
820
|
|
|
804
|
-
var landmark = this.landmarks.find(function (l) {
|
|
821
|
+
var landmark = (0, _util.isString)(name) ? this.landmarks.find(function (l) {
|
|
805
822
|
return l.name === name;
|
|
806
|
-
});
|
|
823
|
+
}) : name;
|
|
807
824
|
|
|
808
825
|
if (landmark) {
|
|
809
|
-
|
|
826
|
+
var _a = (0, _util.isNumber)(options) ? {
|
|
827
|
+
duration: options
|
|
828
|
+
} : options,
|
|
829
|
+
_b = _a.easing,
|
|
830
|
+
easing = _b === void 0 ? 'ease' : _b,
|
|
831
|
+
_c = _a.duration,
|
|
832
|
+
duration_1 = _c === void 0 ? 1000 : _c;
|
|
833
|
+
|
|
834
|
+
var epsilon_1 = 0.01;
|
|
835
|
+
|
|
836
|
+
if (duration_1 === 0) {
|
|
810
837
|
landmark.retrieve(this);
|
|
811
838
|
return;
|
|
812
839
|
}
|
|
@@ -819,7 +846,9 @@ function (_super) {
|
|
|
819
846
|
|
|
820
847
|
var destPosition_1 = landmark.getPosition();
|
|
821
848
|
var destFocalPoint_1 = landmark.getFocalPoint();
|
|
849
|
+
var destZoom_1 = landmark.getZoom();
|
|
822
850
|
var destRoll_1 = landmark.getRoll();
|
|
851
|
+
var easingFunction_1 = (0, _animation.parseEasingFunction)(easing);
|
|
823
852
|
var timeStart_1;
|
|
824
853
|
|
|
825
854
|
var animate_1 = function animate_1(timestamp) {
|
|
@@ -827,14 +856,15 @@ function (_super) {
|
|
|
827
856
|
timeStart_1 = timestamp;
|
|
828
857
|
}
|
|
829
858
|
|
|
830
|
-
var elapsed = timestamp - timeStart_1; //
|
|
859
|
+
var elapsed = timestamp - timeStart_1; // use the same ease function in animatio system
|
|
831
860
|
|
|
832
|
-
var t = (
|
|
861
|
+
var t = easingFunction_1(elapsed / duration_1);
|
|
833
862
|
|
|
834
863
|
var interFocalPoint = _glMatrix.vec3.create();
|
|
835
864
|
|
|
836
865
|
var interPosition = _glMatrix.vec3.create();
|
|
837
866
|
|
|
867
|
+
var interZoom = 1;
|
|
838
868
|
var interRoll = 0;
|
|
839
869
|
|
|
840
870
|
_glMatrix.vec3.lerp(interFocalPoint, _this.focalPoint, destFocalPoint_1, t);
|
|
@@ -842,6 +872,7 @@ function (_super) {
|
|
|
842
872
|
_glMatrix.vec3.lerp(interPosition, _this.position, destPosition_1, t);
|
|
843
873
|
|
|
844
874
|
interRoll = _this.roll * (1 - t) + destRoll_1 * t;
|
|
875
|
+
interZoom = _this.zoom * (1 - t) + destZoom_1 * t;
|
|
845
876
|
|
|
846
877
|
_this.setFocalPoint(interFocalPoint);
|
|
847
878
|
|
|
@@ -849,19 +880,22 @@ function (_super) {
|
|
|
849
880
|
|
|
850
881
|
_this.setRoll(interRoll);
|
|
851
882
|
|
|
883
|
+
_this.setZoom(interZoom);
|
|
884
|
+
|
|
852
885
|
_this.computeMatrix();
|
|
853
886
|
|
|
854
887
|
_this.triggerUpdate();
|
|
855
888
|
|
|
856
889
|
var dist = _glMatrix.vec3.dist(interFocalPoint, destFocalPoint_1) + _glMatrix.vec3.dist(interPosition, destPosition_1);
|
|
857
890
|
|
|
858
|
-
if (dist
|
|
859
|
-
|
|
860
|
-
|
|
891
|
+
if (dist <= epsilon_1) {
|
|
892
|
+
_this.setFocalPoint(destFocalPoint_1);
|
|
893
|
+
|
|
894
|
+
_this.setPosition(destPosition_1);
|
|
861
895
|
|
|
862
|
-
_this.
|
|
896
|
+
_this.setRoll(destRoll_1);
|
|
863
897
|
|
|
864
|
-
_this.
|
|
898
|
+
_this.setZoom(destZoom_1);
|
|
865
899
|
|
|
866
900
|
_this.computeMatrix(); // this.interactor.connect();
|
|
867
901
|
|
|
@@ -869,7 +903,7 @@ function (_super) {
|
|
|
869
903
|
return;
|
|
870
904
|
}
|
|
871
905
|
|
|
872
|
-
if (elapsed <
|
|
906
|
+
if (elapsed < duration_1) {
|
|
873
907
|
_this.landmarkAnimationID = _this.canvas.requestAnimationFrame(animate_1);
|
|
874
908
|
}
|
|
875
909
|
};
|
package/lib/camera/Landmark.d.ts
CHANGED
|
@@ -20,9 +20,11 @@ export declare class Landmark {
|
|
|
20
20
|
private relAzimuth;
|
|
21
21
|
private relElevation;
|
|
22
22
|
private relRoll;
|
|
23
|
+
private zoom;
|
|
23
24
|
constructor(name: string, c: Camera);
|
|
24
25
|
getPosition(): vec3;
|
|
25
26
|
getFocalPoint(): vec3;
|
|
26
27
|
getRoll(): number;
|
|
28
|
+
getZoom(): number;
|
|
27
29
|
retrieve(c: Camera): void;
|
|
28
30
|
}
|
package/lib/camera/Landmark.js
CHANGED
|
@@ -10,10 +10,7 @@ var _glMatrix = require("gl-matrix");
|
|
|
10
10
|
/**
|
|
11
11
|
* 保存相机状态,便于后续在多个 Landmark 间移动
|
|
12
12
|
*/
|
|
13
|
-
var Landmark =
|
|
14
|
-
/** @class */
|
|
15
|
-
function () {
|
|
16
|
-
// private zoom = 1;
|
|
13
|
+
var Landmark = function () {
|
|
17
14
|
function Landmark(name, c) {
|
|
18
15
|
this.azimuth = 0;
|
|
19
16
|
this.elevation = 0;
|
|
@@ -21,6 +18,7 @@ function () {
|
|
|
21
18
|
this.relAzimuth = 0;
|
|
22
19
|
this.relElevation = 0;
|
|
23
20
|
this.relRoll = 0;
|
|
21
|
+
this.zoom = 1;
|
|
24
22
|
this.name = name;
|
|
25
23
|
this.matrix = _glMatrix.mat4.clone(c.matrix);
|
|
26
24
|
this.right = _glMatrix.vec3.clone(c.right);
|
|
@@ -36,7 +34,8 @@ function () {
|
|
|
36
34
|
this.relElevation = c.relElevation;
|
|
37
35
|
this.relRoll = c.relRoll;
|
|
38
36
|
this.dollyingStep = c.dollyingStep;
|
|
39
|
-
this.distance = c.distance;
|
|
37
|
+
this.distance = c.distance;
|
|
38
|
+
this.zoom = c.zoom;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
Landmark.prototype.getPosition = function () {
|
|
@@ -51,6 +50,10 @@ function () {
|
|
|
51
50
|
return this.roll;
|
|
52
51
|
};
|
|
53
52
|
|
|
53
|
+
Landmark.prototype.getZoom = function () {
|
|
54
|
+
return this.zoom;
|
|
55
|
+
};
|
|
56
|
+
|
|
54
57
|
Landmark.prototype.retrieve = function (c) {
|
|
55
58
|
c.matrix = _glMatrix.mat4.copy(c.matrix, this.matrix);
|
|
56
59
|
c.right = _glMatrix.vec3.copy(c.right, this.right);
|
|
@@ -66,7 +69,8 @@ function () {
|
|
|
66
69
|
c.relElevation = this.relElevation;
|
|
67
70
|
c.relRoll = this.relRoll;
|
|
68
71
|
c.dollyingStep = this.dollyingStep;
|
|
69
|
-
c.distance = this.distance;
|
|
72
|
+
c.distance = this.distance;
|
|
73
|
+
c.zoom = this.zoom;
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
return Landmark;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Cullable = exports.Strategy = void 0;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy
|
|
@@ -15,9 +15,7 @@ exports.Strategy = Strategy;
|
|
|
15
15
|
Strategy[Strategy["Standard"] = 0] = "Standard";
|
|
16
16
|
})(Strategy || (exports.Strategy = Strategy = {}));
|
|
17
17
|
|
|
18
|
-
var Cullable =
|
|
19
|
-
/** @class */
|
|
20
|
-
function () {
|
|
18
|
+
var Cullable = function () {
|
|
21
19
|
function Cullable() {
|
|
22
20
|
this.strategy = Strategy.Standard;
|
|
23
21
|
this.visibilityPlaneMask = -1;
|
|
@@ -10,9 +10,7 @@ var _glMatrix = require("gl-matrix");
|
|
|
10
10
|
/**
|
|
11
11
|
* do RTS transformation for 2D/3D
|
|
12
12
|
*/
|
|
13
|
-
var Transform =
|
|
14
|
-
/** @class */
|
|
15
|
-
function () {
|
|
13
|
+
var Transform = function () {
|
|
16
14
|
function Transform() {
|
|
17
15
|
this.dirtyFlag = false;
|
|
18
16
|
this.localDirtyFlag = false;
|