Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clamped vector polylines #9398

Merged
merged 24 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
071a6a8
add diff files
ebogo1 Mar 1, 2021
a2ac850
renaming, remove unused property
ebogo1 Mar 3, 2021
d16882a
add experimental option to constructor
ebogo1 Mar 3, 2021
58b5789
add missing line
ebogo1 Mar 3, 2021
e07921d
improve docs
ebogo1 Mar 3, 2021
0351120
Premultiplied alpha to fix colors for globe translucency
lilleyse Mar 4, 2021
a7b1859
minor fixes
ebogo1 Mar 5, 2021
902f668
add classificationType changes
ebogo1 Mar 8, 2021
4668ca6
add back Cesium3DTileset properties
ebogo1 Mar 9, 2021
0133ec3
Merge branch 'master' into clamp-vector-tiles
lilleyse Mar 9, 2021
1ac71d1
Revert "Premultiplied alpha to fix colors for globe translucency"
lilleyse Mar 9, 2021
7ada1a7
Premultiplied alpha to fix colors for globe translucency
lilleyse Mar 9, 2021
9849b6c
first pass of specs
ebogo1 Mar 10, 2021
2794dbc
Merge branch 'clamp-vector-tiles' of github.com:CesiumGS/cesium into …
ebogo1 Mar 10, 2021
6e4d7ef
clamped polyline specs
ebogo1 Mar 11, 2021
da38f78
fix clamped vector polylines not drawing when camera is inside volume…
likangning93 Mar 12, 2021
6602501
use bounding volume that covers whole shadow volume for draw commands…
likangning93 Mar 12, 2021
6245716
fix specs
ebogo1 Mar 12, 2021
eef86b4
remove unused test tileset
ebogo1 Mar 12, 2021
6b90864
remove files from last commit
ebogo1 Mar 12, 2021
418c96a
Merge branch 'master' into clamp-vector-tiles
lilleyse Mar 12, 2021
2fcc409
Renamed noClassificationModels to vectorClassificationOnly
lilleyse Mar 12, 2021
4fd49c5
Remove tileset.minimumMaximumVectorHeights
lilleyse Mar 12, 2021
2736e09
Attempt to add @experimental tag to examineVectorLinesFunction
lilleyse Mar 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Source/Core/decodeVectorPolylinePositions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import AttributeCompression from "./AttributeCompression.js";
import Cartesian3 from "./Cartesian3.js";
import Cartographic from "./Cartographic.js";
import CesiumMath from "./Math.js";

var maxShort = 32767;

var scratchBVCartographic = new Cartographic();
var scratchEncodedPosition = new Cartesian3();

function decodeVectorPolylinePositions(
positions,
rectangle,
minimumHeight,
maximumHeight,
ellipsoid
) {
var positionsLength = positions.length / 3;
var uBuffer = positions.subarray(0, positionsLength);
var vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
var heightBuffer = positions.subarray(
2 * positionsLength,
3 * positionsLength
);
AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);

var decoded = new Float64Array(positions.length);
for (var i = 0; i < positionsLength; ++i) {
var u = uBuffer[i];
var v = vBuffer[i];
var h = heightBuffer[i];

var lon = CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);
var lat = CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);
var alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);

var cartographic = Cartographic.fromRadians(
lon,
lat,
alt,
scratchBVCartographic
);
var decodedPosition = ellipsoid.cartographicToCartesian(
cartographic,
scratchEncodedPosition
);
Cartesian3.pack(decodedPosition, decoded, i * 3);
}
return decoded;
}
export default decodeVectorPolylinePositions;
21 changes: 21 additions & 0 deletions Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,13 @@ function Cesium3DTileset(options) {
*/
this.debugShowUrl = defaultValue(options.debugShowUrl, false);

/**
* Function for examining vector lines as they are being streamed.
*
* @private
*/
this.examineVectorLinesFunction = undefined;
lilleyse marked this conversation as resolved.
Show resolved Hide resolved

var that = this;
var resource;
when(options.url)
Expand Down Expand Up @@ -1654,6 +1661,20 @@ Object.defineProperties(Cesium3DTileset.prototype, {
Cartesian2.clone(value, this._imageBasedLightingFactor);
},
},

/**
* Minimum and maximum heights that vector tiles clamped to surfaces will clamp to.
*
* @memberof Cesium3DTileset.prototype
*
* @type {Cartesian2}
* @default undefined
*/
minimumMaximumVectorHeights: {
get: function () {
return this._minimumMaximumVectorHeights;
},
},
lilleyse marked this conversation as resolved.
Show resolved Hide resolved
});

/**
Expand Down
Loading