-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Improve viewer camera #236
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
Conversation
…cross all scene modes.
…work on DynamicObjectView, though its currently a mess.
1. Make lookAt query parameter work again in Viewer 2. Fix several crashes in DynamicObjectView 3. Fix crash in BoundingRectangle and make BoundingSphere work the same way.
Conflicts: Source/Core/BoundingRectangle.js Specs/Core/BoundingRectangleSpec.js Specs/Core/BoundingSphereSpec.js
…template, since all 3 are required, a template doesn't make sense.
Conflicts: Source/Widgets/Dojo/CesiumViewerWidget.js
…sform after translating.
I'm able to right-click anywhere on the globe with pretty strange results. |
I can zoom in/out when viewing the facility, but not when viewing the satellites. |
The Home View button restores a 2D view to 3D. I believe it always did that. Is that the right behavior? I would expect it to change views, but not scene modes. |
This is in simple.czml. It's odd though - sometimes I can zoom, but usually I can't. |
I'm not sure about this property. What is the long-term plan? East-north-up is a decent default, but it is not going to work in many air and space situations, when we really want the object's body frame. Is there a longer-term plan to be able to overview east-north-up? |
@@ -63,6 +63,24 @@ define([ | |||
throw new DeveloperError('projection is required.'); | |||
} | |||
|
|||
/** | |||
* If true, allows the user to pan around the map. If false, the camera stays locked at the current 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.
I'm confused - is this enableTranslate
or enablePan
. Panning is more than translating, right?
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.
Two me they mean the same thing (in 2D) but I could be wrong. I can change the wording but can you explain the difference to me?
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.
Oh right, this is only on the 2D controller. Translate and pan are the same here.
@shunter want to look at the DynamicScene changes? |
up = arguments[2]; | ||
} else { | ||
return; | ||
Camera.prototype.lookAt = function(eye, target, 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.
Good change. I looked at this function pretty recently, and thought we should get right of using arguments
. This is very early code.
Not that I'm the right person to ask, but the scene-level camera changes are OK with me. There's a bunch of allocations in new code. Is the plan to remove them now or later? |
I plan on replacing |
Can you elaborate on "strange results" One right-click should track and the other should stop tracking. |
When it stops tracking, the user is left in the object's old frame - doesn't seem useful. |
Zoom is so common that it is going to require a shortcut like double-click or double-tap. A context menu will be nice for listing tasks, but we also need to optimize for the common case. Right click is like a secret handshake; the only people that know to do it are the people that were told. I'm pretty sure @kring just hacked it in for a demo. |
Zooming in and out for satellites works for me, of course if I'm really close it takes a while to zoom out. |
Good call on the home button, I've been meaning to change it. I'll update it now. |
The |
Hmm. Perhaps it was the speed because I can't reproduce it now, but it really seemed like it was locked, not just slow to start. I'll let you know if I come across it again. |
|
Assuming I didn't miss anything, this is ready for another round of review. |
These changes are good with me. @shunter want to look at the DynamicScene code changes and merge? |
@@ -226,7 +226,7 @@ define([ | |||
billboard.setShow(true); | |||
|
|||
position = positionProperty.getValueCartesian(time, position); | |||
if (position !== 'undefined') { | |||
if (typeof position !== 'undefined') { |
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.
I did a grep and found a similar mistake in DynamicBillboardVisualizer. Want to fix that too?
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.
Done. I've been meaning to write a general regex to find these, did you have one, or did you just do a simple search and happen to find it?
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.
Not a single regex, but: grep -r "'undefined'" Source/ | grep -v typeof
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.
I should mention that there's still a similar mistake in CentralBody, but all that's changing anyway soon so it's not worth bothering with.
Looks good. |
The Viewer widget has a simple tracking capability which tracks an object when you right-click on it. This only worked in 3D mode and has been recently broken. I created a new utility object,
DynamicObjectView
which makes it easy to track an object across scene modes.viewFrom
property to CZML which is an east-north-up Cartesian that gives the client a recommended camera position when zooming to the object.This whole process has also exposed many issues with our current camera API that will be addressed in future pull requests,
DynamicObjectView
is a little overly complicated because of this and unit tests for the new object is light for now.