-
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
change widget home button to use camera flights #803
Conversation
@@ -120,12 +123,14 @@ define(['../createCommand', | |||
*/ | |||
this.transitioner = transitioner; | |||
|
|||
this.flightDuration = flightDuration; |
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.
This should be an observable knockout.observable(flightDuration)
. It also needs doc, something like "Gets an Observable whose value is the duration in milliseconds of the flight to home position."
@mramato better? |
The camera flight has some weirdness. From the home position, spin the globe to the opposite side, looking at India, and zoom in about 50%. Then click the home button. The globe actually leaves the screen and comes back. I'm pretty sure it's @bagnell's code doing this (sorry Dan!) so if needed this could be moved to a separate issue. |
@@ -121,11 +124,16 @@ define(['../createCommand', | |||
this.transitioner = transitioner; | |||
|
|||
/** | |||
* Gets an Observable whose value is the duration in milliseconds of the flight to home position. | |||
*/ |
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.
Needs @type Observable
I'm OK with this being merged before the above three are fixed. Is there some mechanism to disable flights for users that don't want them? |
Settings flightDuration to 0 should do that, but we should make sure it works as expected. |
This is awesome, but I did find one more problem. Load simple.czml and click on the facility. When you hit home, it stays locked onto the facility even though it returns to the home position. I don't believe this happens in master. I think the transforms are no longer being set properly. We need to make sure this works for each scene mode. |
* The command for switching to home view. | ||
* @type Command | ||
*/ | ||
this.command = createCommand(function() { | ||
viewHome(that.scene, that.ellipsoid, that.transitioner); | ||
viewHome(that.scene, that.ellipsoid, that.transitioner, that.flightDuration); |
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.
Instead of that.flightDuration, pass in that.flightDuration()
so that the viewHome just deals with the raw value and not the observable.
@mramato when duration is 0, nothing happens. and good catch with the transforms thing. Do you think these changes should be made in CameraFlightPath or just for the home button? I was thinking CameraFlightPath because I feel like this should be default behavior for all camera flights. |
Probably a question for @bagnell but I think the answer is the home button, unless the CameraFlightPath stuff is earth specific. Dan? |
@bagnell can you take a look at the changes I made to |
@bagnell don't forget to look at this. |
var newOnComplete = function() { | ||
var position = destination; | ||
if (frameState.mode === SceneMode.SCENE3D) { | ||
dirScratch = defaultValue(description.direction, position.negate(dirScratch).normalize(dirScratch)); |
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.
You should only do this if both direction
and up
are undefined
. Otherwise, just compute right
as direction.cross(up)
.
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.
Compute the direction in the if
below when its undefined
and just use description.direction
in the else
block.
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.
Same comment for up
. The reason to do this is that the arguments to defaultValue
will be evaluated when its called.
@hpinkos Looks good to me. I just had some comments about computing the camera orientation. |
Conflicts: Source/Widgets/HomeButton/HomeButton.js Source/Widgets/HomeButton/HomeButtonViewModel.js
Thanks @bagnell, I finally got the 2D check for same camera positino to work. Is there anything else I need to change? |
} | ||
upScratch = defaultValue(description.up, rightScratch.cross(dirScratch, upScratch)); | ||
} else { | ||
dirScratch = defaultValue(description.direction, Cartesian3.UNIT_Z.negate(dirScratch)); |
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.
Same comment.
@bagnell anything else? |
@bagnell I'm in a meeting all day, you can go ahead and merge this if you're happy with it. |
Merging. |
change widget home button to use camera flights
No description provided.