Skip to content

Commit

Permalink
Merge pull request #8939 from SambaLim/feature-SandBox-Camera
Browse files Browse the repository at this point in the history
Add new buttons for Sandcastle-Camera
  • Loading branch information
IanLilleyT authored Jun 12, 2020
2 parents 3506d49 + 49fb164 commit a23f6e1
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions Apps/Sandcastle/gallery/Camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,97 +337,118 @@
{
text: "Fly in a city",
onselect: function () {
reset();
flyInACity();
Sandcastle.highlight(flyInACity);
},
},
{
text: "Fly to San Diego",
onselect: function () {
reset();
flyToSanDiego();
Sandcastle.highlight(flyToSanDiego);
},
},
{
text: "Fly to Location with heading, pitch and roll",
onselect: function () {
reset();
flyToHeadingPitchRoll();
Sandcastle.highlight(flyToHeadingPitchRoll);
},
},
{
text: "Fly to My Location",
onselect: function () {
reset();
flyToLocation();
Sandcastle.highlight(flyToLocation);
},
},
{
text: "Fly to Rectangle",
onselect: function () {
reset();
flyToRectangle();
Sandcastle.highlight(flyToRectangle);
},
},
{
text: "View a Rectangle",
onselect: function () {
reset();
viewRectangle();
Sandcastle.highlight(viewRectangle);
},
},
{
text: "Set camera reference frame",
onselect: function () {
reset();
setReferenceFrame();
Sandcastle.highlight(setReferenceFrame);
},
},
{
text: "Set camera with heading, pitch, and roll",
onselect: function () {
reset();
setHeadingPitchRoll();
Sandcastle.highlight(setHeadingPitchRoll);
},
},
{
text: "View in ICRF",
onselect: function () {
reset();
viewInICRF();
Sandcastle.highlight(viewInICRF);
},
},
{
text: "Move events",
onselect: function () {
reset();
cameraEvents();
Sandcastle.highlight(cameraEvents);
},
},
{
text: "Camera changed event",
onselect: function () {
reset();
cameraChanges();
Sandcastle.highlight(cameraChanges);
},
},
{
text: "Fly from Los Angeles to Tokyo via Europe",
onselect: function () {
reset();
flyOverLongitude();
Sandcastle.highlight(flyOverLongitude);
},
},
{
text: "Look down during exaggerated flight",
onselect: function () {
reset();
flyOverLongitudeWithPitch();
Sandcastle.highlight(flyOverLongitudeWithPitch);
},
},
]);

Sandcastle.reset = function () {
Sandcastle.addToolbarButton("Complete Flight", function () {
scene.camera.completeFlight();
});

Sandcastle.addToolbarButton("Cancel Flight", function () {
scene.camera.cancelFlight();
});

function reset() {
scene.completeMorph();
viewer.entities.removeAll();
scene.primitives.remove(referenceFramePrimitive);
Expand Down Expand Up @@ -455,10 +476,10 @@
clock.multiplier = 1.0;
scene.postUpdate.removeEventListener(icrf);
scene.globe.enableLighting = false;
};
}

scene.morphComplete.addEventListener(function () {
Sandcastle.reset();
reset();
});
//Sandcastle_End
Sandcastle.finishedLoading();
Expand Down

0 comments on commit a23f6e1

Please sign in to comment.