-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Entities on terrain #3903
Merged
Merged
Entities on terrain #3903
Changes from all commits
Commits
Show all changes
103 commits
Select commit
Hold shift + click to select a range
5efbaea
Initial support for Entity billboard/label clamping.
mramato 48eccdf
CZML support for billboard/label height reference.
mramato 87e405a
Merge remote-tracking branch 'origin/billboard-clamp-to-ground' into …
mramato 9bd9185
Fix Visualizer bounding sphere computation for billboards and labels.
mramato e8bf33e
Merge remote-tracking branch 'origin/billboard-clamp-to-ground' into …
mramato d258e3c
Merge remote-tracking branch 'origin/master' into entity-clamp-to-ground
mramato 216dac4
Merge remote-tracking branch 'origin/master' into entity-clamp-to-ground
mramato 61a0bce
Merge remote-tracking branch 'origin/master' into entity-clamp-to-ground
mramato af20762
Started working on it.
1f904a1
Merge remote-tracking branch 'origin/master' into entity-clamp-to-ground
mramato fb299a2
Merge branch 'master' into kml-terrain-primitives
ddb1143
Still can't the rectangle to show up on terrain.
0cfa82c
Got rectangle geometries on terrain to work.
50d4f87
Added option for geojson on terrain that uses corridors instead of po…
ebe1fe8
Some tweaks from PR review.
bb40182
Added Polygon & Corridor
07b0778
Made onTerrain and option because we don't want to always create grou…
e57c8ab
Merge remote-tracking branch 'origin/master' into entity-clamp-to-ground
mramato 614c165
Merge remote-tracking branch 'agi/entity-clamp-to-ground' into entity…
d3458a8
Added terrain option to geojson and hooked it up.
a6c3af6
Merge remote-tracking branch 'agi/ground-primitive-batch' into entity…
2ea7698
Added StaticGroundGeometryColorBatch.
f00122f
Added oneTimeWarning function to display issues that may happen alot …
9645d33
Added support for geojson on terrain.
beadf48
Merge remote-tracking branch 'agi/master' into entity-terrain
daa04b9
Updated tests to work with changes and added new ones that make sure …
22c92ff
Fixed ground primitives to actually batch by color.
7b4de17
Fixed all billboard and label tests.
ec49f06
Added tests to make sure we remove batches when colors change.
b736018
Tweak.
6aa13c5
Merge branch 'master' into entity-terrain
bf9dbee
Removed comma.
5c138c7
sorted requires.
d59b0e6
Merge branch 'master' into entity-terrain
459d66a
Fixed unneeded assignment.
759627c
Merge branch 'master' into entity-terrain
489274d
Merge remote-tracking branch 'origin/master' into tfili-entity-terrain
mramato 5cd1ff7
Merge branch 'master' into entity-terrain
c28c9c2
Added a check to make sure GroundPrimitives are supported before we u…
eea17e0
Merge branch 'master' into entity-terrain
10881bd
Merge branch 'master' into entity-terrain
3d6f1d8
Merge branch 'master' into entity-terrain
75c7e43
Got bounding volume pretty much corrrect based on low res terrain jso…
c258b8e
Merged in master
267f0fd
Merge branch 'master' into entity-terrain
afdb8c2
A little hackiness to do some testing. Need to remove the GroundPrimi…
fbc7218
Compute correct terrain height in the correct place. We were generati…
6949be9
Merge branch 'master' into entity-terrain
407867f
More tweaking for getting entities on terrain to work with all geomet…
ab02243
Added first changes for point entities on terrain.
723f313
Got points working on terrain. Still need tests.
9eddbaf
Merged master
6be09c8
Added model entities on terrain.
8e5c1f2
Merge branch 'master' into entity-terrain
9f1fac8
Merge branch 'entity-terrain' into entity-terrain-models
96434ae
Added getRectangle for ellipse and fixed them for polygon and rectangle.
59fadac
Added Corridor getRectangle method. Still need to handle different co…
8d5e199
we were using the incorrect caps for non-rounded corridors.
4522a14
Fixed all the geometry tests.
c864de5
Fixed unit tests.
2e0afad
Merge pull request #3954 from AnalyticalGraphicsInc/entity-terrain-mo…
mramato bc215c8
Merged master
1da9eba
Tweaks from PR comments.
d283972
AddMore tweaks from PR comments.
b481155
Added loading of terrain heights to GroundPrimitives.
606f3cb
Fixed all failing tests.
bc241b0
Added polygon tests.
3706e02
More tests.
f6c1744
Doc update.
eb66261
Merge branch 'master' into entity-terrain
921d682
Added tests for Corridor, Polygon and Rectangle geometries rectangle …
9fb69b7
Added tests for ellipse and circle geometries' rectangle property.
8dc5e2a
Doc fix.
6ac6f46
Fix label vertical origin.
1041d61
Fixing labels.
af622bd
Labels not on terrain now work as expected.
5b22186
Fixed unit tests.
77148b1
Fixed labeling issues.
b4264e0
Fixed PolygonGeometry test and did some cleanup.
fcec7ef
Made polygon geometry smaller to help with precision issues.
003bedf
Fixed test names.
02a3fe8
Added Rectangle.fromCartesianArray and changed deprecationWarning to …
0abefa3
More tweaks from PR comments.
8e6dbcc
Merged master
2add81d
Added more unit tests to fill in coverage holes.
1dc55f7
Formatting fix.
4ce37f3
Computed correct min height.
34ddabb
Fixed bounding volume for GroundPrimitives.
f1bd7cb
Removed typo.
26feae0
Fixed jshint error and more tweaks from PR comments.
f5aaf12
PR comment changes and sandcastle example. Also updated CHANGES.md
1e26eab
Merged master
51ae791
Fixed issue where clampedMatrix may not be defined.
4d7174c
More fixes from PR comments.
bf8af67
Fixed error where destroyed objects were still registered for events.
fd816f5
Fixed issues with really slow labels.
59979bd
Fixed unit tests.
bc18491
More PR fixes.
a0b9639
Merged master
b14bee0
Sped up deleting of custom data from a QuadtreeTile.
56914bd
Merge pull request #4045 from AnalyticalGraphicsInc/entity-terrain-sl…
mramato 1a9fbc6
Added KML opt-in
85b366f
Updated CHANGES.md and some other doc.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
<meta name="description" content="Clamp primitives to the terrain."> | ||
<meta name="cesium-sandcastle-labels" content="Tutorials, Showcases"> | ||
<title>Cesium Demo</title> | ||
<script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
<script type="text/javascript"> | ||
require.config({ | ||
baseUrl : '../../../Source', | ||
waitSeconds : 60 | ||
}); | ||
</script> | ||
</head> | ||
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
<style> | ||
@import url(../templates/bucket.css); | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
<div id="toolbar"> | ||
<div id="terrainMenu"></div> | ||
<div id="zoomButtons"></div> | ||
<div id="toggleLighting"></div> | ||
<div id="sampleButtons"></div> | ||
</div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
'use strict'; | ||
//Sandcastle_Begin | ||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({ | ||
url : 'https://assets.agi.com/stk-terrain/world', | ||
requestWaterMask : true, | ||
requestVertexNormals : true | ||
}); | ||
viewer.terrainProvider = cesiumTerrainProviderMeshes; | ||
|
||
Sandcastle.addDefaultToolbarMenu([{ | ||
// | ||
// To clamp points or billboards set the heightReference to CLAMP_TO_GROUND or RELATIVE_TO_GROUND | ||
// | ||
text : 'Draw Points', | ||
onselect : function() { | ||
var e = viewer.entities.add({ | ||
position : Cesium.Cartesian3.fromDegrees(-122.1958, 46.1915), | ||
point : { | ||
color : Cesium.Color.SKYBLUE, | ||
pixelSize : 10, | ||
outlineColor : Cesium.Color.YELLOW, | ||
outlineWidth : 3, | ||
heightReference : Cesium.HeightReference.CLAMP_TO_GROUND | ||
} | ||
}); | ||
|
||
viewer.trackedEntity = e; | ||
} | ||
}, { | ||
text : 'Draw Billboard', | ||
onselect : function() { | ||
var e = viewer.entities.add({ | ||
position : Cesium.Cartesian3.fromDegrees(-122.1958, 46.1915), | ||
billboard : { | ||
image : '../images/facility.gif', | ||
heightReference : Cesium.HeightReference.CLAMP_TO_GROUND | ||
} | ||
}); | ||
|
||
viewer.trackedEntity = e; | ||
} | ||
}, { | ||
// | ||
// Corridors, polygons and rectangles will be clamped automatically if they are filled with a constant color and | ||
// has no height or extruded height. | ||
// NOTE: Setting height to 0 will disable clamping. | ||
// | ||
text : 'Draw Corridor', | ||
onselect : function() { | ||
var e = viewer.entities.add({ | ||
corridor : { | ||
positions : Cesium.Cartesian3.fromDegreesArray([ | ||
-122.19, 46.1914, | ||
-122.21, 46.21, | ||
-122.23, 46.21 | ||
]), | ||
width : 2000.0, | ||
material : Cesium.Color.GREEN.withAlpha(0.5) | ||
} | ||
}); | ||
|
||
viewer.trackedEntity = e; | ||
} | ||
}, { | ||
text : 'Draw Polygon', | ||
onselect : function() { | ||
var e = viewer.entities.add({ | ||
polygon : { | ||
hierarchy : { | ||
positions : [new Cesium.Cartesian3(-2358138.847340281, -3744072.459541374, 4581158.5714175375), | ||
new Cesium.Cartesian3(-2357231.4925370603, -3745103.7886602185, 4580702.9757762635), | ||
new Cesium.Cartesian3(-2355912.902205431, -3744249.029778454, 4582402.154378103), | ||
new Cesium.Cartesian3(-2357208.0209552636, -3743553.4420488174, 4581961.863286629)] | ||
}, | ||
material : Cesium.Color.BLUE.withAlpha(0.5) | ||
} | ||
}); | ||
|
||
viewer.trackedEntity = e; | ||
} | ||
}, { | ||
text : 'Draw Rectangle', | ||
onselect : function() { | ||
var e = viewer.entities.add({ | ||
rectangle : { | ||
coordinates : Cesium.Rectangle.fromDegrees(-122.3, 46.0, -122.0, 46.3), | ||
material : Cesium.Color.RED.withAlpha(0.5) | ||
} | ||
}); | ||
|
||
viewer.trackedEntity = e; | ||
} | ||
}], 'zoomButtons'); | ||
|
||
Sandcastle.reset = function () { | ||
viewer.entities.removeAll(); | ||
}; | ||
|
||
//Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throughout, this is probably better named
boundingRectangle
. At first, I was confused, for example, why a circle returns a rectangle.The
bounding
prefix is also used throughout the graphics code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I started doing this and there was some name collisions. Throughout Cesium
boundingRectangle
is used to mean a rectanglular volume in Cartesian space, whileRectangle
is a lat/lon rectangle which is what this property is. I think making itboundingRectangle
would be more confusing, don't you?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, OK. This name isn't great, but perhaps the lesser of two evils.