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 new buttons for Sandcastle-Camera #8939

Merged
merged 3 commits into from
Jun 12, 2020
Merged
Changes from all commits
Commits
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
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