bruce-cesium 7.9.4 → 7.9.6
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/bruce-cesium.es5.js +884 -134
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +877 -131
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/displaced-surface-primitive.js +699 -124
- package/dist/lib/rendering/displaced-surface-primitive.js.map +1 -1
- package/dist/lib/rendering/entity-render-engine-polygon.js +1 -0
- package/dist/lib/rendering/entity-render-engine-polygon.js.map +1 -1
- package/dist/lib/viewer/camera-controls.js +181 -6
- package/dist/lib/viewer/camera-controls.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/displaced-surface-primitive.d.ts +101 -3
- package/dist/types/viewer/camera-controls.d.ts +30 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Cesium from "cesium";
|
|
1
2
|
import { Color } from "bruce-models";
|
|
2
3
|
import { IRampStop } from "../internal/image-utils";
|
|
3
4
|
/**
|
|
@@ -68,11 +69,16 @@ export declare namespace DisplacedSurfacePrimitive {
|
|
|
68
69
|
packedValue?: boolean;
|
|
69
70
|
followGround?: boolean;
|
|
70
71
|
terrainProvider?: any;
|
|
72
|
+
groundRasterSide?: number;
|
|
71
73
|
lowColor?: Color.IColor;
|
|
72
74
|
highColor?: Color.IColor;
|
|
73
75
|
rampStops?: IRampStop[] | null;
|
|
74
76
|
groundClearance?: IGroundClearance;
|
|
75
77
|
water?: IWater | null;
|
|
78
|
+
scene?: any;
|
|
79
|
+
drape?: boolean;
|
|
80
|
+
drapeLift?: number;
|
|
81
|
+
drapeBand?: number;
|
|
76
82
|
}
|
|
77
83
|
interface IPatch {
|
|
78
84
|
u0: number;
|
|
@@ -80,6 +86,86 @@ export declare namespace DisplacedSurfacePrimitive {
|
|
|
80
86
|
v0: number;
|
|
81
87
|
v1: number;
|
|
82
88
|
}
|
|
89
|
+
export namespace GroundRaster {
|
|
90
|
+
const MIN_METRES = -1000;
|
|
91
|
+
const MAX_METRES = 9000;
|
|
92
|
+
const BLOCK_SAMPLES = 64;
|
|
93
|
+
/**
|
|
94
|
+
* Heights for positions, undefined wherever the source has none.
|
|
95
|
+
*/
|
|
96
|
+
interface ISampler {
|
|
97
|
+
coarse(positions: Cesium.Cartographic[]): Promise<(number | undefined)[]>;
|
|
98
|
+
fine(positions: Cesium.Cartographic[], box: IExtent): Promise<(number | undefined)[]>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A region of the packed raster that changed and has to be uploaded again.
|
|
102
|
+
*/
|
|
103
|
+
interface IDirty {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Raster side for a value source of the given size: a whole number of blocks, at least one, at most the cap.
|
|
111
|
+
*/
|
|
112
|
+
function SideFor(width: number, height: number): number;
|
|
113
|
+
/**
|
|
114
|
+
* Packs a height into three bytes the way the vertex shader unpacks it.
|
|
115
|
+
*/
|
|
116
|
+
function Pack(height: number, into: Uint8Array, at: number): void;
|
|
117
|
+
/**
|
|
118
|
+
* Bilinear between texel centres, the way the shader reads it.
|
|
119
|
+
*/
|
|
120
|
+
function Bilinear(heights: Float32Array, side: number, u: number, v: number): number;
|
|
121
|
+
class Raster {
|
|
122
|
+
private readonly extent;
|
|
123
|
+
private readonly sampler;
|
|
124
|
+
readonly side: number;
|
|
125
|
+
readonly pixels: Uint8Array;
|
|
126
|
+
private readonly heights;
|
|
127
|
+
private readonly blocksPerSide;
|
|
128
|
+
private readonly refined;
|
|
129
|
+
private readonly inFlight;
|
|
130
|
+
private dirty;
|
|
131
|
+
private coarseDone;
|
|
132
|
+
private coarseStarted;
|
|
133
|
+
private disposed;
|
|
134
|
+
private version;
|
|
135
|
+
constructor(extent: IExtent, side: number, sampler: ISampler);
|
|
136
|
+
Dispose(): void;
|
|
137
|
+
HasCoarse(): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Changes whenever any height changes.
|
|
140
|
+
*/
|
|
141
|
+
GetVersion(): number;
|
|
142
|
+
RefinedCount(): number;
|
|
143
|
+
InFlightCount(): number;
|
|
144
|
+
/**
|
|
145
|
+
* Metres above the ellipsoid at a normalised point, north at v zero.
|
|
146
|
+
*/
|
|
147
|
+
HeightAt(u: number, v: number): number;
|
|
148
|
+
/**
|
|
149
|
+
* The regions changed since the last call.
|
|
150
|
+
*/
|
|
151
|
+
TakeDirty(): IDirty[];
|
|
152
|
+
/**
|
|
153
|
+
* Samples the whole extent once, at the cheap level.
|
|
154
|
+
*/
|
|
155
|
+
StartCoarse(): Promise<void>;
|
|
156
|
+
Refine(eye: Cesium.Cartesian3, isVisible?: (sphere: Cesium.BoundingSphere) => boolean): number;
|
|
157
|
+
private refineBlock;
|
|
158
|
+
private grid;
|
|
159
|
+
private write;
|
|
160
|
+
private markDirty;
|
|
161
|
+
private blockMetres;
|
|
162
|
+
private blockSphere;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Drawn ground minus sampled ground: a low percentile, so roofs and canopy over a probe are ignored.
|
|
167
|
+
*/
|
|
168
|
+
export function GroundOffsetFrom(differences: number[]): number | null;
|
|
83
169
|
export class Surface {
|
|
84
170
|
show: boolean;
|
|
85
171
|
private readonly extent;
|
|
@@ -111,10 +197,19 @@ export declare namespace DisplacedSurfacePrimitive {
|
|
|
111
197
|
private lastSelectionMs;
|
|
112
198
|
private selectionDirty;
|
|
113
199
|
private readonly followGround;
|
|
200
|
+
private readonly groundRasterSide;
|
|
201
|
+
private groundRaster;
|
|
202
|
+
private groundTextureSide;
|
|
203
|
+
private readonly scene;
|
|
204
|
+
private readonly drape;
|
|
205
|
+
private readonly drapeLift;
|
|
206
|
+
private readonly drapeBand;
|
|
207
|
+
private drapeActive;
|
|
208
|
+
private groundOffset;
|
|
209
|
+
private offsetProbe;
|
|
210
|
+
private drapeFrame;
|
|
114
211
|
private terrainProvider;
|
|
115
212
|
private groundTexture;
|
|
116
|
-
private groundPixels;
|
|
117
|
-
private groundRequested;
|
|
118
213
|
private groundClearance;
|
|
119
214
|
private maskTexture;
|
|
120
215
|
private maskPixels;
|
|
@@ -177,7 +272,8 @@ export declare namespace DisplacedSurfacePrimitive {
|
|
|
177
272
|
* The ramp the sheet is painted with, as 256 RGBA steps across the value range.
|
|
178
273
|
*/
|
|
179
274
|
GetRampPixels(): Uint8Array;
|
|
180
|
-
private
|
|
275
|
+
private hasGround;
|
|
276
|
+
private dropGroundRaster;
|
|
181
277
|
/**
|
|
182
278
|
* Feeds the surface from an animated frame series.
|
|
183
279
|
* Height and colour advance with the clock without the caller having to push each frame in.
|
|
@@ -190,6 +286,8 @@ export declare namespace DisplacedSurfacePrimitive {
|
|
|
190
286
|
update(frameState: any): void;
|
|
191
287
|
isDestroyed(): boolean;
|
|
192
288
|
destroy(): any;
|
|
289
|
+
private updateDrapeFrame;
|
|
290
|
+
private probeGroundOffset;
|
|
193
291
|
private requestGround;
|
|
194
292
|
private requestMaskGround;
|
|
195
293
|
private syncMaskTextures;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import * as Cesium from "cesium";
|
|
2
|
+
/**
|
|
3
|
+
* Which mouse buttons pan, orbit and zoom: CesiumJS's own, or a familiar desktop 3D app's.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ECameraMouseScheme {
|
|
6
|
+
Default = "default",
|
|
7
|
+
Autodesk = "autodesk",
|
|
8
|
+
SketchUp = "sketchup"
|
|
9
|
+
}
|
|
2
10
|
type TTargetSource = "pick" | "plane" | "last";
|
|
3
11
|
interface ITarget {
|
|
4
12
|
point: Cesium.Cartesian3;
|
|
@@ -20,10 +28,32 @@ export declare namespace CameraControls {
|
|
|
20
28
|
*/
|
|
21
29
|
function Detach(viewer: Cesium.Viewer): void;
|
|
22
30
|
function IsAttached(viewer: Cesium.Viewer): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Picks which mouse buttons pan, orbit and zoom, here and for CesiumJS's controller above the hand-over height.
|
|
33
|
+
*/
|
|
34
|
+
function SetMouseScheme(viewer: Cesium.Viewer, scheme: ECameraMouseScheme): void;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the scheme for every viewer without its own, such as the app user's preference; viewers follow next frame.
|
|
37
|
+
*/
|
|
38
|
+
function SetMouseSchemeDefault(scheme: ECameraMouseScheme): void;
|
|
39
|
+
function GetMouseScheme(viewer: Cesium.Viewer): ECameraMouseScheme;
|
|
40
|
+
/**
|
|
41
|
+
* Makes wheel forward zoom out instead of in, for these controls and CesiumJS's controller alike.
|
|
42
|
+
*/
|
|
43
|
+
function SetMouseWheelReversed(viewer: Cesium.Viewer, reversed: boolean): void;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the wheel direction for every viewer without its own, such as the app user's preference.
|
|
46
|
+
*/
|
|
47
|
+
function SetMouseWheelReversedDefault(reversed: boolean): void;
|
|
48
|
+
function GetMouseWheelReversed(viewer: Cesium.Viewer): boolean;
|
|
23
49
|
/**
|
|
24
50
|
* Marks a tileset as standing in for the globe (Google's photorealistic tiles), so the camera treats it as ground.
|
|
25
51
|
*/
|
|
26
52
|
function SetGroundTileset(tileset: Cesium.Cesium3DTileset, isGround: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* Whether a tileset was marked as standing in for the globe.
|
|
55
|
+
*/
|
|
56
|
+
function IsGroundTileset(tileset: any): boolean;
|
|
27
57
|
/**
|
|
28
58
|
* Says whether the scene has data underground, which makes the ground easier to push through; null scans for it.
|
|
29
59
|
*/
|