@openglobus/og 0.28.7 → 1.0.0-rc2
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/LICENSE.md +218 -4
- package/README.md +31 -18
- package/lib/Deferred.d.ts +2 -2
- package/lib/Events.d.ts +1 -1
- package/lib/Globe.d.ts +8 -5
- package/lib/Object3d.d.ts +17 -14
- package/lib/Popup.d.ts +2 -2
- package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +1 -0
- package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +1 -0
- package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +1 -0
- package/lib/bv/index.d.ts +2 -2
- package/lib/camera/Camera.d.ts +280 -27
- package/lib/camera/Frustum.d.ts +100 -15
- package/lib/camera/PlanetCamera.d.ts +93 -8
- package/lib/camera/index.d.ts +2 -2
- package/lib/control/CameraFrameComposer.d.ts +2 -2
- package/lib/control/CameraFrameHandler.d.ts +1 -1
- package/lib/control/CompassButton.d.ts +2 -2
- package/lib/control/EarthCoordinates.d.ts +5 -2
- package/lib/control/FramebufferPreview.d.ts +3 -3
- package/lib/control/GeoImageDragControl.d.ts +1 -1
- package/lib/control/LayerAnimation.d.ts +2 -2
- package/lib/control/LayerSwitcher.d.ts +3 -0
- package/lib/control/Lighting.d.ts +4 -2
- package/lib/control/Navigation.d.ts +15 -11
- package/lib/control/OrthoSwitcher.d.ts +18 -0
- package/lib/control/SimpleTouchNavigation.d.ts +44 -0
- package/lib/control/Sun.d.ts +4 -2
- package/lib/control/TouchNavigation.d.ts +4 -8
- package/lib/control/atmosphere/Atmosphere.d.ts +2 -0
- package/lib/control/atmosphere/AtmosphereConfig.d.ts +2 -6
- package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +17 -3
- package/lib/control/cameraDepthHandler/camera_depth.d.ts +2 -2
- package/lib/control/drawing/LineStringDrawingScene.d.ts +1 -0
- package/lib/control/drawing/PolygonDrawingScene.d.ts +14 -14
- package/lib/control/elevationProfile/ElevationProfile.d.ts +1 -1
- package/lib/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
- package/lib/control/elevationProfile/ElevationProfileScene.d.ts +9 -12
- package/lib/control/elevationProfile/ElevationProfileView.d.ts +16 -5
- package/lib/control/entityEditor/EntityEditor.d.ts +19 -0
- package/lib/control/{geoObjectEditor/GeoObjectEditorDialog.d.ts → entityEditor/EntityEditorDialog.d.ts} +9 -8
- package/lib/control/{geoObjectEditor/GeoObjectEditorScene.d.ts → entityEditor/EntityEditorScene.d.ts} +12 -12
- package/lib/control/{geoObjectEditor → entityEditor}/colors.d.ts +2 -2
- package/lib/control/entityTree/EntityTree.d.ts +46 -0
- package/lib/control/entityTree/EntityTreeView.d.ts +24 -0
- package/lib/control/heightRuler/HeightRulerScene.d.ts +3 -2
- package/lib/control/index.d.ts +5 -3
- package/lib/control/ruler/RulerScene.d.ts +8 -8
- package/lib/control/selection/SelectionScene.d.ts +6 -6
- package/lib/control/timeline/TimelineControl.d.ts +2 -2
- package/lib/control/timeline/TimelineModel.d.ts +1 -1
- package/lib/control/timeline/TimelineView.d.ts +52 -13
- package/lib/control/visibleExtent/segment.d.ts +7 -0
- package/lib/ellipsoid/index.d.ts +4 -4
- package/lib/entity/Entity.d.ts +114 -100
- package/lib/entity/EntityCollection.d.ts +95 -70
- package/lib/entity/{BaseBillboard.d.ts → billboard/BaseBillboard.d.ts} +16 -17
- package/lib/entity/{BaseBillboardHandler.d.ts → billboard/BaseBillboardHandler.d.ts} +24 -9
- package/lib/entity/{Billboard.d.ts → billboard/Billboard.d.ts} +11 -7
- package/lib/entity/{BillboardHandler.d.ts → billboard/BillboardHandler.d.ts} +1 -1
- package/lib/entity/{GeoObject.d.ts → geoObject/GeoObject.d.ts} +7 -6
- package/lib/entity/{GeoObjectHandler.d.ts → geoObject/GeoObjectHandler.d.ts} +29 -11
- package/lib/entity/{InstanceData.d.ts → geoObject/InstanceData.d.ts} +18 -13
- package/lib/entity/{Geometry.d.ts → geometry/Geometry.d.ts} +10 -10
- package/lib/entity/{GeometryHandler.d.ts → geometry/GeometryHandler.d.ts} +7 -7
- package/lib/entity/index.d.ts +8 -8
- package/lib/entity/{Label.d.ts → label/Label.d.ts} +12 -13
- package/lib/entity/{LabelHandler.d.ts → label/LabelHandler.d.ts} +31 -7
- package/lib/entity/{LabelWorker.d.ts → label/LabelWorker.d.ts} +3 -3
- package/lib/entity/{PointCloud.d.ts → pointCloud/PointCloud.d.ts} +18 -12
- package/lib/entity/{PointCloudHandler.d.ts → pointCloud/PointCloudHandler.d.ts} +4 -4
- package/lib/entity/polyline/Polyline.d.ts +242 -0
- package/lib/entity/polyline/PolylineBatchRenderer.d.ts +443 -0
- package/lib/entity/{PolylineHandler.d.ts → polyline/PolylineHandler.d.ts} +19 -7
- package/lib/entity/{Ray.d.ts → ray/Ray.d.ts} +27 -9
- package/lib/entity/{RayHandler.d.ts → ray/RayHandler.d.ts} +18 -8
- package/lib/entity/{Strip.d.ts → strip/Strip.d.ts} +21 -17
- package/lib/entity/{StripHandler.d.ts → strip/StripHandler.d.ts} +11 -6
- package/lib/index.d.ts +47 -42
- package/lib/layer/BaseGeoImage.d.ts +20 -17
- package/lib/layer/CanvasTiles.d.ts +14 -12
- package/lib/layer/GeoImage.d.ts +1 -1
- package/lib/layer/GeoTexture2d.d.ts +2 -2
- package/lib/layer/KML.d.ts +19 -18
- package/lib/layer/Layer.d.ts +72 -53
- package/lib/layer/Vector.d.ts +47 -30
- package/lib/layer/WMS.d.ts +1 -1
- package/lib/layer/XYZ.d.ts +11 -12
- package/lib/layer/index.d.ts +12 -12
- package/lib/math/Line2.d.ts +1 -1
- package/lib/math/Line3.d.ts +1 -1
- package/lib/math/Mat3.d.ts +3 -13
- package/lib/math/Mat4.d.ts +16 -10
- package/lib/math/Plane.d.ts +1 -1
- package/lib/math/Quat.d.ts +14 -12
- package/lib/math/Ray.d.ts +4 -3
- package/lib/math/Vec2.d.ts +25 -17
- package/lib/math/Vec3.d.ts +33 -31
- package/lib/math/Vec4.d.ts +1 -1
- package/lib/math/coder.d.ts +1 -1
- package/lib/math/index.d.ts +13 -14
- package/lib/mercator.d.ts +4 -4
- package/lib/og.css +1 -1
- package/lib/og.es.js +1 -1
- package/lib/og.es.js.map +1 -1
- package/lib/quadTree/EntityCollectionNode.d.ts +10 -10
- package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +5 -5
- package/lib/quadTree/QuadTreeStrategy.d.ts +3 -4
- package/lib/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +4 -4
- package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +4 -4
- package/lib/renderer/AtmosphereDeferredShading.d.ts +12 -0
- package/lib/renderer/IDeferredShadingPass.d.ts +8 -0
- package/lib/renderer/ITransparencyPass.d.ts +8 -0
- package/lib/renderer/PhongDeferredShading.d.ts +16 -0
- package/lib/renderer/Renderer.d.ts +166 -99
- package/lib/renderer/RendererEvents.d.ts +15 -5
- package/lib/renderer/WOITPass.d.ts +14 -0
- package/lib/res/fonts/Ephesis-Regular.json +1 -0
- package/lib/res/fonts/Ephesis-Regular.png +0 -0
- package/lib/res/fonts/Karla-Bold.json +1 -0
- package/lib/res/fonts/Karla-Bold.png +0 -0
- package/lib/res/fonts/Karla-Italic.json +1 -0
- package/lib/res/fonts/Karla-Italic.png +0 -0
- package/lib/res/fonts/Karla-Light.json +1 -0
- package/lib/res/fonts/Karla-Light.png +0 -0
- package/lib/res/fonts/Karla-Medium.json +1 -0
- package/lib/res/fonts/Karla-Medium.png +0 -0
- package/lib/res/fonts/Roboto-Regular.json +1 -37147
- package/lib/res/fonts/Roboto-Regular.png +0 -0
- package/lib/res/fonts/arial.json +1 -4321
- package/lib/res/fonts/arial.png +0 -0
- package/lib/res/night-4326.png +0 -0
- package/lib/res/night.png +0 -0
- package/lib/scene/AltitudeNearPlaneStrategy.d.ts +17 -0
- package/lib/scene/Axes.d.ts +4 -3
- package/lib/scene/Planet.d.ts +244 -69
- package/lib/scene/{RenderNode.d.ts → Scene.d.ts} +49 -46
- package/lib/scene/SkyBox.d.ts +5 -3
- package/lib/scene/index.d.ts +2 -2
- package/lib/segment/Segment.d.ts +29 -15
- package/lib/segment/SegmentLonLat.d.ts +0 -1
- package/lib/shadeModeConstants.d.ts +7 -0
- package/lib/shaders/applyDeferredDepth.d.ts +2 -0
- package/lib/shaders/atmos/atmos.d.ts +3 -3
- package/lib/shaders/billboard/billboard.d.ts +4 -3
- package/lib/shaders/deferredShading/deferredShading.d.ts +2 -0
- package/lib/shaders/deferredShading/deferredShadingAtmos.d.ts +3 -0
- package/lib/shaders/depth.d.ts +2 -2
- package/lib/shaders/geo_object/geo_object.d.ts +8 -4
- package/lib/shaders/label/label.d.ts +4 -4
- package/lib/shaders/pointCloud.d.ts +2 -2
- package/lib/shaders/polyline/polyline.d.ts +7 -3
- package/lib/shaders/ray/ray.d.ts +3 -2
- package/lib/shaders/screenFrame.d.ts +2 -2
- package/lib/shaders/segment/segment.d.ts +7 -0
- package/lib/shaders/skybox.d.ts +2 -2
- package/lib/shaders/strip/strip.d.ts +3 -0
- package/lib/shaders/tone_mapping/toneMapping.d.ts +2 -2
- package/lib/shaders/weightedOITResolve.d.ts +2 -0
- package/lib/terrain/BilTerrain.d.ts +1 -1
- package/lib/terrain/EmptyTerrain.d.ts +5 -6
- package/lib/terrain/GlobusTerrain.d.ts +18 -23
- package/lib/terrain/RgbTerrain.d.ts +8 -8
- package/lib/terrain/index.d.ts +5 -5
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/ui/Button.d.ts +7 -5
- package/lib/ui/ButtonGroup.d.ts +1 -1
- package/lib/ui/Checkbox.d.ts +2 -2
- package/lib/ui/Color.d.ts +2 -2
- package/lib/ui/Dialog.d.ts +30 -3
- package/lib/ui/Input.d.ts +7 -2
- package/lib/ui/Slider.d.ts +5 -2
- package/lib/ui/ToggleButton.d.ts +2 -2
- package/lib/ui/View.d.ts +1 -1
- package/lib/ui/icons.d.ts +1 -1
- package/lib/ui/index.d.ts +9 -9
- package/lib/utils/FontAtlas.d.ts +57 -8
- package/lib/utils/GeoImageCreator.d.ts +2 -2
- package/lib/utils/ImagesCacheManager.d.ts +3 -3
- package/lib/utils/Loader.d.ts +2 -2
- package/lib/utils/PlainSegmentWorker.d.ts +2 -2
- package/lib/utils/TerrainWorker.d.ts +2 -2
- package/lib/utils/TextureAtlas.d.ts +7 -2
- package/lib/utils/TextureResourceManager.d.ts +162 -0
- package/lib/utils/VectorTileCreator.d.ts +1 -1
- package/lib/utils/colorSpace.d.ts +9 -0
- package/lib/utils/gltf/gltfParser.d.ts +9 -2
- package/lib/utils/gltf/types.d.ts +20 -2
- package/lib/utils/shared.d.ts +11 -5
- package/lib/utils/textureResourceMeta.d.ts +9 -0
- package/lib/webgl/BaseFramebuffer.d.ts +7 -0
- package/lib/webgl/Framebuffer.d.ts +9 -6
- package/lib/webgl/Handler.d.ts +81 -99
- package/lib/webgl/ShaderProgram.d.ts +190 -0
- package/lib/webgl/index.d.ts +2 -2
- package/lib/webgl/variableHandlers.d.ts +2 -1
- package/package.json +77 -76
- package/lib/assets/LabelWorker.worker-BT1uJgYn.js.map +0 -1
- package/lib/assets/PlainSegmentWorker.worker-CT1cj8jj.js.map +0 -1
- package/lib/assets/TerrainWorker.worker-DmikdfB2.js.map +0 -1
- package/lib/control/OldMouseNavigation.d.ts +0 -65
- package/lib/control/ZoomControl.d.ts +0 -28
- package/lib/control/geoObjectEditor/GeoObjectEditor.d.ts +0 -13
- package/lib/control/visibleExtent/drawnode.d.ts +0 -7
- package/lib/entity/Polyline.d.ts +0 -417
- package/lib/light/LightSource.d.ts +0 -36
- package/lib/res/fonts/Roboto-Regular.ttf.cfg +0 -1340
- package/lib/res/fonts/Roboto-Regular.ttf.png +0 -0
- package/lib/res/fonts/arial.ttf.cfg +0 -1570
- package/lib/res/fonts/arial.ttf.png +0 -0
- package/lib/scene/BaseNode.d.ts +0 -61
- package/lib/shaders/drawnode/drawnode.d.ts +0 -8
- package/lib/webgl/Program.d.ts +0 -161
- package/lib/webgl/ProgramController.d.ts +0 -87
- /package/lib/control/{geoObjectEditor → entityEditor}/ArrowEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/AxisTrackEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/MoveAxisEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/MovePlaneEntity.d.ts +0 -0
- /package/lib/control/{geoObjectEditor → entityEditor}/RotateEntity.d.ts +0 -0
- /package/lib/entity/{LabelWorker.worker.d.ts → label/LabelWorker.worker.d.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { EntityCollection } from
|
|
2
|
-
import { Extent } from
|
|
3
|
-
import { LonLat } from
|
|
4
|
-
import { Node } from "../quadTree/Node";
|
|
5
|
-
import { Planet } from "../scene/Planet";
|
|
6
|
-
import { Sphere } from
|
|
7
|
-
import { Segment } from "../segment/Segment";
|
|
8
|
-
import { Vector } from "../layer/Vector";
|
|
9
|
-
import { Entity } from "../entity/Entity";
|
|
10
|
-
import { EntityCollectionsTreeStrategy } from "./EntityCollectionsTreeStrategy";
|
|
1
|
+
import { EntityCollection } from "../entity/EntityCollection";
|
|
2
|
+
import { Extent } from "../Extent";
|
|
3
|
+
import { LonLat } from "../LonLat";
|
|
4
|
+
import type { Node } from "../quadTree/Node";
|
|
5
|
+
import type { Planet } from "../scene/Planet";
|
|
6
|
+
import { Sphere } from "../bv/Sphere";
|
|
7
|
+
import type { Segment } from "../segment/Segment";
|
|
8
|
+
import type { Vector } from "../layer/Vector";
|
|
9
|
+
import type { Entity } from "../entity/Entity";
|
|
10
|
+
import type { EntityCollectionsTreeStrategy } from "./EntityCollectionsTreeStrategy";
|
|
11
11
|
export type NodesDict = Record<number, Node>;
|
|
12
12
|
/**
|
|
13
13
|
* @todo: remove planet parameter. It's already available in the layer.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Vector } from "../layer/Vector";
|
|
2
|
-
import { EntityCollectionNode } from "./EntityCollectionNode";
|
|
3
|
-
import { Entity } from "../entity/Entity";
|
|
4
|
-
import { EntityCollection } from "../entity/EntityCollection";
|
|
1
|
+
import type { Vector } from "../layer/Vector";
|
|
2
|
+
import type { EntityCollectionNode } from "./EntityCollectionNode";
|
|
3
|
+
import type { Entity } from "../entity/Entity";
|
|
4
|
+
import type { EntityCollection } from "../entity/EntityCollection";
|
|
5
5
|
import { QueueArray } from "../QueueArray";
|
|
6
|
-
import { QuadTreeStrategy } from "./QuadTreeStrategy";
|
|
6
|
+
import type { QuadTreeStrategy } from "./QuadTreeStrategy";
|
|
7
7
|
export declare class EntityCollectionsTreeStrategy {
|
|
8
8
|
_layer: Vector;
|
|
9
9
|
/**
|
|
@@ -9,10 +9,7 @@ import { Extent } from "../Extent";
|
|
|
9
9
|
import { EntityCollectionsTreeStrategy } from "./EntityCollectionsTreeStrategy";
|
|
10
10
|
import { PlanetCamera } from "../camera";
|
|
11
11
|
import { EventsHandler } from "../Events";
|
|
12
|
-
export type QuadTreeStrategyEventsList = [
|
|
13
|
-
"rendercompleted",
|
|
14
|
-
"terraincompleted"
|
|
15
|
-
];
|
|
12
|
+
export type QuadTreeStrategyEventsList = ["rendercompleted", "terraincompleted"];
|
|
16
13
|
export interface QuadTreeStrategyParams {
|
|
17
14
|
planet: Planet;
|
|
18
15
|
name?: string;
|
|
@@ -49,6 +46,7 @@ export declare class QuadTreeStrategy {
|
|
|
49
46
|
_fadingNodes: Map<number, Node>;
|
|
50
47
|
_fadingNodesInFrustum: Node[][];
|
|
51
48
|
_fadingOpaqueSegments: Segment[];
|
|
49
|
+
_transparentSegments: Segment[];
|
|
52
50
|
/**
|
|
53
51
|
* Current visible minimal zoom index planet segment.
|
|
54
52
|
* @public
|
|
@@ -94,6 +92,7 @@ export declare class QuadTreeStrategy {
|
|
|
94
92
|
get terrainReady(): boolean;
|
|
95
93
|
protected _checkRendercompleted(): void;
|
|
96
94
|
protected _initEvents(): void;
|
|
95
|
+
protected _updateRenderedNodesInFrustumArray(camera: PlanetCamera): void;
|
|
97
96
|
init(camera: PlanetCamera): void;
|
|
98
97
|
clearRenderedNodes(): void;
|
|
99
98
|
protected _clearRenderedNodeList(): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EarthEntityCollectionsTreeStrategy } from "./EarthEntityCollectionsTreeStrategy";
|
|
1
|
+
import type { EarthEntityCollectionsTreeStrategy } from "./EarthEntityCollectionsTreeStrategy";
|
|
2
2
|
import { Extent } from "../../Extent";
|
|
3
|
-
import { Planet } from "../../scene/Planet";
|
|
3
|
+
import type { Planet } from "../../scene/Planet";
|
|
4
4
|
import { LonLat } from "../../LonLat";
|
|
5
|
-
import { Entity } from "../../entity/Entity";
|
|
6
|
-
import { EntityCollection } from "../../entity/EntityCollection";
|
|
5
|
+
import type { Entity } from "../../entity/Entity";
|
|
6
|
+
import type { EntityCollection } from "../../entity/EntityCollection";
|
|
7
7
|
import { EntityCollectionNode } from "../EntityCollectionNode";
|
|
8
8
|
import type { NodesDict } from "../EntityCollectionNode";
|
|
9
9
|
export declare class EarthEntityCollectionNodeLonLat extends EntityCollectionNode {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EntityCollectionNode } from "../EntityCollectionNode";
|
|
2
2
|
import { EarthEntityCollectionNodeLonLat } from "./EarthEntityCollectionNodeLonLat";
|
|
3
|
-
import { Vector } from "../../layer/Vector";
|
|
4
|
-
import { Entity } from "../../entity/Entity";
|
|
5
|
-
import { EntityCollection } from "../../entity/EntityCollection";
|
|
3
|
+
import type { Vector } from "../../layer/Vector";
|
|
4
|
+
import type { Entity } from "../../entity/Entity";
|
|
5
|
+
import type { EntityCollection } from "../../entity/EntityCollection";
|
|
6
6
|
import { EntityCollectionsTreeStrategy } from "../EntityCollectionsTreeStrategy";
|
|
7
|
-
import { QuadTreeStrategy } from "../QuadTreeStrategy";
|
|
7
|
+
import type { QuadTreeStrategy } from "../QuadTreeStrategy";
|
|
8
8
|
export declare class EarthEntityCollectionsTreeStrategy extends EntityCollectionsTreeStrategy {
|
|
9
9
|
protected _entityCollectionsTree: EntityCollectionNode;
|
|
10
10
|
protected _entityCollectionsTreeNorth: EarthEntityCollectionNodeLonLat;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PhongDeferredShading } from "./PhongDeferredShading";
|
|
2
|
+
import type { Renderer } from "./Renderer";
|
|
3
|
+
import type { Atmosphere } from "../control/atmosphere/Atmosphere";
|
|
4
|
+
import type { AtmosphereParameters } from "../shaders/atmos/atmos";
|
|
5
|
+
export declare class AtmosphereDeferredShading extends PhongDeferredShading {
|
|
6
|
+
protected _atmosphere: Atmosphere;
|
|
7
|
+
protected _atmosParams: AtmosphereParameters;
|
|
8
|
+
constructor(renderer: Renderer, atmosphere: Atmosphere, atmosParams: AtmosphereParameters);
|
|
9
|
+
init(): void;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
protected _deferredShadingPASS(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Framebuffer } from "../webgl/Framebuffer";
|
|
2
|
+
import type { IDeferredShadingPass } from "./IDeferredShadingPass";
|
|
3
|
+
import type { Renderer } from "./Renderer";
|
|
4
|
+
export declare class PhongDeferredShading implements IDeferredShadingPass {
|
|
5
|
+
protected _renderer: Renderer;
|
|
6
|
+
protected _framebuffer: Framebuffer | null;
|
|
7
|
+
constructor(renderer: Renderer);
|
|
8
|
+
init(): void;
|
|
9
|
+
beginPass(): void;
|
|
10
|
+
endPass(): void;
|
|
11
|
+
applyLighting(): void;
|
|
12
|
+
resize(width: number, height: number): void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
protected _applyDeferredDepth(): void;
|
|
15
|
+
protected _deferredShadingPASS(): void;
|
|
16
|
+
}
|
|
@@ -2,17 +2,22 @@ import { Camera } from "../camera/Camera";
|
|
|
2
2
|
import { Control } from "../control/Control";
|
|
3
3
|
import type { IBaseInputState, RendererEventsHandler } from "./RendererEvents";
|
|
4
4
|
import { EntityCollection } from "../entity/EntityCollection";
|
|
5
|
-
import { Framebuffer, Multisample } from "../webgl/index";
|
|
5
|
+
import { Framebuffer, Multisample, ShaderProgram } from "../webgl/index";
|
|
6
6
|
import { FontAtlas } from "../utils/FontAtlas";
|
|
7
7
|
import { Handler } from "../webgl/Handler";
|
|
8
|
-
import type { WebGLBufferExt } from "../webgl/Handler";
|
|
9
|
-
import { LabelWorker } from "../entity/LabelWorker";
|
|
10
|
-
import {
|
|
8
|
+
import type { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
9
|
+
import { LabelWorker } from "../entity/label/LabelWorker";
|
|
10
|
+
import { Scene } from "../scene/Scene";
|
|
11
|
+
import type { IDeferredShadingPass } from "./IDeferredShadingPass";
|
|
12
|
+
import type { ITransparencyPass } from "./ITransparencyPass";
|
|
13
|
+
import { TextureResourceManager } from "../utils/TextureResourceManager";
|
|
14
|
+
import type { RendererTextureRequest } from "../utils/TextureResourceManager";
|
|
11
15
|
import { TextureAtlas } from "../utils/TextureAtlas";
|
|
12
16
|
import { Vec2 } from "../math/Vec2";
|
|
13
17
|
import { Vec3 } from "../math/Vec3";
|
|
14
18
|
import type { NumberArray3 } from "../math/Vec3";
|
|
15
19
|
import { Vec4 } from "../math/Vec4";
|
|
20
|
+
import type { NumberArray4 } from "../math/Vec4";
|
|
16
21
|
export interface IRendererParams {
|
|
17
22
|
controls?: Control[];
|
|
18
23
|
msaa?: number;
|
|
@@ -22,6 +27,10 @@ export interface IRendererParams {
|
|
|
22
27
|
exposure?: number;
|
|
23
28
|
dpi?: number;
|
|
24
29
|
clearColor?: [number, number, number, number];
|
|
30
|
+
lightPosition?: NumberArray3;
|
|
31
|
+
lightAmbient?: NumberArray3;
|
|
32
|
+
lightDiffuse?: NumberArray3;
|
|
33
|
+
lightSpecular?: NumberArray4;
|
|
25
34
|
}
|
|
26
35
|
interface IPickingObject {
|
|
27
36
|
_pickingColor?: Vec3;
|
|
@@ -33,37 +42,49 @@ interface IFrameCallbackHandler {
|
|
|
33
42
|
sender: any;
|
|
34
43
|
}
|
|
35
44
|
/**
|
|
36
|
-
*
|
|
45
|
+
* High-level WebGL interface that runs the WebGL handler in real time.
|
|
37
46
|
* @class
|
|
38
|
-
* @param {Handler} handler - WebGL handler
|
|
39
|
-
* @param {
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @fires
|
|
53
|
-
* @fires
|
|
54
|
-
* @fires
|
|
55
|
-
* @fires
|
|
56
|
-
* @fires
|
|
57
|
-
* @fires
|
|
58
|
-
* @fires
|
|
59
|
-
* @fires
|
|
60
|
-
* @fires
|
|
61
|
-
* @fires
|
|
62
|
-
* @fires
|
|
63
|
-
* @fires
|
|
64
|
-
* @fires
|
|
65
|
-
* @fires
|
|
66
|
-
* @fires
|
|
47
|
+
* @param {Handler | string | HTMLCanvasElement} handler - WebGL handler instance or canvas target selector/element.
|
|
48
|
+
* @param {IRendererParams} [params={}] - Renderer parameters:
|
|
49
|
+
* - controls: Control instances to add to the renderer
|
|
50
|
+
* - msaa: MSAA (Multi-Sample Anti-Aliasing) level
|
|
51
|
+
* - autoActivate: Start rendering automatically after creation
|
|
52
|
+
* - fontsSrc: Path to font resources
|
|
53
|
+
* - gamma: Gamma correction value
|
|
54
|
+
* - exposure: HDR exposure value
|
|
55
|
+
* - dpi: Device pixel ratio
|
|
56
|
+
* - clearColor: RGBA clear color array
|
|
57
|
+
* - lightPosition: Light position `[x, y, z]`
|
|
58
|
+
* - lightAmbient: Light ambient color `[r, g, b]`
|
|
59
|
+
* - lightDiffuse: Light diffuse color `[r, g, b]`
|
|
60
|
+
* - lightSpecular: Light specular `[r, g, b, shininess]`
|
|
61
|
+
* @fires draw - Triggered before each frame is rendered.
|
|
62
|
+
* @fires resize - Triggered when the canvas is resized.
|
|
63
|
+
* @fires mousemove - Triggered when the mouse moves over the canvas.
|
|
64
|
+
* @fires mousestop - Triggered when the mouse stops moving.
|
|
65
|
+
* @fires lclick - Triggered on left mouse button click.
|
|
66
|
+
* @fires rclick - Triggered on right mouse button click.
|
|
67
|
+
* @fires mclick - Triggered on middle mouse button click.
|
|
68
|
+
* @fires ldblclick - Triggered on left mouse button double-click.
|
|
69
|
+
* @fires rdblclick - Triggered on right mouse button double-click.
|
|
70
|
+
* @fires mdblclick - Triggered on middle mouse button double-click.
|
|
71
|
+
* @fires lup - Triggered when the left mouse button is released.
|
|
72
|
+
* @fires rup - Triggered when the right mouse button is released.
|
|
73
|
+
* @fires mup - Triggered when the middle mouse button is released.
|
|
74
|
+
* @fires ldown - Triggered when the left mouse button is pressed.
|
|
75
|
+
* @fires rdown - Triggered when the right mouse button is pressed.
|
|
76
|
+
* @fires mdown - Triggered when the middle mouse button is pressed.
|
|
77
|
+
* @fires lhold - Triggered while the left mouse button is held.
|
|
78
|
+
* @fires rhold - Triggered while the right mouse button is held.
|
|
79
|
+
* @fires mhold - Triggered while the middle mouse button is held.
|
|
80
|
+
* @fires mousewheel - Triggered on mouse wheel scroll.
|
|
81
|
+
* @fires touchstart - Triggered on touch start.
|
|
82
|
+
* @fires touchend - Triggered on the touch end.
|
|
83
|
+
* @fires touchcancel - Triggered on touch cancel.
|
|
84
|
+
* @fires touchmove - Triggered on touch move.
|
|
85
|
+
* @fires doubletouch - Triggered on double touch.
|
|
86
|
+
* @fires touchleave - Triggered when touch leaves the canvas.
|
|
87
|
+
* @fires touchenter - Triggered when touch enters the canvas.
|
|
67
88
|
*/
|
|
68
89
|
export interface HTMLDivElementExt extends HTMLDivElement {
|
|
69
90
|
attributions?: HTMLElement;
|
|
@@ -75,6 +96,9 @@ declare class Renderer {
|
|
|
75
96
|
* @type {HTMLElement | null}
|
|
76
97
|
*/
|
|
77
98
|
div: HTMLDivElementExt | null;
|
|
99
|
+
protected _topLeftContainer: HTMLDivElement;
|
|
100
|
+
protected _topRightContainer: HTMLDivElement;
|
|
101
|
+
protected _bottomRightContainer: HTMLDivElement;
|
|
78
102
|
/**
|
|
79
103
|
* WebGL handler context.
|
|
80
104
|
* @public
|
|
@@ -88,15 +112,15 @@ declare class Renderer {
|
|
|
88
112
|
/**
|
|
89
113
|
* Render nodes drawing queue.
|
|
90
114
|
* @public
|
|
91
|
-
* @type {Array.<
|
|
115
|
+
* @type {Array.<Scene>}
|
|
92
116
|
*/
|
|
93
|
-
|
|
117
|
+
_scenesArr: Scene[];
|
|
94
118
|
/**
|
|
95
119
|
* Render nodes store for the comfortable access by the node name.
|
|
96
120
|
* @public
|
|
97
|
-
* @type {Object.<
|
|
121
|
+
* @type {Object.<Scene>}
|
|
98
122
|
*/
|
|
99
|
-
|
|
123
|
+
scenes: Record<string, Scene>;
|
|
100
124
|
/**
|
|
101
125
|
* Current active camera.
|
|
102
126
|
* @public
|
|
@@ -133,7 +157,7 @@ declare class Renderer {
|
|
|
133
157
|
*/
|
|
134
158
|
protected _pickingCallbacks: IFrameCallbackHandler[];
|
|
135
159
|
/**
|
|
136
|
-
* Picking objects(labels and billboards) framebuffer.
|
|
160
|
+
* Picking objects (labels and billboards) framebuffer.
|
|
137
161
|
* @public
|
|
138
162
|
* @type {Framebuffer}
|
|
139
163
|
*/
|
|
@@ -146,15 +170,16 @@ declare class Renderer {
|
|
|
146
170
|
depthFramebuffer: Framebuffer | null;
|
|
147
171
|
protected _msaa: number;
|
|
148
172
|
protected _internalFormat: string;
|
|
149
|
-
protected
|
|
150
|
-
protected _type: string;
|
|
173
|
+
protected _depthComponent: string;
|
|
151
174
|
protected _depthRefreshRequired: boolean;
|
|
152
|
-
|
|
153
|
-
protected
|
|
175
|
+
forwardFramebuffer: Multisample | null;
|
|
176
|
+
protected hdrFramebuffer: Framebuffer | null;
|
|
177
|
+
deferredShadingPass: IDeferredShadingPass;
|
|
178
|
+
transparencyPass: ITransparencyPass;
|
|
154
179
|
protected toneMappingFramebuffer: Framebuffer | null;
|
|
155
180
|
protected _initialized: boolean;
|
|
156
181
|
/**
|
|
157
|
-
* Texture atlas for the
|
|
182
|
+
* Texture atlas for the billboard images.
|
|
158
183
|
* @public
|
|
159
184
|
* @type {TextureAtlas}
|
|
160
185
|
*/
|
|
@@ -166,99 +191,125 @@ declare class Renderer {
|
|
|
166
191
|
*/
|
|
167
192
|
fontAtlas: FontAtlas;
|
|
168
193
|
/**
|
|
169
|
-
* Texture atlas for the rays, polylines and strips entities.
|
|
194
|
+
* Texture atlas for the rays, polylines, and strips entities.
|
|
170
195
|
* @public
|
|
171
196
|
* @type {TextureAtlas}
|
|
172
197
|
*/
|
|
173
198
|
strokeTextureAtlas: TextureAtlas;
|
|
174
199
|
protected _entityCollections: EntityCollection[][];
|
|
175
200
|
protected _currentOutput: string;
|
|
176
|
-
protected _fnScreenFrame: Function | null;
|
|
177
201
|
labelWorker: LabelWorker;
|
|
178
202
|
screenDepthFramebuffer: Framebuffer | null;
|
|
179
203
|
screenFramePositionBuffer: WebGLBufferExt | null;
|
|
180
204
|
screenTexture: Record<string, WebGLTexture>;
|
|
181
205
|
outputTexture: WebGLTexture | null;
|
|
182
|
-
protected _readPickingBuffer: () => void;
|
|
183
206
|
clearColor: Float32Array;
|
|
207
|
+
protected _textureResourceManager: TextureResourceManager;
|
|
208
|
+
_lightPosition: Float32Array;
|
|
209
|
+
_lightAmbient: Float32Array;
|
|
210
|
+
_lightDiffuse: Float32Array;
|
|
211
|
+
_lightSpecular: Float32Array;
|
|
184
212
|
constructor(handler: Handler | string | HTMLCanvasElement, params?: IRendererParams);
|
|
185
213
|
enableBlendOneSrcAlpha(): void;
|
|
214
|
+
set lightAmbient(lightAmbient: NumberArray3 | Float32Array);
|
|
215
|
+
get lightAmbient(): NumberArray3;
|
|
216
|
+
set lightDiffuse(lightDiffuse: NumberArray3 | Float32Array);
|
|
217
|
+
get lightDiffuse(): NumberArray3;
|
|
218
|
+
set lightSpecular(lightSpecular: NumberArray4 | Float32Array);
|
|
219
|
+
get lightSpecular(): NumberArray4;
|
|
186
220
|
enableBlendDefault(): void;
|
|
221
|
+
enableBlendWoit(): void;
|
|
222
|
+
/**
|
|
223
|
+
* Sets depth compare and clear value for the camera (reverse-Z vs classic).
|
|
224
|
+
* Pass null to restore the classic depth state:
|
|
225
|
+
* depthFunc(LESS), clearDepth(1), and clip-control NEGATIVE_ONE_TO_ONE.
|
|
226
|
+
*/
|
|
227
|
+
applyDepthForCamera(camera?: Camera | null): void;
|
|
187
228
|
setRelativeCenter(c?: Vec3): void;
|
|
188
229
|
/**
|
|
189
|
-
*
|
|
190
|
-
* @
|
|
230
|
+
* Enables or disables renderer events.
|
|
231
|
+
* @public
|
|
232
|
+
* @param {boolean} activity - Events activity flag.
|
|
191
233
|
*/
|
|
192
234
|
setEventsActivity(activity: boolean): void;
|
|
193
235
|
addDepthCallback(sender: any, callback: Function): number;
|
|
194
236
|
removeDepthCallback(id: number): void;
|
|
195
237
|
/**
|
|
196
|
-
* Adds picking
|
|
197
|
-
* @
|
|
198
|
-
* @param {
|
|
199
|
-
* @
|
|
238
|
+
* Adds a picking render callback.
|
|
239
|
+
* @public
|
|
240
|
+
* @param {any} sender - Callback context.
|
|
241
|
+
* @param {Function} callback - Render callback function.
|
|
242
|
+
* @returns {number} Callback ID.
|
|
200
243
|
*/
|
|
201
244
|
addPickingCallback(sender: any, callback: Function): number;
|
|
202
245
|
/**
|
|
203
|
-
* Removes picking
|
|
204
|
-
* @
|
|
246
|
+
* Removes a picking render callback.
|
|
247
|
+
* @public
|
|
248
|
+
* @param {number} id - Callback ID to remove.
|
|
205
249
|
*/
|
|
206
250
|
removePickingCallback(id: number): void;
|
|
207
251
|
getPickingObject<T>(r: number, g: number, b: number): T;
|
|
208
252
|
getPickingObjectArr<T>(arr: NumberArray3 | Uint8Array): T;
|
|
209
253
|
getPickingObject3v<T>(vec: Vec3 | Vec4): T;
|
|
210
254
|
/**
|
|
211
|
-
*
|
|
255
|
+
* Assigns a picking color to an object.
|
|
212
256
|
* @public
|
|
213
|
-
* @param {Object} obj - Object that
|
|
257
|
+
* @param {Object} obj - Object that receives a picking color.
|
|
214
258
|
*/
|
|
215
259
|
assignPickingColor<T>(obj: T & IPickingObject): void;
|
|
216
260
|
/**
|
|
217
|
-
* Removes picking color from object.
|
|
261
|
+
* Removes the picking color from an object.
|
|
218
262
|
* @public
|
|
219
|
-
* @param {Object} obj - Object to
|
|
263
|
+
* @param {Object} obj - Object to clear the picking color from.
|
|
220
264
|
*/
|
|
221
265
|
clearPickingColor<T>(obj: T & IPickingObject): void;
|
|
266
|
+
get viewportWidth(): number;
|
|
267
|
+
get viewportHeight(): number;
|
|
268
|
+
get internalFormat(): string;
|
|
269
|
+
get depthComponent(): string;
|
|
222
270
|
/**
|
|
223
|
-
*
|
|
271
|
+
* Returns the canvas client width.
|
|
224
272
|
* @public
|
|
225
|
-
* @returns {number}
|
|
273
|
+
* @returns {number}
|
|
226
274
|
*/
|
|
227
275
|
getWidth(): number;
|
|
228
276
|
/**
|
|
229
|
-
*
|
|
277
|
+
* Returns the canvas client height.
|
|
230
278
|
* @public
|
|
231
|
-
* @returns {number}
|
|
279
|
+
* @returns {number}
|
|
232
280
|
*/
|
|
233
281
|
getHeight(): number;
|
|
234
282
|
/**
|
|
235
|
-
*
|
|
283
|
+
* Returns the canvas viewport center.
|
|
236
284
|
* @public
|
|
237
|
-
* @returns {Vec2}
|
|
285
|
+
* @returns {Vec2}
|
|
238
286
|
*/
|
|
239
|
-
|
|
287
|
+
getViewportCenter(): Vec2;
|
|
240
288
|
/**
|
|
241
|
-
*
|
|
289
|
+
* Adds a control to the renderer.
|
|
242
290
|
* @public
|
|
243
|
-
* @returns {Vec2} -
|
|
244
|
-
*/
|
|
245
|
-
getClientCenter(): Vec2;
|
|
246
|
-
/**
|
|
247
|
-
* Add the given control to the renderer.
|
|
248
291
|
* @param {Control} control - Control.
|
|
249
292
|
*/
|
|
250
293
|
addControl(control: Control): void;
|
|
251
294
|
/**
|
|
252
|
-
*
|
|
295
|
+
* Adds an array of controls to the renderer.
|
|
296
|
+
* @public
|
|
253
297
|
* @param {Array.<Control>} cArr - Control array.
|
|
254
298
|
*/
|
|
255
299
|
addControls(cArr: Control[]): void;
|
|
256
300
|
/**
|
|
257
|
-
*
|
|
258
|
-
* @
|
|
301
|
+
* Removes a control from the renderer.
|
|
302
|
+
* @public
|
|
303
|
+
* @param {Control} control - Control.
|
|
259
304
|
*/
|
|
260
305
|
removeControl(control: Control): void;
|
|
261
306
|
isInitialized(): boolean;
|
|
307
|
+
protected _appendControlContainers(): void;
|
|
308
|
+
acquireTexture(params: RendererTextureRequest): WebGLTextureExt | null;
|
|
309
|
+
releaseTexture(texture: WebGLTextureExt | null | undefined): void;
|
|
310
|
+
topLeftContainer(): HTMLDivElement;
|
|
311
|
+
topRightContainer(): HTMLDivElement;
|
|
312
|
+
bottomRightContainer(): HTMLDivElement;
|
|
262
313
|
/**
|
|
263
314
|
* Renderer initialization.
|
|
264
315
|
* @public
|
|
@@ -269,42 +320,42 @@ declare class Renderer {
|
|
|
269
320
|
setCurrentScreen(screenName: string): void;
|
|
270
321
|
_resizeStart(): void;
|
|
271
322
|
_resizeEnd(): void;
|
|
272
|
-
removeNode(
|
|
323
|
+
removeNode(scene: Scene): void;
|
|
273
324
|
/**
|
|
274
|
-
* Adds
|
|
325
|
+
* Adds a scene to the renderer.
|
|
275
326
|
* @public
|
|
276
|
-
* @param {
|
|
327
|
+
* @param {Scene} scene - Scene.
|
|
277
328
|
*/
|
|
278
|
-
|
|
279
|
-
protected
|
|
329
|
+
addScene(scene: Scene): void;
|
|
330
|
+
protected _initializeScenes(): void;
|
|
280
331
|
/**
|
|
281
|
-
* Adds
|
|
332
|
+
* Adds a scene to the renderer before a specific node.
|
|
282
333
|
* @public
|
|
283
|
-
* @param {
|
|
284
|
-
* @param {
|
|
334
|
+
* @param {Scene} scene - Render node.
|
|
335
|
+
* @param {Scene} sceneBefore - Insert before the sceneBefore node.
|
|
285
336
|
*/
|
|
286
|
-
|
|
337
|
+
addSceneBefore(scene: Scene, sceneBefore: Scene): void;
|
|
287
338
|
/**
|
|
288
|
-
* Adds
|
|
339
|
+
* Adds scenes to the renderer.
|
|
289
340
|
* @public
|
|
290
|
-
* @param {Array.<
|
|
341
|
+
* @param {Array.<Scene>} nodesArr - Render nodes array.
|
|
291
342
|
*/
|
|
292
|
-
|
|
293
|
-
getMaxMSAA(internalFormat: string):
|
|
343
|
+
addScenes(nodesArr: Scene[]): void;
|
|
344
|
+
getMaxMSAA(internalFormat: string): number;
|
|
294
345
|
getMSAA(): number;
|
|
295
346
|
/**
|
|
296
|
-
* TODO: replace with cache
|
|
347
|
+
* TODO: replace with cache-friendly linked list by BillboardHandler, LabelHandler etc.
|
|
297
348
|
*/
|
|
298
349
|
enqueueEntityCollectionsToDraw(ecArr: EntityCollection[], depthOrder?: number): void;
|
|
299
350
|
/**
|
|
300
351
|
* Forces the depth buffer to be refreshed in the next frame.
|
|
301
|
-
* Has effect for terrain altitude estimate precision.
|
|
352
|
+
* Has an effect for terrain altitude estimate precision.
|
|
302
353
|
*/
|
|
303
354
|
markForDepthRefresh(): void;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
protected
|
|
355
|
+
protected _drawGBufferEntityCollections(depthOrder: number): void;
|
|
356
|
+
protected _drawForwardEntityCollections(depthOrder: number): void;
|
|
357
|
+
protected _drawTransparentEntityCollections(depthOrder: number): void;
|
|
358
|
+
protected _drawTransparentEntityCollectionsForward(depthOrder: number): void;
|
|
308
359
|
protected _drawPickingEntityCollections(depthOrder: number): void;
|
|
309
360
|
protected _drawDepthEntityCollections(depthOrder: number): void;
|
|
310
361
|
protected _clearEntityCollectionQueue(depthOrder: number): void;
|
|
@@ -313,9 +364,7 @@ declare class Renderer {
|
|
|
313
364
|
* @public
|
|
314
365
|
*/
|
|
315
366
|
draw(): void;
|
|
316
|
-
|
|
317
|
-
protected _screenFrameMSAA(): void;
|
|
318
|
-
protected _screenFrameNoMSAA(): void;
|
|
367
|
+
protected _screenFrame(): void;
|
|
319
368
|
/**
|
|
320
369
|
* Draw picking objects framebuffer.
|
|
321
370
|
* @private
|
|
@@ -323,8 +372,7 @@ declare class Renderer {
|
|
|
323
372
|
protected _drawPickingBuffer(depthOrder: number): void;
|
|
324
373
|
protected _drawDepthBuffer(depthOrder: number): void;
|
|
325
374
|
protected _readDepthBuffer(callback?: () => void): void;
|
|
326
|
-
protected
|
|
327
|
-
protected _readPickingBuffer_webgl2(): void;
|
|
375
|
+
protected _readPickingBuffer(): void;
|
|
328
376
|
readPickingColor(x: number, y: number, outColor: NumberArray3 | Uint8Array): void;
|
|
329
377
|
readDepth(x: number, y: number, outDepth: NumberArray3 | Float32Array): void;
|
|
330
378
|
/**
|
|
@@ -351,5 +399,24 @@ declare class Renderer {
|
|
|
351
399
|
*/
|
|
352
400
|
start(): void;
|
|
353
401
|
destroy(): void;
|
|
402
|
+
/**
|
|
403
|
+
* Adds a shader program to the renderer if it has not been added yet.
|
|
404
|
+
* @public
|
|
405
|
+
* @param {ShaderProgram} program - ShaderProgram instance.
|
|
406
|
+
*/
|
|
407
|
+
addProgram(program: ShaderProgram): void;
|
|
408
|
+
/**
|
|
409
|
+
* Adds one or more programs to the renderer.
|
|
410
|
+
* Supports both individual programs and nested program arrays.
|
|
411
|
+
* @public
|
|
412
|
+
* @param {...(ShaderProgram | ShaderProgram[])} programs - ShaderProgram list.
|
|
413
|
+
*/
|
|
414
|
+
addPrograms(...programs: (ShaderProgram | ShaderProgram[])[]): void;
|
|
415
|
+
/**
|
|
416
|
+
* Alias for {@link Renderer.addPrograms}.
|
|
417
|
+
* @public
|
|
418
|
+
* @param {...(ShaderProgram | ShaderProgram[])} programs - ShaderProgram list.
|
|
419
|
+
*/
|
|
420
|
+
addShaders(...programs: (ShaderProgram | ShaderProgram[])[]): void;
|
|
354
421
|
}
|
|
355
422
|
export { Renderer };
|
|
@@ -7,13 +7,17 @@ import { Renderer } from "./Renderer";
|
|
|
7
7
|
import { PointerHandler, type PointerEventExt } from "../input/PointerHandler";
|
|
8
8
|
import { Vec2 } from "../math/Vec2";
|
|
9
9
|
import { Vec3 } from "../math/Vec3";
|
|
10
|
+
import { Ray } from "../math/Ray";
|
|
10
11
|
export type RendererEventsHandler = RendererEvents & EventsHandler<RendererEventsType>;
|
|
11
12
|
export declare function createRendererEvents(renderer: Renderer): RendererEvents;
|
|
12
13
|
export type RendererEventsType = [
|
|
13
14
|
"projchanged",
|
|
14
15
|
"changerelativecenter",
|
|
15
16
|
"draw",
|
|
16
|
-
"
|
|
17
|
+
"forwardpass",
|
|
18
|
+
"postforwardpass",
|
|
19
|
+
"transparentpass",
|
|
20
|
+
"gbufferpass",
|
|
17
21
|
"postdraw",
|
|
18
22
|
"resize",
|
|
19
23
|
"resizeend",
|
|
@@ -66,6 +70,12 @@ export interface IBaseInputState {
|
|
|
66
70
|
prev_y: number;
|
|
67
71
|
/** Screen touch position world direction. */
|
|
68
72
|
direction: Vec3;
|
|
73
|
+
/**
|
|
74
|
+
* World-space picking ray.
|
|
75
|
+
* Perspective: origin is camera.eye.
|
|
76
|
+
* Orthographic: origin is per-pixel on the view plane, direction is camera forward.
|
|
77
|
+
*/
|
|
78
|
+
ray: Ray;
|
|
69
79
|
/** Current touched(picking) object. */
|
|
70
80
|
pickingObject: any | null;
|
|
71
81
|
/** Renderer instance. */
|
|
@@ -106,9 +116,9 @@ export interface IMouseState extends IBaseInputState {
|
|
|
106
116
|
middleButtonClick: boolean;
|
|
107
117
|
/** Mouse has just stopped now. */
|
|
108
118
|
justStopped: boolean;
|
|
109
|
-
/**
|
|
119
|
+
/** Mouse double-click delay response time. */
|
|
110
120
|
doubleClickDelay: number;
|
|
111
|
-
/**
|
|
121
|
+
/** Mouse click delay response time. */
|
|
112
122
|
clickDelay: number;
|
|
113
123
|
/** Mouse wheel. */
|
|
114
124
|
wheelDelta: number;
|
|
@@ -125,9 +135,9 @@ export interface ITouchState extends IBaseInputState {
|
|
|
125
135
|
touchCancel: boolean;
|
|
126
136
|
/** Touched twice.*/
|
|
127
137
|
doubleTouch: boolean;
|
|
128
|
-
/** Double
|
|
138
|
+
/** Double-touch response delay. */
|
|
129
139
|
doubleTouchDelay: number;
|
|
130
|
-
/** Double
|
|
140
|
+
/** Double-touch response radius in screen pixels. */
|
|
131
141
|
doubleTouchRadius: number;
|
|
132
142
|
/** Currently touching.*/
|
|
133
143
|
touching: boolean;
|