@antv/g 5.1.1 → 5.1.3-alpha.1
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/dist/AbstractRenderer.d.ts +38 -0
- package/dist/AbstractRenderer.d.ts.map +1 -0
- package/dist/Canvas.d.ts +150 -0
- package/dist/Canvas.d.ts.map +1 -0
- package/dist/DisplayObjectPool.d.ts +10 -0
- package/dist/DisplayObjectPool.d.ts.map +1 -0
- package/dist/__tests__/utils.d.ts +2 -0
- package/dist/__tests__/utils.d.ts.map +1 -0
- package/dist/camera/Camera.d.ts +328 -0
- package/dist/camera/Camera.d.ts.map +1 -0
- package/dist/camera/Landmark.d.ts +24 -0
- package/dist/camera/Landmark.d.ts.map +1 -0
- package/dist/camera/index.d.ts +3 -0
- package/dist/camera/index.d.ts.map +1 -0
- package/dist/canvas-module.d.ts +2 -0
- package/dist/canvas-module.d.ts.map +1 -0
- package/dist/components/Cullable.d.ts +15 -0
- package/dist/components/Cullable.d.ts.map +1 -0
- package/dist/components/Geometry.d.ts +13 -0
- package/dist/components/Geometry.d.ts.map +1 -0
- package/dist/components/Renderable.d.ts +25 -0
- package/dist/components/Renderable.d.ts.map +1 -0
- package/dist/components/Sortable.d.ts +21 -0
- package/dist/components/Sortable.d.ts.map +1 -0
- package/dist/components/Transform.d.ts +29 -0
- package/dist/components/Transform.d.ts.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/css/CSS.d.ts +89 -0
- package/dist/css/CSS.d.ts.map +1 -0
- package/dist/css/CSSProperty.d.ts +42 -0
- package/dist/css/CSSProperty.d.ts.map +1 -0
- package/dist/css/StyleValueRegistry.d.ts +124 -0
- package/dist/css/StyleValueRegistry.d.ts.map +1 -0
- package/dist/css/cssom/CSSColorValue.d.ts +24 -0
- package/dist/css/cssom/CSSColorValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSGradientValue.d.ts +40 -0
- package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSKeywordValue.d.ts +16 -0
- package/dist/css/cssom/CSSKeywordValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSMathOperator.d.ts +12 -0
- package/dist/css/cssom/CSSMathOperator.d.ts.map +1 -0
- package/dist/css/cssom/CSSNumericSumValue.d.ts +8 -0
- package/dist/css/cssom/CSSNumericSumValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSNumericValue.d.ts +213 -0
- package/dist/css/cssom/CSSNumericValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSRGB.d.ts +26 -0
- package/dist/css/cssom/CSSRGB.d.ts.map +1 -0
- package/dist/css/cssom/CSSStyleValue.d.ts +54 -0
- package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -0
- package/dist/css/cssom/index.d.ts +18 -0
- package/dist/css/cssom/index.d.ts.map +1 -0
- package/dist/css/cssom/types.d.ts +87 -0
- package/dist/css/cssom/types.d.ts.map +1 -0
- package/dist/css/index.d.ts +12 -0
- package/dist/css/index.d.ts.map +1 -0
- package/dist/css/interfaces.d.ts +117 -0
- package/dist/css/interfaces.d.ts.map +1 -0
- package/dist/css/layout/FragmentResult.d.ts +33 -0
- package/dist/css/layout/FragmentResult.d.ts.map +1 -0
- package/dist/css/layout/LayoutChildren.d.ts +24 -0
- package/dist/css/layout/LayoutChildren.d.ts.map +1 -0
- package/dist/css/layout/LayoutContext.d.ts +36 -0
- package/dist/css/layout/LayoutContext.d.ts.map +1 -0
- package/dist/css/layout/LayoutDefinition.d.ts +21 -0
- package/dist/css/layout/LayoutDefinition.d.ts.map +1 -0
- package/dist/css/layout/LayoutEdges.d.ts +25 -0
- package/dist/css/layout/LayoutEdges.d.ts.map +1 -0
- package/dist/css/layout/LayoutEngine.d.ts +42 -0
- package/dist/css/layout/LayoutEngine.d.ts.map +1 -0
- package/dist/css/layout/LayoutFragment.d.ts +27 -0
- package/dist/css/layout/LayoutFragment.d.ts.map +1 -0
- package/dist/css/layout/LayoutObject.d.ts +47 -0
- package/dist/css/layout/LayoutObject.d.ts.map +1 -0
- package/dist/css/layout/LayoutRegistry.d.ts +17 -0
- package/dist/css/layout/LayoutRegistry.d.ts.map +1 -0
- package/dist/css/layout/LayoutWorkTask.d.ts +15 -0
- package/dist/css/layout/LayoutWorkTask.d.ts.map +1 -0
- package/dist/css/layout/index.d.ts +12 -0
- package/dist/css/layout/index.d.ts.map +1 -0
- package/dist/css/layout/types.d.ts +105 -0
- package/dist/css/layout/types.d.ts.map +1 -0
- package/dist/css/parser/color.d.ts +7 -0
- package/dist/css/parser/color.d.ts.map +1 -0
- package/dist/css/parser/dimension.d.ts +38 -0
- package/dist/css/parser/dimension.d.ts.map +1 -0
- package/dist/css/parser/filter.d.ts +8 -0
- package/dist/css/parser/filter.d.ts.map +1 -0
- package/dist/css/parser/index.d.ts +16 -0
- package/dist/css/parser/index.d.ts.map +1 -0
- package/dist/css/parser/numeric.d.ts +20 -0
- package/dist/css/parser/numeric.d.ts.map +1 -0
- package/dist/css/parser/path.d.ts +6 -0
- package/dist/css/parser/path.d.ts.map +1 -0
- package/dist/css/parser/points.d.ts +13 -0
- package/dist/css/parser/points.d.ts.map +1 -0
- package/dist/css/parser/transform-origin.d.ts +7 -0
- package/dist/css/parser/transform-origin.d.ts.map +1 -0
- package/dist/css/parser/transform.d.ts +14 -0
- package/dist/css/parser/transform.d.ts.map +1 -0
- package/dist/css/parser/types.d.ts +3 -0
- package/dist/css/parser/types.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts +21 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyColor.d.ts +5 -0
- package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyFilter.d.ts +4 -0
- package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +7 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +12 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +22 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts +7 -0
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +4 -0
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyOffsetPath.d.ts +4 -0
- package/dist/css/properties/CSSPropertyOffsetPath.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyOpacity.d.ts +7 -0
- package/dist/css/properties/CSSPropertyOpacity.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyPath.d.ts +4 -0
- package/dist/css/properties/CSSPropertyPath.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyPoints.d.ts +11 -0
- package/dist/css/properties/CSSPropertyPoints.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyShadowBlur.d.ts +3 -0
- package/dist/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyText.d.ts +4 -0
- package/dist/css/properties/CSSPropertyText.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyTextTransform.d.ts +4 -0
- package/dist/css/properties/CSSPropertyTextTransform.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyTransform.d.ts +33 -0
- package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +9 -0
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyZIndex.d.ts +4 -0
- package/dist/css/properties/CSSPropertyZIndex.d.ts.map +1 -0
- package/dist/css/properties/index.d.ts +19 -0
- package/dist/css/properties/index.d.ts.map +1 -0
- package/dist/display-objects/Circle.d.ts +18 -0
- package/dist/display-objects/Circle.d.ts.map +1 -0
- package/dist/display-objects/CustomElement.d.ts +25 -0
- package/dist/display-objects/CustomElement.d.ts.map +1 -0
- package/dist/display-objects/DisplayObject.d.ts +275 -0
- package/dist/display-objects/DisplayObject.d.ts.map +1 -0
- package/dist/display-objects/Ellipse.d.ts +20 -0
- package/dist/display-objects/Ellipse.d.ts.map +1 -0
- package/dist/display-objects/Group.d.ts +30 -0
- package/dist/display-objects/Group.d.ts.map +1 -0
- package/dist/display-objects/HTML.d.ts +42 -0
- package/dist/display-objects/HTML.d.ts.map +1 -0
- package/dist/display-objects/Image.d.ts +24 -0
- package/dist/display-objects/Image.d.ts.map +1 -0
- package/dist/display-objects/Line.d.ts +31 -0
- package/dist/display-objects/Line.d.ts.map +1 -0
- package/dist/display-objects/Path.d.ts +49 -0
- package/dist/display-objects/Path.d.ts.map +1 -0
- package/dist/display-objects/Polygon.d.ts +17 -0
- package/dist/display-objects/Polygon.d.ts.map +1 -0
- package/dist/display-objects/Polyline.d.ts +22 -0
- package/dist/display-objects/Polyline.d.ts.map +1 -0
- package/dist/display-objects/Rect.d.ts +25 -0
- package/dist/display-objects/Rect.d.ts.map +1 -0
- package/dist/display-objects/Text.d.ts +92 -0
- package/dist/display-objects/Text.d.ts.map +1 -0
- package/dist/display-objects/index.d.ts +14 -0
- package/dist/display-objects/index.d.ts.map +1 -0
- package/dist/dom/Animation.d.ts +133 -0
- package/dist/dom/Animation.d.ts.map +1 -0
- package/dist/dom/AnimationEffectTiming.d.ts +59 -0
- package/dist/dom/AnimationEffectTiming.d.ts.map +1 -0
- package/dist/dom/AnimationEvent.d.ts +12 -0
- package/dist/dom/AnimationEvent.d.ts.map +1 -0
- package/dist/dom/AnimationTimeline.d.ts +41 -0
- package/dist/dom/AnimationTimeline.d.ts.map +1 -0
- package/dist/dom/CustomElementRegistry.d.ts +16 -0
- package/dist/dom/CustomElementRegistry.d.ts.map +1 -0
- package/dist/dom/CustomEvent.d.ts +17 -0
- package/dist/dom/CustomEvent.d.ts.map +1 -0
- package/dist/dom/Document.d.ts +73 -0
- package/dist/dom/Document.d.ts.map +1 -0
- package/dist/dom/Element.d.ts +188 -0
- package/dist/dom/Element.d.ts.map +1 -0
- package/dist/dom/EventTarget.d.ts +41 -0
- package/dist/dom/EventTarget.d.ts.map +1 -0
- package/dist/dom/FederatedEvent.d.ts +146 -0
- package/dist/dom/FederatedEvent.d.ts.map +1 -0
- package/dist/dom/FederatedMouseEvent.d.ts +53 -0
- package/dist/dom/FederatedMouseEvent.d.ts.map +1 -0
- package/dist/dom/FederatedPointerEvent.d.ts +76 -0
- package/dist/dom/FederatedPointerEvent.d.ts.map +1 -0
- package/dist/dom/FederatedWheelEvent.d.ts +21 -0
- package/dist/dom/FederatedWheelEvent.d.ts.map +1 -0
- package/dist/dom/KeyframeEffect.d.ts +48 -0
- package/dist/dom/KeyframeEffect.d.ts.map +1 -0
- package/dist/dom/KeyframeList.d.ts +3 -0
- package/dist/dom/KeyframeList.d.ts.map +1 -0
- package/dist/dom/MutationEvent.d.ts +16 -0
- package/dist/dom/MutationEvent.d.ts.map +1 -0
- package/dist/dom/MutationObserver.d.ts +37 -0
- package/dist/dom/MutationObserver.d.ts.map +1 -0
- package/dist/dom/MutationRecord.d.ts +15 -0
- package/dist/dom/MutationRecord.d.ts.map +1 -0
- package/dist/dom/Node.d.ts +139 -0
- package/dist/dom/Node.d.ts.map +1 -0
- package/dist/dom/index.d.ts +21 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/interfaces.d.ts +373 -0
- package/dist/dom/interfaces.d.ts.map +1 -0
- package/dist/global-module.d.ts +2 -0
- package/dist/global-module.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +20766 -0
- package/dist/index.js +20942 -0
- package/dist/index.umd.js +29072 -0
- package/dist/index.umd.min.js +14 -28
- package/dist/plugins/CullingPlugin.d.ts +18 -0
- package/dist/plugins/CullingPlugin.d.ts.map +1 -0
- package/dist/plugins/DirtyCheckPlugin.d.ts +11 -0
- package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -0
- package/dist/plugins/EventPlugin.d.ts +30 -0
- package/dist/plugins/EventPlugin.d.ts.map +1 -0
- package/dist/plugins/FrustumCullingStrategy.d.ts +22 -0
- package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -0
- package/dist/plugins/PrepareRendererPlugin.d.ts +8 -0
- package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -0
- package/dist/services/ContextService.d.ts +14 -0
- package/dist/services/ContextService.d.ts.map +1 -0
- package/dist/services/EventService.d.ts +72 -0
- package/dist/services/EventService.d.ts.map +1 -0
- package/dist/services/OffscreenCanvasCreator.d.ts +14 -0
- package/dist/services/OffscreenCanvasCreator.d.ts.map +1 -0
- package/dist/services/RenderingContext.d.ts +27 -0
- package/dist/services/RenderingContext.d.ts.map +1 -0
- package/dist/services/RenderingService.d.ts +103 -0
- package/dist/services/RenderingService.d.ts.map +1 -0
- package/dist/services/SceneGraphSelector.d.ts +24 -0
- package/dist/services/SceneGraphSelector.d.ts.map +1 -0
- package/dist/services/SceneGraphService.d.ts +154 -0
- package/dist/services/SceneGraphService.d.ts.map +1 -0
- package/dist/services/TextService.d.ts +37 -0
- package/dist/services/TextService.d.ts.map +1 -0
- package/dist/services/aabb/CircleUpdater.d.ts +9 -0
- package/dist/services/aabb/CircleUpdater.d.ts.map +1 -0
- package/dist/services/aabb/EllipseUpdater.d.ts +9 -0
- package/dist/services/aabb/EllipseUpdater.d.ts.map +1 -0
- package/dist/services/aabb/LineUpdater.d.ts +9 -0
- package/dist/services/aabb/LineUpdater.d.ts.map +1 -0
- package/dist/services/aabb/PathUpdater.d.ts +9 -0
- package/dist/services/aabb/PathUpdater.d.ts.map +1 -0
- package/dist/services/aabb/PolylineUpdater.d.ts +9 -0
- package/dist/services/aabb/PolylineUpdater.d.ts.map +1 -0
- package/dist/services/aabb/RectUpdater.d.ts +9 -0
- package/dist/services/aabb/RectUpdater.d.ts.map +1 -0
- package/dist/services/aabb/TextUpdater.d.ts +22 -0
- package/dist/services/aabb/TextUpdater.d.ts.map +1 -0
- package/dist/services/aabb/index.d.ts +9 -0
- package/dist/services/aabb/index.d.ts.map +1 -0
- package/dist/services/aabb/interfaces.d.ts +16 -0
- package/dist/services/aabb/interfaces.d.ts.map +1 -0
- package/dist/services/index.d.ts +11 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/shapes/AABB.d.ts +36 -0
- package/dist/shapes/AABB.d.ts.map +1 -0
- package/dist/shapes/BoundingSphere.d.ts +9 -0
- package/dist/shapes/BoundingSphere.d.ts.map +1 -0
- package/dist/shapes/Frustum.d.ts +17 -0
- package/dist/shapes/Frustum.d.ts.map +1 -0
- package/dist/shapes/Plane.d.ts +15 -0
- package/dist/shapes/Plane.d.ts.map +1 -0
- package/dist/shapes/Point.d.ts +12 -0
- package/dist/shapes/Point.d.ts.map +1 -0
- package/dist/shapes/Ray.d.ts +25 -0
- package/dist/shapes/Ray.d.ts.map +1 -0
- package/dist/shapes/Rectangle.d.ts +13 -0
- package/dist/shapes/Rectangle.d.ts.map +1 -0
- package/dist/shapes/index.d.ts +8 -0
- package/dist/shapes/index.d.ts.map +1 -0
- package/dist/types.d.ts +270 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/animation.d.ts +16 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/assert.d.ts +10 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/bezier-easing.d.ts +21 -0
- package/dist/utils/bezier-easing.d.ts.map +1 -0
- package/dist/utils/canvas.d.ts +7 -0
- package/dist/utils/canvas.d.ts.map +1 -0
- package/dist/utils/custom-easing.d.ts +16 -0
- package/dist/utils/custom-easing.d.ts.map +1 -0
- package/dist/utils/deferred.d.ts +44 -0
- package/dist/utils/deferred.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +3 -0
- package/dist/utils/dom.d.ts.map +1 -0
- package/dist/utils/event.d.ts +36 -0
- package/dist/utils/event.d.ts.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/interpolation.d.ts +5 -0
- package/dist/utils/interpolation.d.ts.map +1 -0
- package/dist/utils/math.d.ts +30 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/path.d.ts +16 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/string.d.ts +3 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/tapable/AsyncParallelHook.d.ts +6 -0
- package/dist/utils/tapable/AsyncParallelHook.d.ts.map +1 -0
- package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts +6 -0
- package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts.map +1 -0
- package/dist/utils/tapable/Hook.d.ts +52 -0
- package/dist/utils/tapable/Hook.d.ts.map +1 -0
- package/dist/utils/tapable/HookCodeFactory.d.ts +47 -0
- package/dist/utils/tapable/HookCodeFactory.d.ts.map +1 -0
- package/dist/utils/tapable/SyncHook.d.ts +6 -0
- package/dist/utils/tapable/SyncHook.d.ts.map +1 -0
- package/dist/utils/tapable/SyncWaterfallHook.d.ts +6 -0
- package/dist/utils/tapable/SyncWaterfallHook.d.ts.map +1 -0
- package/dist/utils/tapable/index.d.ts +5 -0
- package/dist/utils/tapable/index.d.ts.map +1 -0
- package/dist/utils/text.d.ts +3 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/package.json +27 -34
- package/es/AbstractRenderer.d.ts +0 -37
- package/es/AbstractRenderer.js +0 -62
- package/es/Canvas.d.ts +0 -149
- package/es/Canvas.js +0 -518
- package/es/DisplayObjectPool.d.ts +0 -7
- package/es/DisplayObjectPool.js +0 -27
- package/es/camera/Camera.d.ts +0 -327
- package/es/camera/Camera.js +0 -1154
- package/es/camera/Landmark.d.ts +0 -23
- package/es/camera/Landmark.js +0 -1
- package/es/camera/index.d.ts +0 -2
- package/es/camera/index.js +0 -2
- package/es/canvas-module.d.ts +0 -1
- package/es/canvas-module.js +0 -25
- package/es/components/Cullable.d.ts +0 -14
- package/es/components/Cullable.js +0 -28
- package/es/components/Geometry.d.ts +0 -12
- package/es/components/Geometry.js +0 -10
- package/es/components/Renderable.d.ts +0 -24
- package/es/components/Renderable.js +0 -18
- package/es/components/Sortable.d.ts +0 -20
- package/es/components/Sortable.js +0 -20
- package/es/components/Transform.d.ts +0 -28
- package/es/components/Transform.js +0 -64
- package/es/components/index.d.ts +0 -5
- package/es/components/index.js +0 -5
- package/es/css/CSS.d.ts +0 -85
- package/es/css/CSS.js +0 -117
- package/es/css/CSSProperty.d.ts +0 -41
- package/es/css/CSSProperty.js +0 -1
- package/es/css/StyleValueRegistry.d.ts +0 -124
- package/es/css/StyleValueRegistry.js +0 -896
- package/es/css/cssom/CSSColorValue.d.ts +0 -23
- package/es/css/cssom/CSSColorValue.js +0 -43
- package/es/css/cssom/CSSGradientValue.d.ts +0 -39
- package/es/css/cssom/CSSGradientValue.js +0 -54
- package/es/css/cssom/CSSImageValue.d.ts +0 -1
- package/es/css/cssom/CSSImageValue.js +0 -0
- package/es/css/cssom/CSSKeywordValue.d.ts +0 -15
- package/es/css/cssom/CSSKeywordValue.js +0 -37
- package/es/css/cssom/CSSMathOperator.d.ts +0 -11
- package/es/css/cssom/CSSMathOperator.js +0 -32
- package/es/css/cssom/CSSNumericSumValue.d.ts +0 -7
- package/es/css/cssom/CSSNumericSumValue.js +0 -1
- package/es/css/cssom/CSSNumericValue.d.ts +0 -212
- package/es/css/cssom/CSSNumericValue.js +0 -1661
- package/es/css/cssom/CSSRGB.d.ts +0 -25
- package/es/css/cssom/CSSRGB.js +0 -48
- package/es/css/cssom/CSSStyleValue.d.ts +0 -53
- package/es/css/cssom/CSSStyleValue.js +0 -625
- package/es/css/cssom/CSSTransformComponent.d.ts +0 -22
- package/es/css/cssom/CSSTransformComponent.js +0 -32
- package/es/css/cssom/CSSTransformValue.d.ts +0 -30
- package/es/css/cssom/CSSTransformValue.js +0 -48
- package/es/css/cssom/CSSTranslate.d.ts +0 -15
- package/es/css/cssom/CSSTranslate.js +0 -44
- package/es/css/cssom/index.d.ts +0 -19
- package/es/css/cssom/index.js +0 -19
- package/es/css/cssom/types.d.ts +0 -86
- package/es/css/cssom/types.js +0 -119
- package/es/css/index.d.ts +0 -11
- package/es/css/index.js +0 -11
- package/es/css/interfaces.d.ts +0 -6
- package/es/css/interfaces.js +0 -2
- package/es/css/layout/FragmentResult.d.ts +0 -32
- package/es/css/layout/FragmentResult.js +0 -32
- package/es/css/layout/LayoutChildren.d.ts +0 -23
- package/es/css/layout/LayoutChildren.js +0 -55
- package/es/css/layout/LayoutContext.d.ts +0 -35
- package/es/css/layout/LayoutContext.js +0 -35
- package/es/css/layout/LayoutDefinition.d.ts +0 -20
- package/es/css/layout/LayoutDefinition.js +0 -9
- package/es/css/layout/LayoutEdges.d.ts +0 -24
- package/es/css/layout/LayoutEdges.js +0 -41
- package/es/css/layout/LayoutEngine.d.ts +0 -41
- package/es/css/layout/LayoutEngine.js +0 -332
- package/es/css/layout/LayoutFragment.d.ts +0 -26
- package/es/css/layout/LayoutFragment.js +0 -28
- package/es/css/layout/LayoutObject.d.ts +0 -46
- package/es/css/layout/LayoutObject.js +0 -172
- package/es/css/layout/LayoutRegistry.d.ts +0 -16
- package/es/css/layout/LayoutRegistry.js +0 -78
- package/es/css/layout/LayoutWorkTask.d.ts +0 -14
- package/es/css/layout/LayoutWorkTask.js +0 -1
- package/es/css/layout/index.d.ts +0 -11
- package/es/css/layout/index.js +0 -11
- package/es/css/layout/types.d.ts +0 -104
- package/es/css/layout/types.js +0 -66
- package/es/css/parser/color.d.ts +0 -6
- package/es/css/parser/color.js +0 -241
- package/es/css/parser/dimension.d.ts +0 -37
- package/es/css/parser/dimension.js +0 -149
- package/es/css/parser/filter.d.ts +0 -7
- package/es/css/parser/filter.js +0 -43
- package/es/css/parser/index.d.ts +0 -15
- package/es/css/parser/index.js +0 -15
- package/es/css/parser/numeric.d.ts +0 -19
- package/es/css/parser/numeric.js +0 -62
- package/es/css/parser/path.d.ts +0 -5
- package/es/css/parser/path.js +0 -207
- package/es/css/parser/points.d.ts +0 -12
- package/es/css/parser/points.js +0 -58
- package/es/css/parser/transform-origin.d.ts +0 -6
- package/es/css/parser/transform-origin.js +0 -45
- package/es/css/parser/transform.d.ts +0 -13
- package/es/css/parser/transform.js +0 -289
- package/es/css/parser/types.d.ts +0 -2
- package/es/css/parser/types.js +0 -1
- package/es/css/properties/CSSPropertyAnchor.d.ts +0 -8
- package/es/css/properties/CSSPropertyAnchor.js +0 -25
- package/es/css/properties/CSSPropertyClipPath.d.ts +0 -22
- package/es/css/properties/CSSPropertyClipPath.js +0 -56
- package/es/css/properties/CSSPropertyColor.d.ts +0 -14
- package/es/css/properties/CSSPropertyColor.js +0 -30
- package/es/css/properties/CSSPropertyFilter.d.ts +0 -6
- package/es/css/properties/CSSPropertyFilter.js +0 -16
- package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -21
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +0 -75
- package/es/css/properties/CSSPropertyLineDash.d.ts +0 -9
- package/es/css/properties/CSSPropertyLineDash.js +0 -25
- package/es/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
- package/es/css/properties/CSSPropertyLocalPosition.js +0 -85
- package/es/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
- package/es/css/properties/CSSPropertyOffsetDistance.js +0 -34
- package/es/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
- package/es/css/properties/CSSPropertyOffsetPath.js +0 -31
- package/es/css/properties/CSSPropertyOpacity.d.ts +0 -10
- package/es/css/properties/CSSPropertyOpacity.js +0 -20
- package/es/css/properties/CSSPropertyPath.d.ts +0 -27
- package/es/css/properties/CSSPropertyPath.js +0 -55
- package/es/css/properties/CSSPropertyPoints.d.ts +0 -18
- package/es/css/properties/CSSPropertyPoints.js +0 -27
- package/es/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
- package/es/css/properties/CSSPropertyShadowBlur.js +0 -22
- package/es/css/properties/CSSPropertyText.d.ts +0 -7
- package/es/css/properties/CSSPropertyText.js +0 -30
- package/es/css/properties/CSSPropertyTextTransform.d.ts +0 -5
- package/es/css/properties/CSSPropertyTextTransform.js +0 -29
- package/es/css/properties/CSSPropertyTransform.d.ts +0 -38
- package/es/css/properties/CSSPropertyTransform.js +0 -128
- package/es/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
- package/es/css/properties/CSSPropertyTransformOrigin.js +0 -21
- package/es/css/properties/CSSPropertyVisibility.d.ts +0 -13
- package/es/css/properties/CSSPropertyVisibility.js +0 -24
- package/es/css/properties/CSSPropertyZIndex.d.ts +0 -8
- package/es/css/properties/CSSPropertyZIndex.js +0 -33
- package/es/css/properties/index.d.ts +0 -18
- package/es/css/properties/index.js +0 -18
- package/es/display-objects/Circle.d.ts +0 -17
- package/es/display-objects/Circle.js +0 -34
- package/es/display-objects/CustomElement.d.ts +0 -26
- package/es/display-objects/CustomElement.js +0 -102
- package/es/display-objects/DisplayObject.d.ts +0 -274
- package/es/display-objects/DisplayObject.js +0 -887
- package/es/display-objects/Ellipse.d.ts +0 -19
- package/es/display-objects/Ellipse.js +0 -35
- package/es/display-objects/Group.d.ts +0 -29
- package/es/display-objects/Group.js +0 -42
- package/es/display-objects/HTML.d.ts +0 -41
- package/es/display-objects/HTML.js +0 -100
- package/es/display-objects/Image.d.ts +0 -23
- package/es/display-objects/Image.js +0 -34
- package/es/display-objects/Line.d.ts +0 -30
- package/es/display-objects/Line.js +0 -63
- package/es/display-objects/Path.d.ts +0 -48
- package/es/display-objects/Path.js +0 -131
- package/es/display-objects/Polygon.d.ts +0 -16
- package/es/display-objects/Polygon.js +0 -31
- package/es/display-objects/Polyline.d.ts +0 -21
- package/es/display-objects/Polyline.js +0 -74
- package/es/display-objects/Rect.d.ts +0 -21
- package/es/display-objects/Rect.js +0 -34
- package/es/display-objects/Text.d.ts +0 -91
- package/es/display-objects/Text.js +0 -118
- package/es/display-objects/index.d.ts +0 -13
- package/es/display-objects/index.js +0 -13
- package/es/dom/Animation.d.ts +0 -132
- package/es/dom/Animation.js +0 -503
- package/es/dom/AnimationEffectTiming.d.ts +0 -58
- package/es/dom/AnimationEffectTiming.js +0 -68
- package/es/dom/AnimationEvent.d.ts +0 -11
- package/es/dom/AnimationEvent.js +0 -34
- package/es/dom/AnimationTimeline.d.ts +0 -40
- package/es/dom/AnimationTimeline.js +0 -217
- package/es/dom/CustomElementRegistry.d.ts +0 -15
- package/es/dom/CustomElementRegistry.js +0 -42
- package/es/dom/CustomEvent.d.ts +0 -16
- package/es/dom/CustomEvent.js +0 -35
- package/es/dom/Document.d.ts +0 -72
- package/es/dom/Document.js +0 -316
- package/es/dom/Element.d.ts +0 -187
- package/es/dom/Element.js +0 -604
- package/es/dom/EventTarget.d.ts +0 -40
- package/es/dom/EventTarget.js +0 -157
- package/es/dom/FederatedEvent.d.ts +0 -145
- package/es/dom/FederatedEvent.js +0 -222
- package/es/dom/FederatedMouseEvent.d.ts +0 -52
- package/es/dom/FederatedMouseEvent.js +0 -124
- package/es/dom/FederatedPointerEvent.d.ts +0 -75
- package/es/dom/FederatedPointerEvent.js +0 -61
- package/es/dom/FederatedTouchEvent.d.ts +0 -15
- package/es/dom/FederatedTouchEvent.js +0 -19
- package/es/dom/FederatedWheelEvent.d.ts +0 -20
- package/es/dom/FederatedWheelEvent.js +0 -27
- package/es/dom/KeyframeEffect.d.ts +0 -47
- package/es/dom/KeyframeEffect.js +0 -174
- package/es/dom/KeyframeList.d.ts +0 -2
- package/es/dom/KeyframeList.js +0 -176
- package/es/dom/MutationEvent.d.ts +0 -15
- package/es/dom/MutationEvent.js +0 -29
- package/es/dom/MutationObserver.d.ts +0 -36
- package/es/dom/MutationObserver.js +0 -416
- package/es/dom/MutationRecord.d.ts +0 -14
- package/es/dom/MutationRecord.js +0 -31
- package/es/dom/Node.d.ts +0 -138
- package/es/dom/Node.js +0 -387
- package/es/dom/index.d.ts +0 -20
- package/es/dom/index.js +0 -20
- package/es/dom/interfaces.d.ts +0 -372
- package/es/dom/interfaces.js +0 -56
- package/es/global-module.d.ts +0 -1
- package/es/global-module.js +0 -155
- package/es/index.d.ts +0 -18
- package/es/index.js +0 -21
- package/es/plugins/CullingPlugin.d.ts +0 -17
- package/es/plugins/CullingPlugin.js +0 -58
- package/es/plugins/DirtyCheckPlugin.d.ts +0 -10
- package/es/plugins/DirtyCheckPlugin.js +0 -55
- package/es/plugins/EventPlugin.d.ts +0 -30
- package/es/plugins/EventPlugin.js +0 -374
- package/es/plugins/FrustumCullingStrategy.d.ts +0 -21
- package/es/plugins/FrustumCullingStrategy.js +0 -108
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -7
- package/es/plugins/PrepareRendererPlugin.js +0 -79
- package/es/services/ContextService.d.ts +0 -13
- package/es/services/ContextService.js +0 -5
- package/es/services/EventService.d.ts +0 -73
- package/es/services/EventService.js +0 -1238
- package/es/services/OffscreenCanvasCreator.d.ts +0 -13
- package/es/services/OffscreenCanvasCreator.js +0 -58
- package/es/services/RenderingContext.d.ts +0 -26
- package/es/services/RenderingContext.js +0 -14
- package/es/services/RenderingService.d.ts +0 -102
- package/es/services/RenderingService.js +0 -231
- package/es/services/SceneGraphSelector.d.ts +0 -23
- package/es/services/SceneGraphSelector.js +0 -100
- package/es/services/SceneGraphService.d.ts +0 -153
- package/es/services/SceneGraphService.js +0 -819
- package/es/services/TextService.d.ts +0 -36
- package/es/services/TextService.js +0 -350
- package/es/services/aabb/CircleUpdater.d.ts +0 -8
- package/es/services/aabb/CircleUpdater.js +0 -30
- package/es/services/aabb/EllipseUpdater.d.ts +0 -8
- package/es/services/aabb/EllipseUpdater.js +0 -31
- package/es/services/aabb/LineUpdater.d.ts +0 -8
- package/es/services/aabb/LineUpdater.js +0 -37
- package/es/services/aabb/PathUpdater.d.ts +0 -8
- package/es/services/aabb/PathUpdater.js +0 -168
- package/es/services/aabb/PolylineUpdater.d.ts +0 -8
- package/es/services/aabb/PolylineUpdater.js +0 -46
- package/es/services/aabb/RectUpdater.d.ts +0 -8
- package/es/services/aabb/RectUpdater.js +0 -72
- package/es/services/aabb/TextUpdater.d.ts +0 -21
- package/es/services/aabb/TextUpdater.js +0 -136
- package/es/services/aabb/index.d.ts +0 -8
- package/es/services/aabb/index.js +0 -8
- package/es/services/aabb/interfaces.d.ts +0 -15
- package/es/services/aabb/interfaces.js +0 -3
- package/es/services/index.d.ts +0 -10
- package/es/services/index.js +0 -10
- package/es/shapes/AABB.d.ts +0 -35
- package/es/shapes/AABB.js +0 -230
- package/es/shapes/BoundingSphere.d.ts +0 -8
- package/es/shapes/BoundingSphere.js +0 -31
- package/es/shapes/Frustum.d.ts +0 -16
- package/es/shapes/Frustum.js +0 -79
- package/es/shapes/Plane.d.ts +0 -14
- package/es/shapes/Plane.js +0 -42
- package/es/shapes/Point.d.ts +0 -11
- package/es/shapes/Point.js +0 -31
- package/es/shapes/Ray.d.ts +0 -24
- package/es/shapes/Ray.js +0 -138
- package/es/shapes/Rectangle.d.ts +0 -12
- package/es/shapes/Rectangle.js +0 -20
- package/es/shapes/index.d.ts +0 -7
- package/es/shapes/index.js +0 -7
- package/es/types.d.ts +0 -289
- package/es/types.js +0 -54
- package/es/utils/animation.d.ts +0 -15
- package/es/utils/animation.js +0 -251
- package/es/utils/assert.d.ts +0 -9
- package/es/utils/assert.js +0 -33
- package/es/utils/bezier-easing.d.ts +0 -20
- package/es/utils/bezier-easing.js +0 -90
- package/es/utils/canvas.d.ts +0 -6
- package/es/utils/canvas.js +0 -18
- package/es/utils/custom-easing.d.ts +0 -64
- package/es/utils/custom-easing.js +0 -317
- package/es/utils/deferred.d.ts +0 -43
- package/es/utils/deferred.js +0 -117
- package/es/utils/dom.d.ts +0 -2
- package/es/utils/dom.js +0 -8
- package/es/utils/event.d.ts +0 -45
- package/es/utils/event.js +0 -9
- package/es/utils/index.d.ts +0 -10
- package/es/utils/index.js +0 -10
- package/es/utils/interpolation.d.ts +0 -4
- package/es/utils/interpolation.js +0 -211
- package/es/utils/math.d.ts +0 -29
- package/es/utils/math.js +0 -236
- package/es/utils/path.d.ts +0 -15
- package/es/utils/path.js +0 -374
- package/es/utils/string.d.ts +0 -2
- package/es/utils/string.js +0 -17
- package/es/utils/text.d.ts +0 -2
- package/es/utils/text.js +0 -29
- package/lib/AbstractRenderer.d.ts +0 -37
- package/lib/AbstractRenderer.js +0 -69
- package/lib/Canvas.d.ts +0 -149
- package/lib/Canvas.js +0 -540
- package/lib/DisplayObjectPool.d.ts +0 -7
- package/lib/DisplayObjectPool.js +0 -35
- package/lib/camera/Camera.d.ts +0 -327
- package/lib/camera/Camera.js +0 -1232
- package/lib/camera/Landmark.d.ts +0 -23
- package/lib/camera/Landmark.js +0 -5
- package/lib/camera/index.d.ts +0 -2
- package/lib/camera/index.js +0 -31
- package/lib/canvas-module.d.ts +0 -1
- package/lib/canvas-module.js +0 -41
- package/lib/components/Cullable.d.ts +0 -14
- package/lib/components/Cullable.js +0 -36
- package/lib/components/Geometry.d.ts +0 -12
- package/lib/components/Geometry.js +0 -17
- package/lib/components/Renderable.d.ts +0 -24
- package/lib/components/Renderable.js +0 -25
- package/lib/components/Sortable.d.ts +0 -20
- package/lib/components/Sortable.js +0 -27
- package/lib/components/Transform.d.ts +0 -28
- package/lib/components/Transform.js +0 -71
- package/lib/components/index.d.ts +0 -5
- package/lib/components/index.js +0 -70
- package/lib/css/CSS.d.ts +0 -85
- package/lib/css/CSS.js +0 -131
- package/lib/css/CSSProperty.d.ts +0 -41
- package/lib/css/CSSProperty.js +0 -5
- package/lib/css/StyleValueRegistry.d.ts +0 -124
- package/lib/css/StyleValueRegistry.js +0 -922
- package/lib/css/cssom/CSSColorValue.d.ts +0 -23
- package/lib/css/cssom/CSSColorValue.js +0 -51
- package/lib/css/cssom/CSSGradientValue.d.ts +0 -39
- package/lib/css/cssom/CSSGradientValue.js +0 -64
- package/lib/css/cssom/CSSImageValue.d.ts +0 -1
- package/lib/css/cssom/CSSImageValue.js +0 -1
- package/lib/css/cssom/CSSKeywordValue.d.ts +0 -15
- package/lib/css/cssom/CSSKeywordValue.js +0 -45
- package/lib/css/cssom/CSSMathOperator.d.ts +0 -11
- package/lib/css/cssom/CSSMathOperator.js +0 -40
- package/lib/css/cssom/CSSNumericSumValue.d.ts +0 -7
- package/lib/css/cssom/CSSNumericSumValue.js +0 -5
- package/lib/css/cssom/CSSNumericValue.d.ts +0 -212
- package/lib/css/cssom/CSSNumericValue.js +0 -1685
- package/lib/css/cssom/CSSRGB.d.ts +0 -25
- package/lib/css/cssom/CSSRGB.js +0 -56
- package/lib/css/cssom/CSSStyleValue.d.ts +0 -53
- package/lib/css/cssom/CSSStyleValue.js +0 -634
- package/lib/css/cssom/CSSTransformComponent.d.ts +0 -22
- package/lib/css/cssom/CSSTransformComponent.js +0 -39
- package/lib/css/cssom/CSSTransformValue.d.ts +0 -30
- package/lib/css/cssom/CSSTransformValue.js +0 -56
- package/lib/css/cssom/CSSTranslate.d.ts +0 -15
- package/lib/css/cssom/CSSTranslate.js +0 -53
- package/lib/css/cssom/index.d.ts +0 -19
- package/lib/css/cssom/index.js +0 -148
- package/lib/css/cssom/types.d.ts +0 -86
- package/lib/css/cssom/types.js +0 -130
- package/lib/css/index.d.ts +0 -11
- package/lib/css/index.js +0 -109
- package/lib/css/interfaces.d.ts +0 -6
- package/lib/css/interfaces.js +0 -12
- package/lib/css/layout/FragmentResult.d.ts +0 -32
- package/lib/css/layout/FragmentResult.js +0 -51
- package/lib/css/layout/LayoutChildren.d.ts +0 -23
- package/lib/css/layout/LayoutChildren.js +0 -72
- package/lib/css/layout/LayoutContext.d.ts +0 -35
- package/lib/css/layout/LayoutContext.js +0 -49
- package/lib/css/layout/LayoutDefinition.d.ts +0 -20
- package/lib/css/layout/LayoutDefinition.js +0 -16
- package/lib/css/layout/LayoutEdges.d.ts +0 -24
- package/lib/css/layout/LayoutEdges.js +0 -56
- package/lib/css/layout/LayoutEngine.d.ts +0 -41
- package/lib/css/layout/LayoutEngine.js +0 -345
- package/lib/css/layout/LayoutFragment.d.ts +0 -26
- package/lib/css/layout/LayoutFragment.js +0 -44
- package/lib/css/layout/LayoutObject.d.ts +0 -46
- package/lib/css/layout/LayoutObject.js +0 -182
- package/lib/css/layout/LayoutRegistry.d.ts +0 -16
- package/lib/css/layout/LayoutRegistry.js +0 -87
- package/lib/css/layout/LayoutWorkTask.d.ts +0 -14
- package/lib/css/layout/LayoutWorkTask.js +0 -5
- package/lib/css/layout/index.d.ts +0 -11
- package/lib/css/layout/index.js +0 -148
- package/lib/css/layout/types.d.ts +0 -104
- package/lib/css/layout/types.js +0 -74
- package/lib/css/parser/color.d.ts +0 -6
- package/lib/css/parser/color.js +0 -260
- package/lib/css/parser/dimension.d.ts +0 -37
- package/lib/css/parser/dimension.js +0 -175
- package/lib/css/parser/filter.d.ts +0 -7
- package/lib/css/parser/filter.js +0 -56
- package/lib/css/parser/index.d.ts +0 -15
- package/lib/css/parser/index.js +0 -122
- package/lib/css/parser/numeric.d.ts +0 -19
- package/lib/css/parser/numeric.js +0 -81
- package/lib/css/parser/path.d.ts +0 -5
- package/lib/css/parser/path.js +0 -221
- package/lib/css/parser/points.d.ts +0 -12
- package/lib/css/parser/points.js +0 -69
- package/lib/css/parser/transform-origin.d.ts +0 -6
- package/lib/css/parser/transform-origin.js +0 -54
- package/lib/css/parser/transform.d.ts +0 -13
- package/lib/css/parser/transform.js +0 -303
- package/lib/css/parser/types.d.ts +0 -2
- package/lib/css/parser/types.js +0 -5
- package/lib/css/properties/CSSPropertyAnchor.d.ts +0 -8
- package/lib/css/properties/CSSPropertyAnchor.js +0 -35
- package/lib/css/properties/CSSPropertyClipPath.d.ts +0 -22
- package/lib/css/properties/CSSPropertyClipPath.js +0 -66
- package/lib/css/properties/CSSPropertyColor.d.ts +0 -14
- package/lib/css/properties/CSSPropertyColor.js +0 -40
- package/lib/css/properties/CSSPropertyFilter.d.ts +0 -6
- package/lib/css/properties/CSSPropertyFilter.js +0 -25
- package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -21
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +0 -85
- package/lib/css/properties/CSSPropertyLineDash.d.ts +0 -9
- package/lib/css/properties/CSSPropertyLineDash.js +0 -34
- package/lib/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
- package/lib/css/properties/CSSPropertyLocalPosition.js +0 -96
- package/lib/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
- package/lib/css/properties/CSSPropertyOffsetDistance.js +0 -44
- package/lib/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
- package/lib/css/properties/CSSPropertyOffsetPath.js +0 -39
- package/lib/css/properties/CSSPropertyOpacity.d.ts +0 -10
- package/lib/css/properties/CSSPropertyOpacity.js +0 -29
- package/lib/css/properties/CSSPropertyPath.d.ts +0 -27
- package/lib/css/properties/CSSPropertyPath.js +0 -66
- package/lib/css/properties/CSSPropertyPoints.d.ts +0 -18
- package/lib/css/properties/CSSPropertyPoints.js +0 -36
- package/lib/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
- package/lib/css/properties/CSSPropertyShadowBlur.js +0 -32
- package/lib/css/properties/CSSPropertyText.d.ts +0 -7
- package/lib/css/properties/CSSPropertyText.js +0 -39
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +0 -5
- package/lib/css/properties/CSSPropertyTextTransform.js +0 -38
- package/lib/css/properties/CSSPropertyTransform.d.ts +0 -38
- package/lib/css/properties/CSSPropertyTransform.js +0 -138
- package/lib/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
- package/lib/css/properties/CSSPropertyTransformOrigin.js +0 -30
- package/lib/css/properties/CSSPropertyVisibility.d.ts +0 -13
- package/lib/css/properties/CSSPropertyVisibility.js +0 -32
- package/lib/css/properties/CSSPropertyZIndex.d.ts +0 -8
- package/lib/css/properties/CSSPropertyZIndex.js +0 -42
- package/lib/css/properties/index.d.ts +0 -18
- package/lib/css/properties/index.js +0 -239
- package/lib/display-objects/Circle.d.ts +0 -17
- package/lib/display-objects/Circle.js +0 -42
- package/lib/display-objects/CustomElement.d.ts +0 -26
- package/lib/display-objects/CustomElement.js +0 -109
- package/lib/display-objects/DisplayObject.d.ts +0 -274
- package/lib/display-objects/DisplayObject.js +0 -910
- package/lib/display-objects/Ellipse.d.ts +0 -19
- package/lib/display-objects/Ellipse.js +0 -43
- package/lib/display-objects/Group.d.ts +0 -29
- package/lib/display-objects/Group.js +0 -50
- package/lib/display-objects/HTML.d.ts +0 -41
- package/lib/display-objects/HTML.js +0 -111
- package/lib/display-objects/Image.d.ts +0 -23
- package/lib/display-objects/Image.js +0 -42
- package/lib/display-objects/Line.d.ts +0 -30
- package/lib/display-objects/Line.js +0 -75
- package/lib/display-objects/Path.d.ts +0 -48
- package/lib/display-objects/Path.js +0 -142
- package/lib/display-objects/Polygon.d.ts +0 -16
- package/lib/display-objects/Polygon.js +0 -39
- package/lib/display-objects/Polyline.d.ts +0 -21
- package/lib/display-objects/Polyline.js +0 -84
- package/lib/display-objects/Rect.d.ts +0 -21
- package/lib/display-objects/Rect.js +0 -42
- package/lib/display-objects/Text.d.ts +0 -91
- package/lib/display-objects/Text.js +0 -126
- package/lib/display-objects/index.d.ts +0 -13
- package/lib/display-objects/index.js +0 -174
- package/lib/dom/Animation.d.ts +0 -132
- package/lib/dom/Animation.js +0 -511
- package/lib/dom/AnimationEffectTiming.d.ts +0 -58
- package/lib/dom/AnimationEffectTiming.js +0 -75
- package/lib/dom/AnimationEvent.d.ts +0 -11
- package/lib/dom/AnimationEvent.js +0 -42
- package/lib/dom/AnimationTimeline.d.ts +0 -40
- package/lib/dom/AnimationTimeline.js +0 -228
- package/lib/dom/CustomElementRegistry.d.ts +0 -15
- package/lib/dom/CustomElementRegistry.js +0 -50
- package/lib/dom/CustomEvent.d.ts +0 -16
- package/lib/dom/CustomEvent.js +0 -42
- package/lib/dom/Document.d.ts +0 -72
- package/lib/dom/Document.js +0 -329
- package/lib/dom/Element.d.ts +0 -187
- package/lib/dom/Element.js +0 -619
- package/lib/dom/EventTarget.d.ts +0 -40
- package/lib/dom/EventTarget.js +0 -171
- package/lib/dom/FederatedEvent.d.ts +0 -145
- package/lib/dom/FederatedEvent.js +0 -229
- package/lib/dom/FederatedMouseEvent.d.ts +0 -52
- package/lib/dom/FederatedMouseEvent.js +0 -133
- package/lib/dom/FederatedPointerEvent.d.ts +0 -75
- package/lib/dom/FederatedPointerEvent.js +0 -69
- package/lib/dom/FederatedTouchEvent.d.ts +0 -15
- package/lib/dom/FederatedTouchEvent.js +0 -27
- package/lib/dom/FederatedWheelEvent.d.ts +0 -20
- package/lib/dom/FederatedWheelEvent.js +0 -35
- package/lib/dom/KeyframeEffect.d.ts +0 -47
- package/lib/dom/KeyframeEffect.js +0 -192
- package/lib/dom/KeyframeList.d.ts +0 -2
- package/lib/dom/KeyframeList.js +0 -183
- package/lib/dom/MutationEvent.d.ts +0 -15
- package/lib/dom/MutationEvent.js +0 -37
- package/lib/dom/MutationObserver.d.ts +0 -36
- package/lib/dom/MutationObserver.js +0 -426
- package/lib/dom/MutationRecord.d.ts +0 -14
- package/lib/dom/MutationRecord.js +0 -38
- package/lib/dom/Node.d.ts +0 -138
- package/lib/dom/Node.js +0 -397
- package/lib/dom/index.d.ts +0 -20
- package/lib/dom/index.js +0 -265
- package/lib/dom/interfaces.d.ts +0 -372
- package/lib/dom/interfaces.js +0 -64
- package/lib/global-module.d.ts +0 -1
- package/lib/global-module.js +0 -170
- package/lib/index.d.ts +0 -18
- package/lib/index.js +0 -198
- package/lib/plugins/CullingPlugin.d.ts +0 -17
- package/lib/plugins/CullingPlugin.js +0 -69
- package/lib/plugins/DirtyCheckPlugin.d.ts +0 -10
- package/lib/plugins/DirtyCheckPlugin.js +0 -63
- package/lib/plugins/EventPlugin.d.ts +0 -30
- package/lib/plugins/EventPlugin.js +0 -382
- package/lib/plugins/FrustumCullingStrategy.d.ts +0 -21
- package/lib/plugins/FrustumCullingStrategy.js +0 -121
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -7
- package/lib/plugins/PrepareRendererPlugin.js +0 -87
- package/lib/services/ContextService.d.ts +0 -13
- package/lib/services/ContextService.js +0 -15
- package/lib/services/EventService.d.ts +0 -73
- package/lib/services/EventService.js +0 -1263
- package/lib/services/OffscreenCanvasCreator.d.ts +0 -13
- package/lib/services/OffscreenCanvasCreator.js +0 -66
- package/lib/services/RenderingContext.d.ts +0 -26
- package/lib/services/RenderingContext.js +0 -24
- package/lib/services/RenderingService.d.ts +0 -102
- package/lib/services/RenderingService.js +0 -244
- package/lib/services/SceneGraphSelector.d.ts +0 -23
- package/lib/services/SceneGraphSelector.js +0 -114
- package/lib/services/SceneGraphService.d.ts +0 -153
- package/lib/services/SceneGraphService.js +0 -875
- package/lib/services/TextService.d.ts +0 -36
- package/lib/services/TextService.js +0 -359
- package/lib/services/aabb/CircleUpdater.d.ts +0 -8
- package/lib/services/aabb/CircleUpdater.js +0 -40
- package/lib/services/aabb/EllipseUpdater.d.ts +0 -8
- package/lib/services/aabb/EllipseUpdater.js +0 -41
- package/lib/services/aabb/LineUpdater.d.ts +0 -8
- package/lib/services/aabb/LineUpdater.js +0 -47
- package/lib/services/aabb/PathUpdater.d.ts +0 -8
- package/lib/services/aabb/PathUpdater.js +0 -179
- package/lib/services/aabb/PolylineUpdater.d.ts +0 -8
- package/lib/services/aabb/PolylineUpdater.js +0 -56
- package/lib/services/aabb/RectUpdater.d.ts +0 -8
- package/lib/services/aabb/RectUpdater.js +0 -84
- package/lib/services/aabb/TextUpdater.d.ts +0 -21
- package/lib/services/aabb/TextUpdater.js +0 -149
- package/lib/services/aabb/index.d.ts +0 -8
- package/lib/services/aabb/index.js +0 -84
- package/lib/services/aabb/interfaces.d.ts +0 -15
- package/lib/services/aabb/interfaces.js +0 -16
- package/lib/services/index.d.ts +0 -10
- package/lib/services/index.js +0 -122
- package/lib/shapes/AABB.d.ts +0 -35
- package/lib/shapes/AABB.js +0 -248
- package/lib/shapes/BoundingSphere.d.ts +0 -8
- package/lib/shapes/BoundingSphere.js +0 -41
- package/lib/shapes/Frustum.d.ts +0 -16
- package/lib/shapes/Frustum.js +0 -96
- package/lib/shapes/Plane.d.ts +0 -14
- package/lib/shapes/Plane.js +0 -51
- package/lib/shapes/Point.d.ts +0 -11
- package/lib/shapes/Point.js +0 -38
- package/lib/shapes/Ray.d.ts +0 -24
- package/lib/shapes/Ray.js +0 -169
- package/lib/shapes/Rectangle.d.ts +0 -12
- package/lib/shapes/Rectangle.js +0 -27
- package/lib/shapes/index.d.ts +0 -7
- package/lib/shapes/index.js +0 -96
- package/lib/types.d.ts +0 -289
- package/lib/types.js +0 -69
- package/lib/utils/animation.d.ts +0 -15
- package/lib/utils/animation.js +0 -275
- package/lib/utils/assert.d.ts +0 -9
- package/lib/utils/assert.js +0 -56
- package/lib/utils/bezier-easing.d.ts +0 -20
- package/lib/utils/bezier-easing.js +0 -128
- package/lib/utils/canvas.d.ts +0 -6
- package/lib/utils/canvas.js +0 -27
- package/lib/utils/custom-easing.d.ts +0 -64
- package/lib/utils/custom-easing.js +0 -392
- package/lib/utils/deferred.d.ts +0 -43
- package/lib/utils/deferred.js +0 -131
- package/lib/utils/dom.d.ts +0 -2
- package/lib/utils/dom.js +0 -17
- package/lib/utils/event.d.ts +0 -45
- package/lib/utils/event.js +0 -17
- package/lib/utils/index.d.ts +0 -10
- package/lib/utils/index.js +0 -135
- package/lib/utils/interpolation.d.ts +0 -4
- package/lib/utils/interpolation.js +0 -227
- package/lib/utils/math.d.ts +0 -29
- package/lib/utils/math.js +0 -273
- package/lib/utils/path.d.ts +0 -15
- package/lib/utils/path.js +0 -396
- package/lib/utils/string.d.ts +0 -2
- package/lib/utils/string.js +0 -27
- package/lib/utils/text.d.ts +0 -2
- package/lib/utils/text.js +0 -39
package/es/camera/Camera.js
DELETED
|
@@ -1,1154 +0,0 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { Syringe } from 'mana-syringe';
|
|
3
|
-
import { EventEmitter } from 'eventemitter3';
|
|
4
|
-
import { mat3, mat4, quat, vec3, vec4 } from 'gl-matrix';
|
|
5
|
-
import { Frustum } from '../shapes';
|
|
6
|
-
import { createVec3, getAngle, makePerspective } from '../utils/math';
|
|
7
|
-
import { parseEasingFunction } from '../utils/animation';
|
|
8
|
-
import { isNumber, isString } from '../utils'; // import { DisplayObject } from '../display-objects';
|
|
9
|
-
|
|
10
|
-
export var DefaultCamera = Syringe.defineToken('DefaultCamera');
|
|
11
|
-
export var CameraType;
|
|
12
|
-
|
|
13
|
-
(function (CameraType) {
|
|
14
|
-
/**
|
|
15
|
-
* Performs all the rotational operations with the focal point instead of the camera position.
|
|
16
|
-
* This type of camera is useful in applications(like CAD) where 3D objects are being designed or explored.
|
|
17
|
-
* Camera cannot orbits over the north & south poles.
|
|
18
|
-
* @see http://voxelent.com/tutorial-cameras/
|
|
19
|
-
*
|
|
20
|
-
* In Three.js it's used in OrbitControls.
|
|
21
|
-
* @see https://threejs.org/docs/#examples/zh/controls/OrbitControls
|
|
22
|
-
*/
|
|
23
|
-
CameraType[CameraType["ORBITING"] = 0] = "ORBITING";
|
|
24
|
-
/**
|
|
25
|
-
* It's similar to the ORBITING camera, but it allows the camera to orbit over the north or south poles.
|
|
26
|
-
*
|
|
27
|
-
* In Three.js it's used in OrbitControls.
|
|
28
|
-
* @see https://threejs.org/docs/#examples/en/controls/TrackballControls
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
CameraType[CameraType["EXPLORING"] = 1] = "EXPLORING";
|
|
32
|
-
/**
|
|
33
|
-
* Performs all the rotational operations with the camera position.
|
|
34
|
-
* It's useful in first person shooting games.
|
|
35
|
-
* Camera cannot orbits over the north & south poles.
|
|
36
|
-
*
|
|
37
|
-
* In Three.js it's used in FirstPersonControls.
|
|
38
|
-
* @see https://threejs.org/docs/#examples/en/controls/FirstPersonControls
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
CameraType[CameraType["TRACKING"] = 2] = "TRACKING";
|
|
42
|
-
})(CameraType || (CameraType = {}));
|
|
43
|
-
/**
|
|
44
|
-
* CameraType must be TRACKING
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export var CameraTrackingMode;
|
|
49
|
-
|
|
50
|
-
(function (CameraTrackingMode) {
|
|
51
|
-
CameraTrackingMode[CameraTrackingMode["DEFAULT"] = 0] = "DEFAULT";
|
|
52
|
-
CameraTrackingMode[CameraTrackingMode["ROTATIONAL"] = 1] = "ROTATIONAL";
|
|
53
|
-
CameraTrackingMode[CameraTrackingMode["TRANSLATIONAL"] = 2] = "TRANSLATIONAL";
|
|
54
|
-
CameraTrackingMode[CameraTrackingMode["CINEMATIC"] = 3] = "CINEMATIC";
|
|
55
|
-
})(CameraTrackingMode || (CameraTrackingMode = {}));
|
|
56
|
-
|
|
57
|
-
export var CameraProjectionMode;
|
|
58
|
-
|
|
59
|
-
(function (CameraProjectionMode) {
|
|
60
|
-
CameraProjectionMode[CameraProjectionMode["ORTHOGRAPHIC"] = 0] = "ORTHOGRAPHIC";
|
|
61
|
-
CameraProjectionMode[CameraProjectionMode["PERSPECTIVE"] = 1] = "PERSPECTIVE";
|
|
62
|
-
})(CameraProjectionMode || (CameraProjectionMode = {}));
|
|
63
|
-
|
|
64
|
-
export var CameraEvent = {
|
|
65
|
-
UPDATED: 'updated'
|
|
66
|
-
};
|
|
67
|
-
var DEG_2_RAD = Math.PI / 180;
|
|
68
|
-
var RAD_2_DEG = 180 / Math.PI;
|
|
69
|
-
var MIN_DISTANCE = 0.0002;
|
|
70
|
-
/**
|
|
71
|
-
* 参考「WebGL Insights - 23.Designing Cameras for WebGL Applications」,基于 Responsible Camera 思路设计
|
|
72
|
-
* @see https://github.com/d13g0/nucleo.js/blob/master/source/camera/Camera.js
|
|
73
|
-
*
|
|
74
|
-
* 保存相机参数,定义相机动作:
|
|
75
|
-
* 1. dolly 沿 n 轴移动
|
|
76
|
-
* 2. pan 沿 u v 轴移动
|
|
77
|
-
* 3. rotate 以方位角旋转
|
|
78
|
-
* 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
var Camera =
|
|
82
|
-
/** @class */
|
|
83
|
-
function (_super) {
|
|
84
|
-
__extends(Camera, _super);
|
|
85
|
-
|
|
86
|
-
function Camera(type, trackingMode) {
|
|
87
|
-
if (type === void 0) {
|
|
88
|
-
type = CameraType.EXPLORING;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (trackingMode === void 0) {
|
|
92
|
-
trackingMode = CameraTrackingMode.DEFAULT;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var _this = _super.call(this) || this;
|
|
96
|
-
/**
|
|
97
|
-
* 相机矩阵
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
_this.matrix = mat4.create();
|
|
102
|
-
/**
|
|
103
|
-
* u 轴
|
|
104
|
-
* @see http://learnwebgl.brown37.net/07_cameras/camera_introduction.html#a-camera-definition
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
_this.right = vec3.fromValues(1, 0, 0);
|
|
108
|
-
/**
|
|
109
|
-
* v 轴 +Y is down
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
_this.up = vec3.fromValues(0, 1, 0);
|
|
113
|
-
/**
|
|
114
|
-
* n 轴 +Z is inside
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
_this.forward = vec3.fromValues(0, 0, 1);
|
|
118
|
-
/**
|
|
119
|
-
* 相机位置
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
_this.position = vec3.fromValues(0, 0, 1);
|
|
123
|
-
/**
|
|
124
|
-
* 视点位置
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
_this.focalPoint = vec3.fromValues(0, 0, 0);
|
|
128
|
-
/**
|
|
129
|
-
* 视点到相机位置的向量
|
|
130
|
-
* focalPoint - position
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
_this.distanceVector = vec3.fromValues(0, 0, -1);
|
|
134
|
-
/**
|
|
135
|
-
* 相机位置到视点距离
|
|
136
|
-
* length(focalPoint - position)
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
_this.distance = 1;
|
|
140
|
-
/**
|
|
141
|
-
* @see https://en.wikipedia.org/wiki/Azimuth
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
_this.azimuth = 0;
|
|
145
|
-
_this.elevation = 0;
|
|
146
|
-
_this.roll = 0;
|
|
147
|
-
_this.relAzimuth = 0;
|
|
148
|
-
_this.relElevation = 0;
|
|
149
|
-
_this.relRoll = 0;
|
|
150
|
-
/**
|
|
151
|
-
* 沿 n 轴移动时,保证移动速度从快到慢
|
|
152
|
-
*/
|
|
153
|
-
|
|
154
|
-
_this.dollyingStep = 0;
|
|
155
|
-
_this.maxDistance = Infinity;
|
|
156
|
-
_this.minDistance = -Infinity;
|
|
157
|
-
/**
|
|
158
|
-
* zoom factor of the camera, default is 1
|
|
159
|
-
* eg. https://threejs.org/docs/#api/en/cameras/OrthographicCamera.zoom
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
_this.zoom = 1;
|
|
163
|
-
/**
|
|
164
|
-
* invert the horizontal coordinate system HCS
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
_this.rotateWorld = false;
|
|
168
|
-
/**
|
|
169
|
-
* 投影矩阵参数
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* field of view [0-360]
|
|
174
|
-
* @see http://en.wikipedia.org/wiki/Angle_of_view
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
|
-
_this.fov = 30;
|
|
178
|
-
_this.near = 0.1;
|
|
179
|
-
_this.far = 1000;
|
|
180
|
-
_this.aspect = 1;
|
|
181
|
-
_this.projectionMatrix = mat4.create();
|
|
182
|
-
_this.projectionMatrixInverse = mat4.create();
|
|
183
|
-
_this.jitteredProjectionMatrix = undefined;
|
|
184
|
-
_this.enableUpdate = true; // private following = undefined;
|
|
185
|
-
|
|
186
|
-
_this.type = CameraType.EXPLORING;
|
|
187
|
-
_this.trackingMode = CameraTrackingMode.DEFAULT;
|
|
188
|
-
_this.projectionMode = CameraProjectionMode.PERSPECTIVE;
|
|
189
|
-
/**
|
|
190
|
-
* for culling use
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
_this.frustum = new Frustum();
|
|
194
|
-
/**
|
|
195
|
-
* switch between multiple landmarks
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
|
-
_this.landmarks = [];
|
|
199
|
-
/**
|
|
200
|
-
* ortho matrix for Canvas2D & SVG
|
|
201
|
-
*/
|
|
202
|
-
|
|
203
|
-
_this.orthoMatrix = mat4.create();
|
|
204
|
-
|
|
205
|
-
_this.setType(type, trackingMode);
|
|
206
|
-
|
|
207
|
-
return _this;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
Camera.prototype.isOrtho = function () {
|
|
211
|
-
return this.projectionMode === CameraProjectionMode.ORTHOGRAPHIC;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
Camera.prototype.getProjectionMode = function () {
|
|
215
|
-
return this.projectionMode;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
Camera.prototype.getPerspective = function () {
|
|
219
|
-
// account for TAA
|
|
220
|
-
return this.jitteredProjectionMatrix || this.projectionMatrix;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
Camera.prototype.getPerspectiveInverse = function () {
|
|
224
|
-
return this.projectionMatrixInverse;
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
Camera.prototype.getFrustum = function () {
|
|
228
|
-
return this.frustum;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
Camera.prototype.getPosition = function () {
|
|
232
|
-
return this.position;
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
Camera.prototype.getFocalPoint = function () {
|
|
236
|
-
return this.focalPoint;
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
Camera.prototype.getDollyingStep = function () {
|
|
240
|
-
return this.dollyingStep;
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
Camera.prototype.getNear = function () {
|
|
244
|
-
return this.near;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
Camera.prototype.getFar = function () {
|
|
248
|
-
return this.far;
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
Camera.prototype.getZoom = function () {
|
|
252
|
-
return this.zoom;
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
Camera.prototype.getOrthoMatrix = function () {
|
|
256
|
-
return this.orthoMatrix;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
Camera.prototype.getView = function () {
|
|
260
|
-
return this.view;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
Camera.prototype.setEnableUpdate = function (enabled) {
|
|
264
|
-
this.enableUpdate = enabled;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
Camera.prototype.setType = function (type, trackingMode) {
|
|
268
|
-
this.type = type;
|
|
269
|
-
|
|
270
|
-
if (this.type === CameraType.EXPLORING) {
|
|
271
|
-
this.setWorldRotation(true);
|
|
272
|
-
} else {
|
|
273
|
-
this.setWorldRotation(false);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
this._getAngles();
|
|
277
|
-
|
|
278
|
-
if (this.type === CameraType.TRACKING && trackingMode !== undefined) {
|
|
279
|
-
this.setTrackingMode(trackingMode);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
return this;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
Camera.prototype.setProjectionMode = function (projectionMode) {
|
|
286
|
-
this.projectionMode = projectionMode;
|
|
287
|
-
return this;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
Camera.prototype.setTrackingMode = function (trackingMode) {
|
|
291
|
-
if (this.type !== CameraType.TRACKING) {
|
|
292
|
-
throw new Error('Impossible to set a tracking mode if the camera is not of tracking type');
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
this.trackingMode = trackingMode;
|
|
296
|
-
return this;
|
|
297
|
-
};
|
|
298
|
-
/**
|
|
299
|
-
* If flag is true, it reverses the azimuth and elevation angles.
|
|
300
|
-
* Subsequent calls to rotate, setAzimuth, setElevation,
|
|
301
|
-
* changeAzimuth or changeElevation will cause the inverted effect.
|
|
302
|
-
* setRoll or changeRoll is not affected by this method.
|
|
303
|
-
*
|
|
304
|
-
* This inversion is useful when one wants to simulate that the world
|
|
305
|
-
* is moving, instead of the camera.
|
|
306
|
-
*
|
|
307
|
-
* By default the camera angles are not reversed.
|
|
308
|
-
* @param {Boolean} flag the boolean flag to reverse the angles.
|
|
309
|
-
*/
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
Camera.prototype.setWorldRotation = function (flag) {
|
|
313
|
-
this.rotateWorld = flag;
|
|
314
|
-
|
|
315
|
-
this._getAngles();
|
|
316
|
-
|
|
317
|
-
return this;
|
|
318
|
-
};
|
|
319
|
-
/**
|
|
320
|
-
* 计算 MV 矩阵,为相机矩阵的逆矩阵
|
|
321
|
-
*/
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
Camera.prototype.getViewTransform = function () {
|
|
325
|
-
return mat4.invert(mat4.create(), this.matrix);
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
Camera.prototype.getWorldTransform = function () {
|
|
329
|
-
return this.matrix;
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
Camera.prototype.jitterProjectionMatrix = function (x, y) {
|
|
333
|
-
var translation = mat4.fromTranslation(mat4.create(), [x, y, 0]);
|
|
334
|
-
this.jitteredProjectionMatrix = mat4.multiply(mat4.create(), translation, this.projectionMatrix);
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
Camera.prototype.clearJitterProjectionMatrix = function () {
|
|
338
|
-
this.jitteredProjectionMatrix = undefined;
|
|
339
|
-
};
|
|
340
|
-
/**
|
|
341
|
-
* 设置相机矩阵
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
Camera.prototype.setMatrix = function (matrix) {
|
|
346
|
-
this.matrix = matrix;
|
|
347
|
-
|
|
348
|
-
this._update();
|
|
349
|
-
|
|
350
|
-
return this;
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
Camera.prototype.setFov = function (fov) {
|
|
354
|
-
this.setPerspective(this.near, this.far, fov, this.aspect);
|
|
355
|
-
return this;
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
Camera.prototype.setAspect = function (aspect) {
|
|
359
|
-
this.setPerspective(this.near, this.far, this.fov, aspect);
|
|
360
|
-
return this;
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
Camera.prototype.setNear = function (near) {
|
|
364
|
-
if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
|
|
365
|
-
this.setPerspective(near, this.far, this.fov, this.aspect);
|
|
366
|
-
} else {
|
|
367
|
-
this.setOrthographic(this.left, this.rright, this.top, this.bottom, near, this.far);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
return this;
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
Camera.prototype.setFar = function (far) {
|
|
374
|
-
if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
|
|
375
|
-
this.setPerspective(this.near, far, this.fov, this.aspect);
|
|
376
|
-
} else {
|
|
377
|
-
this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, far);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
return this;
|
|
381
|
-
};
|
|
382
|
-
/**
|
|
383
|
-
* Sets an offset in a larger frustum, used in PixelPicking
|
|
384
|
-
*/
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
Camera.prototype.setViewOffset = function (fullWidth, fullHeight, x, y, width, height) {
|
|
388
|
-
this.aspect = fullWidth / fullHeight;
|
|
389
|
-
|
|
390
|
-
if (this.view === undefined) {
|
|
391
|
-
this.view = {
|
|
392
|
-
enabled: true,
|
|
393
|
-
fullWidth: 1,
|
|
394
|
-
fullHeight: 1,
|
|
395
|
-
offsetX: 0,
|
|
396
|
-
offsetY: 0,
|
|
397
|
-
width: 1,
|
|
398
|
-
height: 1
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
this.view.enabled = true;
|
|
403
|
-
this.view.fullWidth = fullWidth;
|
|
404
|
-
this.view.fullHeight = fullHeight;
|
|
405
|
-
this.view.offsetX = x;
|
|
406
|
-
this.view.offsetY = y;
|
|
407
|
-
this.view.width = width;
|
|
408
|
-
this.view.height = height;
|
|
409
|
-
|
|
410
|
-
if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
|
|
411
|
-
this.setPerspective(this.near, this.far, this.fov, this.aspect);
|
|
412
|
-
} else {
|
|
413
|
-
this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return this;
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
Camera.prototype.clearViewOffset = function () {
|
|
420
|
-
if (this.view !== undefined) {
|
|
421
|
-
this.view.enabled = false;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
|
|
425
|
-
this.setPerspective(this.near, this.far, this.fov, this.aspect);
|
|
426
|
-
} else {
|
|
427
|
-
this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
return this;
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
Camera.prototype.setZoom = function (zoom) {
|
|
434
|
-
this.zoom = zoom;
|
|
435
|
-
|
|
436
|
-
if (this.projectionMode === CameraProjectionMode.ORTHOGRAPHIC) {
|
|
437
|
-
this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);
|
|
438
|
-
} else if (this.projectionMode === CameraProjectionMode.PERSPECTIVE) {
|
|
439
|
-
this.setPerspective(this.near, this.far, this.fov, this.aspect);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
return this;
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
Camera.prototype.setPerspective = function (near, far, fov, aspect) {
|
|
446
|
-
var _a;
|
|
447
|
-
|
|
448
|
-
this.projectionMode = CameraProjectionMode.PERSPECTIVE;
|
|
449
|
-
this.fov = fov;
|
|
450
|
-
this.near = near;
|
|
451
|
-
this.far = far;
|
|
452
|
-
this.aspect = aspect;
|
|
453
|
-
var top = this.near * Math.tan(DEG_2_RAD * 0.5 * this.fov) / this.zoom;
|
|
454
|
-
var height = 2 * top;
|
|
455
|
-
var width = this.aspect * height;
|
|
456
|
-
var left = -0.5 * width;
|
|
457
|
-
|
|
458
|
-
if ((_a = this.view) === null || _a === void 0 ? void 0 : _a.enabled) {
|
|
459
|
-
var fullWidth = this.view.fullWidth;
|
|
460
|
-
var fullHeight = this.view.fullHeight;
|
|
461
|
-
left += this.view.offsetX * width / fullWidth;
|
|
462
|
-
top -= this.view.offsetY * height / fullHeight;
|
|
463
|
-
width *= this.view.width / fullWidth;
|
|
464
|
-
height *= this.view.height / fullHeight;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
makePerspective(this.projectionMatrix, left, left + width, top, top - height, near, this.far); // flipY since the origin of OpenGL/WebGL is bottom-left compared with top-left in Canvas2D
|
|
468
|
-
|
|
469
|
-
mat4.scale(this.projectionMatrix, this.projectionMatrix, vec3.fromValues(1, -1, 1));
|
|
470
|
-
mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
|
|
471
|
-
this.triggerUpdate();
|
|
472
|
-
return this;
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
Camera.prototype.setOrthographic = function (l, r, t, b, near, far) {
|
|
476
|
-
var _a;
|
|
477
|
-
|
|
478
|
-
this.projectionMode = CameraProjectionMode.ORTHOGRAPHIC;
|
|
479
|
-
this.rright = r;
|
|
480
|
-
this.left = l;
|
|
481
|
-
this.top = t;
|
|
482
|
-
this.bottom = b;
|
|
483
|
-
this.near = near;
|
|
484
|
-
this.far = far;
|
|
485
|
-
var dx = (this.rright - this.left) / (2 * this.zoom);
|
|
486
|
-
var dy = (this.top - this.bottom) / (2 * this.zoom);
|
|
487
|
-
var cx = (this.rright + this.left) / 2;
|
|
488
|
-
var cy = (this.top + this.bottom) / 2;
|
|
489
|
-
var left = cx - dx;
|
|
490
|
-
var right = cx + dx;
|
|
491
|
-
var top = cy + dy;
|
|
492
|
-
var bottom = cy - dy;
|
|
493
|
-
|
|
494
|
-
if ((_a = this.view) === null || _a === void 0 ? void 0 : _a.enabled) {
|
|
495
|
-
var scaleW = (this.rright - this.left) / this.view.fullWidth / this.zoom;
|
|
496
|
-
var scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;
|
|
497
|
-
left += scaleW * this.view.offsetX;
|
|
498
|
-
right = left + scaleW * this.view.width;
|
|
499
|
-
top -= scaleH * this.view.offsetY;
|
|
500
|
-
bottom = top - scaleH * this.view.height;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
mat4.ortho(this.projectionMatrix, left, right, bottom, top, near, far); // flipY since the origin of OpenGL/WebGL is bottom-left compared with top-left in Canvas2D
|
|
504
|
-
|
|
505
|
-
mat4.scale(this.projectionMatrix, this.projectionMatrix, vec3.fromValues(1, -1, 1));
|
|
506
|
-
mat4.invert(this.projectionMatrixInverse, this.projectionMatrix);
|
|
507
|
-
|
|
508
|
-
this._getOrthoMatrix();
|
|
509
|
-
|
|
510
|
-
this.triggerUpdate();
|
|
511
|
-
return this;
|
|
512
|
-
};
|
|
513
|
-
/**
|
|
514
|
-
* Move the camera in world coordinates.
|
|
515
|
-
* It will keep looking at the current focal point.
|
|
516
|
-
*
|
|
517
|
-
* support scalars or vectors.
|
|
518
|
-
* @example
|
|
519
|
-
* setPosition(1, 2, 3);
|
|
520
|
-
* setPosition([1, 2, 3]);
|
|
521
|
-
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
Camera.prototype.setPosition = function (x, y, z) {
|
|
525
|
-
if (y === void 0) {
|
|
526
|
-
y = this.position[1];
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
if (z === void 0) {
|
|
530
|
-
z = this.position[2];
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
var position = createVec3(x, y, z);
|
|
534
|
-
|
|
535
|
-
this._setPosition(position);
|
|
536
|
-
|
|
537
|
-
this.setFocalPoint(this.focalPoint);
|
|
538
|
-
this.triggerUpdate();
|
|
539
|
-
return this;
|
|
540
|
-
};
|
|
541
|
-
/**
|
|
542
|
-
* Sets the focal point of this camera in world coordinates.
|
|
543
|
-
*
|
|
544
|
-
* support scalars or vectors.
|
|
545
|
-
* @example
|
|
546
|
-
* setFocalPoint(1, 2, 3);
|
|
547
|
-
* setFocalPoint([1, 2, 3]);
|
|
548
|
-
*/
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
Camera.prototype.setFocalPoint = function (x, y, z) {
|
|
552
|
-
if (y === void 0) {
|
|
553
|
-
y = this.focalPoint[1];
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
if (z === void 0) {
|
|
557
|
-
z = this.focalPoint[2];
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
var up = vec3.fromValues(0, 1, 0);
|
|
561
|
-
this.focalPoint = createVec3(x, y, z);
|
|
562
|
-
|
|
563
|
-
if (this.trackingMode === CameraTrackingMode.CINEMATIC) {
|
|
564
|
-
var d = vec3.subtract(vec3.create(), this.focalPoint, this.position);
|
|
565
|
-
x = d[0];
|
|
566
|
-
y = d[1];
|
|
567
|
-
z = d[2];
|
|
568
|
-
var r = vec3.length(d);
|
|
569
|
-
var el = Math.asin(y / r) * RAD_2_DEG;
|
|
570
|
-
var az = 90 + Math.atan2(z, x) * RAD_2_DEG;
|
|
571
|
-
var m = mat4.create();
|
|
572
|
-
mat4.rotateY(m, m, az * DEG_2_RAD);
|
|
573
|
-
mat4.rotateX(m, m, el * DEG_2_RAD);
|
|
574
|
-
up = vec3.transformMat4(vec3.create(), [0, 1, 0], m);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
mat4.invert(this.matrix, mat4.lookAt(mat4.create(), this.position, this.focalPoint, up));
|
|
578
|
-
|
|
579
|
-
this._getAxes();
|
|
580
|
-
|
|
581
|
-
this._getDistance();
|
|
582
|
-
|
|
583
|
-
this._getAngles();
|
|
584
|
-
|
|
585
|
-
this.triggerUpdate();
|
|
586
|
-
return this;
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
Camera.prototype.getDistance = function () {
|
|
590
|
-
return this.distance;
|
|
591
|
-
};
|
|
592
|
-
/**
|
|
593
|
-
* Moves the camera towards/from the focal point.
|
|
594
|
-
*/
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
Camera.prototype.setDistance = function (d) {
|
|
598
|
-
if (this.distance === d || d < 0) {
|
|
599
|
-
return this;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
this.distance = d;
|
|
603
|
-
|
|
604
|
-
if (this.distance < MIN_DISTANCE) {
|
|
605
|
-
this.distance = MIN_DISTANCE;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
this.dollyingStep = this.distance / 100;
|
|
609
|
-
var pos = vec3.create();
|
|
610
|
-
d = this.distance;
|
|
611
|
-
var n = this.forward;
|
|
612
|
-
var f = this.focalPoint;
|
|
613
|
-
pos[0] = d * n[0] + f[0];
|
|
614
|
-
pos[1] = d * n[1] + f[1];
|
|
615
|
-
pos[2] = d * n[2] + f[2];
|
|
616
|
-
|
|
617
|
-
this._setPosition(pos);
|
|
618
|
-
|
|
619
|
-
this.triggerUpdate();
|
|
620
|
-
return this;
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
Camera.prototype.setMaxDistance = function (d) {
|
|
624
|
-
this.maxDistance = d;
|
|
625
|
-
return this;
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
Camera.prototype.setMinDistance = function (d) {
|
|
629
|
-
this.minDistance = d;
|
|
630
|
-
return this;
|
|
631
|
-
}; // /**
|
|
632
|
-
// * Changes the initial azimuth of the camera
|
|
633
|
-
// */
|
|
634
|
-
// changeAzimuth(az: number) {
|
|
635
|
-
// this.setAzimuth(this.azimuth + az);
|
|
636
|
-
// this.triggerUpdate();
|
|
637
|
-
// return this;
|
|
638
|
-
// }
|
|
639
|
-
// /**
|
|
640
|
-
// * Changes the initial elevation of the camera
|
|
641
|
-
// */
|
|
642
|
-
// changeElevation(el: number) {
|
|
643
|
-
// this.setElevation(this.elevation + el);
|
|
644
|
-
// this.triggerUpdate();
|
|
645
|
-
// return this;
|
|
646
|
-
// }
|
|
647
|
-
// /**
|
|
648
|
-
// * Changes the initial roll of the camera
|
|
649
|
-
// */
|
|
650
|
-
// changeRoll(rl: number) {
|
|
651
|
-
// this.setRoll(this.roll + rl);
|
|
652
|
-
// this.triggerUpdate();
|
|
653
|
-
// return this;
|
|
654
|
-
// }
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
|
|
658
|
-
* the azimuth in degrees
|
|
659
|
-
*/
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
Camera.prototype.setAzimuth = function (az) {
|
|
663
|
-
this.azimuth = getAngle(az);
|
|
664
|
-
this.computeMatrix();
|
|
665
|
-
|
|
666
|
-
this._getAxes();
|
|
667
|
-
|
|
668
|
-
if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
|
|
669
|
-
this._getPosition();
|
|
670
|
-
} else if (this.type === CameraType.TRACKING) {
|
|
671
|
-
this._getFocalPoint();
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
this.triggerUpdate();
|
|
675
|
-
return this;
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
Camera.prototype.getAzimuth = function () {
|
|
679
|
-
return this.azimuth;
|
|
680
|
-
};
|
|
681
|
-
/**
|
|
682
|
-
* 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
|
|
683
|
-
*/
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
Camera.prototype.setElevation = function (el) {
|
|
687
|
-
this.elevation = getAngle(el);
|
|
688
|
-
this.computeMatrix();
|
|
689
|
-
|
|
690
|
-
this._getAxes();
|
|
691
|
-
|
|
692
|
-
if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
|
|
693
|
-
this._getPosition();
|
|
694
|
-
} else if (this.type === CameraType.TRACKING) {
|
|
695
|
-
this._getFocalPoint();
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
this.triggerUpdate();
|
|
699
|
-
return this;
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
Camera.prototype.getElevation = function () {
|
|
703
|
-
return this.elevation;
|
|
704
|
-
};
|
|
705
|
-
/**
|
|
706
|
-
* 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置
|
|
707
|
-
*/
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
Camera.prototype.setRoll = function (angle) {
|
|
711
|
-
this.roll = getAngle(angle);
|
|
712
|
-
this.computeMatrix();
|
|
713
|
-
|
|
714
|
-
this._getAxes();
|
|
715
|
-
|
|
716
|
-
if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
|
|
717
|
-
this._getPosition();
|
|
718
|
-
} else if (this.type === CameraType.TRACKING) {
|
|
719
|
-
this._getFocalPoint();
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
this.triggerUpdate();
|
|
723
|
-
return this;
|
|
724
|
-
};
|
|
725
|
-
|
|
726
|
-
Camera.prototype.getRoll = function () {
|
|
727
|
-
return this.roll;
|
|
728
|
-
};
|
|
729
|
-
/**
|
|
730
|
-
* Changes the azimuth and elevation with respect to the current camera axes
|
|
731
|
-
* @param {Number} azimuth the relative azimuth
|
|
732
|
-
* @param {Number} elevation the relative elevation
|
|
733
|
-
* @param {Number} roll the relative roll
|
|
734
|
-
*/
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
Camera.prototype.rotate = function (azimuth, elevation, roll) {
|
|
738
|
-
this.relElevation = getAngle(elevation);
|
|
739
|
-
this.relAzimuth = getAngle(azimuth);
|
|
740
|
-
this.relRoll = getAngle(roll);
|
|
741
|
-
this.elevation += this.relElevation;
|
|
742
|
-
this.azimuth += this.relAzimuth;
|
|
743
|
-
this.roll += this.relRoll;
|
|
744
|
-
|
|
745
|
-
if (this.type === CameraType.EXPLORING) {
|
|
746
|
-
var rotX = quat.setAxisAngle(quat.create(), [1, 0, 0], (this.rotateWorld ? 1 : -1) * this.relElevation * DEG_2_RAD);
|
|
747
|
-
var rotY = quat.setAxisAngle(quat.create(), [0, 1, 0], (this.rotateWorld ? 1 : -1) * this.relAzimuth * DEG_2_RAD);
|
|
748
|
-
var rotZ = quat.setAxisAngle(quat.create(), [0, 0, 1], this.relRoll * DEG_2_RAD);
|
|
749
|
-
var rotQ = quat.multiply(quat.create(), rotY, rotX);
|
|
750
|
-
rotQ = quat.multiply(quat.create(), rotQ, rotZ);
|
|
751
|
-
var rotMatrix = mat4.fromQuat(mat4.create(), rotQ);
|
|
752
|
-
mat4.translate(this.matrix, this.matrix, [0, 0, -this.distance]);
|
|
753
|
-
mat4.multiply(this.matrix, this.matrix, rotMatrix);
|
|
754
|
-
mat4.translate(this.matrix, this.matrix, [0, 0, this.distance]);
|
|
755
|
-
} else {
|
|
756
|
-
if (Math.abs(this.elevation) > 90) {
|
|
757
|
-
return this;
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
this.computeMatrix();
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
this._getAxes();
|
|
764
|
-
|
|
765
|
-
if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
|
|
766
|
-
this._getPosition();
|
|
767
|
-
} else if (this.type === CameraType.TRACKING) {
|
|
768
|
-
this._getFocalPoint();
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
this._update();
|
|
772
|
-
|
|
773
|
-
return this;
|
|
774
|
-
};
|
|
775
|
-
/**
|
|
776
|
-
* 沿水平(right) & 垂直(up)平移相机
|
|
777
|
-
*/
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
Camera.prototype.pan = function (tx, ty) {
|
|
781
|
-
var coords = createVec3(tx, ty, 0);
|
|
782
|
-
var pos = vec3.clone(this.position);
|
|
783
|
-
vec3.add(pos, pos, vec3.scale(vec3.create(), this.right, coords[0]));
|
|
784
|
-
vec3.add(pos, pos, vec3.scale(vec3.create(), this.up, coords[1]));
|
|
785
|
-
|
|
786
|
-
this._setPosition(pos);
|
|
787
|
-
|
|
788
|
-
this.triggerUpdate();
|
|
789
|
-
return this;
|
|
790
|
-
};
|
|
791
|
-
/**
|
|
792
|
-
* 沿 n 轴移动,当距离视点远时移动速度较快,离视点越近速度越慢
|
|
793
|
-
*/
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
Camera.prototype.dolly = function (value) {
|
|
797
|
-
var n = this.forward;
|
|
798
|
-
var pos = vec3.clone(this.position);
|
|
799
|
-
var step = value * this.dollyingStep;
|
|
800
|
-
var updatedDistance = this.distance + value * this.dollyingStep; // 限制视点距离范围
|
|
801
|
-
|
|
802
|
-
step = Math.max(Math.min(updatedDistance, this.maxDistance), this.minDistance) - this.distance;
|
|
803
|
-
pos[0] += step * n[0];
|
|
804
|
-
pos[1] += step * n[1];
|
|
805
|
-
pos[2] += step * n[2];
|
|
806
|
-
|
|
807
|
-
this._setPosition(pos);
|
|
808
|
-
|
|
809
|
-
if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
|
|
810
|
-
// 重新计算视点距离
|
|
811
|
-
this._getDistance();
|
|
812
|
-
} else if (this.type === CameraType.TRACKING) {
|
|
813
|
-
// 保持视距,移动视点位置
|
|
814
|
-
vec3.add(this.focalPoint, pos, this.distanceVector);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
this.triggerUpdate();
|
|
818
|
-
return this;
|
|
819
|
-
};
|
|
820
|
-
|
|
821
|
-
Camera.prototype.createLandmark = function (name, params) {
|
|
822
|
-
if (params === void 0) {
|
|
823
|
-
params = {};
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
var _a = params.position,
|
|
827
|
-
position = _a === void 0 ? this.position : _a,
|
|
828
|
-
_b = params.focalPoint,
|
|
829
|
-
focalPoint = _b === void 0 ? this.focalPoint : _b,
|
|
830
|
-
roll = params.roll,
|
|
831
|
-
zoom = params.zoom;
|
|
832
|
-
var camera = new Camera();
|
|
833
|
-
camera.setType(this.type, undefined);
|
|
834
|
-
camera.setPosition(position[0], position[1] || this.position[1], position[2] || this.position[2]);
|
|
835
|
-
camera.setFocalPoint(focalPoint[0], focalPoint[1] || this.focalPoint[1], focalPoint[2] || this.focalPoint[2]);
|
|
836
|
-
camera.setRoll(roll || this.roll);
|
|
837
|
-
camera.setZoom(zoom || this.zoom);
|
|
838
|
-
var landmark = {
|
|
839
|
-
name: name,
|
|
840
|
-
matrix: mat4.clone(camera.matrix),
|
|
841
|
-
right: vec3.clone(camera.right),
|
|
842
|
-
up: vec3.clone(camera.up),
|
|
843
|
-
forward: vec3.clone(camera.forward),
|
|
844
|
-
position: vec3.clone(camera.position),
|
|
845
|
-
focalPoint: vec3.clone(camera.focalPoint),
|
|
846
|
-
distanceVector: vec3.clone(camera.distanceVector),
|
|
847
|
-
distance: camera.distance,
|
|
848
|
-
dollyingStep: camera.dollyingStep,
|
|
849
|
-
azimuth: camera.azimuth,
|
|
850
|
-
elevation: camera.elevation,
|
|
851
|
-
roll: camera.roll,
|
|
852
|
-
relAzimuth: camera.relAzimuth,
|
|
853
|
-
relElevation: camera.relElevation,
|
|
854
|
-
relRoll: camera.relRoll,
|
|
855
|
-
zoom: camera.zoom
|
|
856
|
-
};
|
|
857
|
-
this.landmarks.push(landmark);
|
|
858
|
-
return landmark;
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
Camera.prototype.gotoLandmark = function (name, options) {
|
|
862
|
-
var _this = this;
|
|
863
|
-
|
|
864
|
-
if (options === void 0) {
|
|
865
|
-
options = {};
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
var landmark = isString(name) ? this.landmarks.find(function (l) {
|
|
869
|
-
return l.name === name;
|
|
870
|
-
}) : name;
|
|
871
|
-
|
|
872
|
-
if (landmark) {
|
|
873
|
-
var _a = isNumber(options) ? {
|
|
874
|
-
duration: options
|
|
875
|
-
} : options,
|
|
876
|
-
_b = _a.easing,
|
|
877
|
-
easing = _b === void 0 ? 'linear' : _b,
|
|
878
|
-
_c = _a.duration,
|
|
879
|
-
duration_1 = _c === void 0 ? 100 : _c,
|
|
880
|
-
_d = _a.easingFunction,
|
|
881
|
-
easingFunction = _d === void 0 ? undefined : _d,
|
|
882
|
-
_e = _a.onfinish,
|
|
883
|
-
onfinish_1 = _e === void 0 ? undefined : _e;
|
|
884
|
-
|
|
885
|
-
var epsilon_1 = 0.01;
|
|
886
|
-
|
|
887
|
-
if (duration_1 === 0) {
|
|
888
|
-
this.syncFromLandmark(landmark);
|
|
889
|
-
|
|
890
|
-
if (onfinish_1) {
|
|
891
|
-
onfinish_1();
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
return;
|
|
895
|
-
} // cancel ongoing animation
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
if (this.landmarkAnimationID !== undefined) {
|
|
899
|
-
this.canvas.cancelAnimationFrame(this.landmarkAnimationID);
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
var destPosition_1 = landmark.position;
|
|
903
|
-
var destFocalPoint_1 = landmark.focalPoint;
|
|
904
|
-
var destZoom_1 = landmark.zoom;
|
|
905
|
-
var destRoll_1 = landmark.roll;
|
|
906
|
-
var easingFunc_1 = easingFunction || parseEasingFunction(easing);
|
|
907
|
-
var timeStart_1;
|
|
908
|
-
|
|
909
|
-
var endAnimation_1 = function endAnimation_1() {
|
|
910
|
-
_this.setFocalPoint(destFocalPoint_1);
|
|
911
|
-
|
|
912
|
-
_this.setPosition(destPosition_1);
|
|
913
|
-
|
|
914
|
-
_this.setRoll(destRoll_1);
|
|
915
|
-
|
|
916
|
-
_this.setZoom(destZoom_1);
|
|
917
|
-
|
|
918
|
-
_this.computeMatrix();
|
|
919
|
-
|
|
920
|
-
_this.triggerUpdate();
|
|
921
|
-
|
|
922
|
-
if (onfinish_1) {
|
|
923
|
-
onfinish_1();
|
|
924
|
-
}
|
|
925
|
-
};
|
|
926
|
-
|
|
927
|
-
var animate_1 = function animate_1(timestamp) {
|
|
928
|
-
if (timeStart_1 === undefined) {
|
|
929
|
-
timeStart_1 = timestamp;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
var elapsed = timestamp - timeStart_1;
|
|
933
|
-
|
|
934
|
-
if (elapsed > duration_1) {
|
|
935
|
-
endAnimation_1();
|
|
936
|
-
return;
|
|
937
|
-
} // use the same ease function in animation system
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
var t = easingFunc_1(elapsed / duration_1);
|
|
941
|
-
var interFocalPoint = vec3.create();
|
|
942
|
-
var interPosition = vec3.create();
|
|
943
|
-
var interZoom = 1;
|
|
944
|
-
var interRoll = 0;
|
|
945
|
-
vec3.lerp(interFocalPoint, _this.focalPoint, destFocalPoint_1, t);
|
|
946
|
-
vec3.lerp(interPosition, _this.position, destPosition_1, t);
|
|
947
|
-
interRoll = _this.roll * (1 - t) + destRoll_1 * t;
|
|
948
|
-
interZoom = _this.zoom * (1 - t) + destZoom_1 * t;
|
|
949
|
-
|
|
950
|
-
_this.setFocalPoint(interFocalPoint);
|
|
951
|
-
|
|
952
|
-
_this.setPosition(interPosition);
|
|
953
|
-
|
|
954
|
-
_this.setRoll(interRoll);
|
|
955
|
-
|
|
956
|
-
_this.setZoom(interZoom);
|
|
957
|
-
|
|
958
|
-
var dist = vec3.dist(interFocalPoint, destFocalPoint_1) + vec3.dist(interPosition, destPosition_1);
|
|
959
|
-
|
|
960
|
-
if (dist <= epsilon_1) {
|
|
961
|
-
endAnimation_1();
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
_this.computeMatrix();
|
|
966
|
-
|
|
967
|
-
_this.triggerUpdate();
|
|
968
|
-
|
|
969
|
-
if (elapsed < duration_1) {
|
|
970
|
-
_this.landmarkAnimationID = _this.canvas.requestAnimationFrame(animate_1);
|
|
971
|
-
}
|
|
972
|
-
};
|
|
973
|
-
|
|
974
|
-
this.canvas.requestAnimationFrame(animate_1);
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
/**
|
|
978
|
-
* 根据相机矩阵重新计算各种相机参数
|
|
979
|
-
*/
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
Camera.prototype._update = function () {
|
|
983
|
-
this._getAxes();
|
|
984
|
-
|
|
985
|
-
this._getPosition();
|
|
986
|
-
|
|
987
|
-
this._getDistance();
|
|
988
|
-
|
|
989
|
-
this._getAngles();
|
|
990
|
-
|
|
991
|
-
this._getOrthoMatrix();
|
|
992
|
-
|
|
993
|
-
this.triggerUpdate();
|
|
994
|
-
};
|
|
995
|
-
/**
|
|
996
|
-
* 计算相机矩阵
|
|
997
|
-
*/
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
Camera.prototype.computeMatrix = function () {
|
|
1001
|
-
// 使用四元数描述 3D 旋转
|
|
1002
|
-
// @see https://xiaoiver.github.io/coding/2018/12/28/Camera-%E8%AE%BE%E8%AE%A1-%E4%B8%80.html
|
|
1003
|
-
var rotZ = quat.setAxisAngle(quat.create(), [0, 0, 1], this.roll * DEG_2_RAD);
|
|
1004
|
-
mat4.identity(this.matrix); // only consider HCS for EXPLORING and ORBITING cameras
|
|
1005
|
-
|
|
1006
|
-
var rotX = quat.setAxisAngle(quat.create(), [1, 0, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.elevation * DEG_2_RAD);
|
|
1007
|
-
var rotY = quat.setAxisAngle(quat.create(), [0, 1, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.azimuth * DEG_2_RAD);
|
|
1008
|
-
var rotQ = quat.multiply(quat.create(), rotY, rotX);
|
|
1009
|
-
rotQ = quat.multiply(quat.create(), rotQ, rotZ);
|
|
1010
|
-
var rotMatrix = mat4.fromQuat(mat4.create(), rotQ);
|
|
1011
|
-
|
|
1012
|
-
if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
|
|
1013
|
-
mat4.translate(this.matrix, this.matrix, this.focalPoint);
|
|
1014
|
-
mat4.multiply(this.matrix, this.matrix, rotMatrix);
|
|
1015
|
-
mat4.translate(this.matrix, this.matrix, [0, 0, this.distance]);
|
|
1016
|
-
} else if (this.type === CameraType.TRACKING) {
|
|
1017
|
-
mat4.translate(this.matrix, this.matrix, this.position);
|
|
1018
|
-
mat4.multiply(this.matrix, this.matrix, rotMatrix);
|
|
1019
|
-
}
|
|
1020
|
-
};
|
|
1021
|
-
/**
|
|
1022
|
-
* Sets the camera position in the camera matrix
|
|
1023
|
-
*/
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
Camera.prototype._setPosition = function (x, y, z) {
|
|
1027
|
-
this.position = createVec3(x, y, z);
|
|
1028
|
-
var m = this.matrix;
|
|
1029
|
-
m[12] = this.position[0];
|
|
1030
|
-
m[13] = this.position[1];
|
|
1031
|
-
m[14] = this.position[2];
|
|
1032
|
-
m[15] = 1;
|
|
1033
|
-
|
|
1034
|
-
this._getOrthoMatrix();
|
|
1035
|
-
};
|
|
1036
|
-
/**
|
|
1037
|
-
* Recalculates axes based on the current matrix
|
|
1038
|
-
*/
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
Camera.prototype._getAxes = function () {
|
|
1042
|
-
vec3.copy(this.right, createVec3(vec4.transformMat4(vec4.create(), [1, 0, 0, 0], this.matrix)));
|
|
1043
|
-
vec3.copy(this.up, createVec3(vec4.transformMat4(vec4.create(), [0, 1, 0, 0], this.matrix)));
|
|
1044
|
-
vec3.copy(this.forward, createVec3(vec4.transformMat4(vec4.create(), [0, 0, 1, 0], this.matrix)));
|
|
1045
|
-
vec3.normalize(this.right, this.right);
|
|
1046
|
-
vec3.normalize(this.up, this.up);
|
|
1047
|
-
vec3.normalize(this.forward, this.forward);
|
|
1048
|
-
};
|
|
1049
|
-
/**
|
|
1050
|
-
* Recalculates euler angles based on the current state
|
|
1051
|
-
*/
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
Camera.prototype._getAngles = function () {
|
|
1055
|
-
// Recalculates angles
|
|
1056
|
-
var x = this.distanceVector[0];
|
|
1057
|
-
var y = this.distanceVector[1];
|
|
1058
|
-
var z = this.distanceVector[2];
|
|
1059
|
-
var r = vec3.length(this.distanceVector); // FAST FAIL: If there is no distance we cannot compute angles
|
|
1060
|
-
|
|
1061
|
-
if (r === 0) {
|
|
1062
|
-
this.elevation = 0;
|
|
1063
|
-
this.azimuth = 0;
|
|
1064
|
-
return;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
if (this.type === CameraType.TRACKING) {
|
|
1068
|
-
this.elevation = Math.asin(y / r) * RAD_2_DEG;
|
|
1069
|
-
this.azimuth = Math.atan2(-x, -z) * RAD_2_DEG;
|
|
1070
|
-
} else {
|
|
1071
|
-
if (this.rotateWorld) {
|
|
1072
|
-
this.elevation = Math.asin(y / r) * RAD_2_DEG;
|
|
1073
|
-
this.azimuth = Math.atan2(-x, -z) * RAD_2_DEG;
|
|
1074
|
-
} else {
|
|
1075
|
-
this.elevation = -Math.asin(y / r) * RAD_2_DEG;
|
|
1076
|
-
this.azimuth = -Math.atan2(-x, -z) * RAD_2_DEG;
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
};
|
|
1080
|
-
/**
|
|
1081
|
-
* 重新计算相机位置,只有 ORBITING 模式相机位置才会发生变化
|
|
1082
|
-
*/
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
Camera.prototype._getPosition = function () {
|
|
1086
|
-
vec3.copy(this.position, createVec3(vec4.transformMat4(vec4.create(), [0, 0, 0, 1], this.matrix))); // 相机位置变化,需要重新计算视距
|
|
1087
|
-
|
|
1088
|
-
this._getDistance();
|
|
1089
|
-
};
|
|
1090
|
-
/**
|
|
1091
|
-
* 重新计算视点,只有 TRACKING 模式视点才会发生变化
|
|
1092
|
-
*/
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
Camera.prototype._getFocalPoint = function () {
|
|
1096
|
-
vec3.transformMat3(this.distanceVector, [0, 0, -this.distance], mat3.fromMat4(mat3.create(), this.matrix));
|
|
1097
|
-
vec3.add(this.focalPoint, this.position, this.distanceVector); // 视点变化,需要重新计算视距
|
|
1098
|
-
|
|
1099
|
-
this._getDistance();
|
|
1100
|
-
};
|
|
1101
|
-
/**
|
|
1102
|
-
* 重新计算视距
|
|
1103
|
-
*/
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
Camera.prototype._getDistance = function () {
|
|
1107
|
-
this.distanceVector = vec3.subtract(vec3.create(), this.focalPoint, this.position);
|
|
1108
|
-
this.distance = vec3.length(this.distanceVector);
|
|
1109
|
-
this.dollyingStep = this.distance / 100;
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
Camera.prototype._getOrthoMatrix = function () {
|
|
1113
|
-
if (this.projectionMode !== CameraProjectionMode.ORTHOGRAPHIC) {
|
|
1114
|
-
return;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
var position = this.position;
|
|
1118
|
-
var rotZ = quat.setAxisAngle(quat.create(), [0, 0, 1], -this.roll * Math.PI / 180);
|
|
1119
|
-
mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix, rotZ, vec3.fromValues((this.rright - this.left) / 2 - position[0], (this.top - this.bottom) / 2 - position[1], 0), vec3.fromValues(this.zoom, this.zoom, 1), position);
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
|
-
Camera.prototype.triggerUpdate = function () {
|
|
1123
|
-
if (this.enableUpdate) {
|
|
1124
|
-
// update frustum
|
|
1125
|
-
var viewMatrix = this.getViewTransform();
|
|
1126
|
-
var vpMatrix = mat4.multiply(mat4.create(), this.getPerspective(), viewMatrix);
|
|
1127
|
-
this.getFrustum().extractFromVPMatrix(vpMatrix);
|
|
1128
|
-
this.emit(CameraEvent.UPDATED);
|
|
1129
|
-
}
|
|
1130
|
-
};
|
|
1131
|
-
|
|
1132
|
-
Camera.prototype.syncFromLandmark = function (landmark) {
|
|
1133
|
-
this.matrix = mat4.copy(this.matrix, landmark.matrix);
|
|
1134
|
-
this.right = vec3.copy(this.right, landmark.right);
|
|
1135
|
-
this.up = vec3.copy(this.up, landmark.up);
|
|
1136
|
-
this.forward = vec3.copy(this.forward, landmark.forward);
|
|
1137
|
-
this.position = vec3.copy(this.position, landmark.position);
|
|
1138
|
-
this.focalPoint = vec3.copy(this.focalPoint, landmark.focalPoint);
|
|
1139
|
-
this.distanceVector = vec3.copy(this.distanceVector, landmark.distanceVector);
|
|
1140
|
-
this.azimuth = landmark.azimuth;
|
|
1141
|
-
this.elevation = landmark.elevation;
|
|
1142
|
-
this.roll = landmark.roll;
|
|
1143
|
-
this.relAzimuth = landmark.relAzimuth;
|
|
1144
|
-
this.relElevation = landmark.relElevation;
|
|
1145
|
-
this.relRoll = landmark.relRoll;
|
|
1146
|
-
this.dollyingStep = landmark.dollyingStep;
|
|
1147
|
-
this.distance = landmark.distance;
|
|
1148
|
-
this.zoom = landmark.zoom;
|
|
1149
|
-
};
|
|
1150
|
-
|
|
1151
|
-
return Camera;
|
|
1152
|
-
}(EventEmitter);
|
|
1153
|
-
|
|
1154
|
-
export { Camera };
|