-
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
Add configurable eye separation and focal length for VR #5917
Conversation
@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time. I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to I am a bot who helps you make Cesium awesome! Thanks again. |
Fixes #3909. |
Looks good. |
@@ -653,6 +653,18 @@ define([ | |||
this._actualInvertClassificationColor = Color.clone(this._invertClassificationColor); | |||
this._invertClassification = new InvertClassification(); | |||
|
|||
/** | |||
* The focal length for use when with cardboard or WebVR. |
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.
Please add the units and the default value.
this.focalLength = undefined; | ||
|
||
/** | ||
* The eye separation distance in meters for use with cardboard or WebVR. |
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.
Add the default value.
@@ -2282,8 +2294,8 @@ define([ | |||
var savedCamera = Camera.clone(camera, scene._cameraVR); | |||
|
|||
var near = camera.frustum.near; | |||
var fo = near * 5.0; | |||
var eyeSeparation = fo / 30.0; | |||
var fo = near * defaultValue(scene.focalLength, 5.0); |
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.
Are you sure this should be done here and not at initialization like Cesium does everywhere else? Is it valid to set this back to undefined
?
Is it possible to add reasonable unit tests? |
Adds
Scene.eyeSeparation
andScene.focalLength
properties to configure VR settings.