-
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
Fix models in 2D near the IDL. #3936
Conversation
Can we add a this for this? Are you writing tests in this branch or |
var nodeCommand = { | ||
show : true, | ||
boundingSphere : boundingSphere, | ||
command : command, | ||
pickCommand : pickCommand | ||
pickCommand : pickCommand, |
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.
Does picking work for models crossing the IDL?
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.
So picking works across the IDL even though there is only one pick command?
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.
Never mind, I see.
Just those comments. |
I added tests in |
Using this code in Sandcastle: var viewer = new Cesium.Viewer('cesiumContainer', {
infoBox : false,
selectionIndicator : false
});
function createModel(url, height) {
viewer.entities.removeAll();
var position = Cesium.Cartesian3.fromDegrees(-179.0744619, 44.0503706, height);
var heading = Cesium.Math.toRadians(135);
var pitch = 0;
var roll = 0;
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, heading, pitch, roll);
var entity = viewer.entities.add({
name : url,
position : position,
orientation : orientation,
model : {
uri : url,
minimumPixelSize : 128,
//maximumScale : 20000
}
});
viewer.trackedEntity = entity;
}
var options = [{
text : 'Aircraft',
onselect : function() {
createModel('../../SampleData/models/CesiumAir/Cesium_Air.glb', 5000.0);
}
}, {
text : 'Ground vehicle',
onselect : function() {
createModel('../../SampleData/models/CesiumGround/Cesium_Ground.glb', 0);
}
}, {
text : 'Milk truck',
onselect : function() {
createModel('../../SampleData/models/CesiumMilkTruck/CesiumMilkTruck-kmc.glb', 0);
}
}, {
text : 'Skinned character',
onselect : function() {
createModel('../../SampleData/models/CesiumMan/Cesium_Man.glb', 0);
}
}];
Sandcastle.addToolbarMenu(options); Switch to 2D, zoom in a bit, then pan to the left. The model changes orientation and then Cesium throws an exception (only got the exception once though). |
@pjcozzi This is ready for another look. |
JSHint fails in CI:
|
Just got this again when panning left to right (back and forth a few times) in 2D using the above code. |
@pjcozzi I can reproduce that error consistently now after talking offline. The problem is in master as well. It happens when the camera lines up with the IDL. I'm working on a fix but it doesn't need to hold up this PR. |
This is ready since #3953 was merged. |
Adds another command to each node (when not
scene3DOnly
). Updates that command to position it on the opposite side of the map. Adds the command only if the bounding sphere intersects the IDL.