-
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
Distance display conditions #4309
Conversation
…anceAttribute tests.
I haven't really looked at this yet, but to go along with |
JSHint warnings: https://travis-ci.org/AnalyticalGraphicsInc/cesium/builds/158843026
|
@@ -3719,7 +3721,8 @@ define([ | |||
} | |||
} | |||
|
|||
var show = this.show && (this.scale !== 0.0); | |||
var displayConditionPassed = defined(this.distanceDisplayCondition) ? this.distanceDisplayCondition.isVisible(this, frameState) : true; | |||
var show = this.show && (this.scale !== 0.0) && displayConditionPassed; |
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.
Perhaps slightly faster in the reject case (and the same speed in the accept) to do
this.show && displayConditionPassed && (this.scale !== 0.0)
We could if we were sure we'll never add another display condition like pixel size, viewer altitude, etc. since those would want to be named |
Just those comments. This is looking good despite all the vertex data required. |
'void main() \n' + | ||
'{ \n' + | ||
' czm_non_distanceDisplayCondition_main(); \n' + | ||
' vec4 centerRTE = czm_computeBoundingSphereCenter(); \n' + |
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.
Where is this function? Did you forget to submit a file?
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.
Nope, its generated just like czm_computePosition
for all other geometries and the functions for getting adjacent points for polylines.
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 don't see it in a repo search or this diff.
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.
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.
Ah, yes, thanks!
Part of #758. Perhaps even close that and let the KML region support stay as part of the KML roadmap. |
…s, and labels clone the set display condition.
…olylines and paths.
This requires the batch table from #4328, so please review and merge that PR before this one. |
@pjcozzi The reference doc is ready. |
Are you sure that we don't want |
Just those comments. |
It is part of the constructors. The doc was missing for |
All good with me. @mramato please merge when ready. The changes to the entity layer are minor. |
}, | ||
set : function(value) { | ||
this._near = value; | ||
this._near2 = value * value; |
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.
Nitpicky, but as a generate practice, we would normally call this nearSquared
.
* @param {DistanceDisplayCondition} [result] The result onto which to store the result. | ||
* @return {DistanceDisplayCondition} The duplicated instance. | ||
*/ | ||
DistanceDisplayCondition.clone = function(value, result) { |
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.
Since this is used directly by the Entity api as well, it should have a prototype clone too. Right now the Entity API ends up making a new instance every time get value is called because no prototype clone is defined.
Point & Model does not seem to work at all in 2D or Columbus View. |
Actually, I wasn't zoomed in enough. It appears to partially work but the model is never drawn. |
This may be in master too, so create an issue if it's not related to this branch.
|
@@ -649,7 +679,8 @@ define([ | |||
modelMatrix : !in3D ? modelMatrix : undefined, | |||
attributes : { | |||
show : new ShowGeometryInstanceAttribute(showOutline), | |||
color : ColorGeometryInstanceAttribute.fromColor(outlineColor) | |||
color : ColorGeometryInstanceAttribute.fromColor(outlineColor), | |||
distanceDisplayCondition : distanceDisplayConditionAttribute |
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 needs to be handled in the else path as well, just like show and color.
It doesn't look like any of the For the above, a corresponding test needs to be added to the Basically, it looks like dynamic geometry never gets its display condition updated. |
That's all I have for now. Thanks @bagnell |
Models in 2D crash in master so I'll open an issue for it. In this branch the same weird morph happens for the model example. |
All the dynamic geometries do update the distance display condition. It was only missing from that else block you mentioned above.
I didn't modify the test because it doesn't change any per-instance attributes besides show. Then, it makes sure that a primitive is created when true. @mramato This is ready for another look. I'll add an issue for the model crash in 2D. |
|
@mramato The test is fixed. It wasn't updated with the other tests that were failing in master. |
👍 |
Adds distance display conditions to primitives.
For billboards, points and models, there is a new
distanceDisplayCondition
property. ForPrimitive
s, there is a newdistanceDisplayCondition
per-instance geometry attribute.TODO:
PolylineCollection
.CHANGES.md
.