Skip to content
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

make entity model matrix computation public #5584

Merged
merged 7 commits into from
Jul 26, 2017

Conversation

rahwang
Copy link
Contributor

@rahwang rahwang commented Jul 5, 2017

Could you review, @mramato ? Thanks!

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 7, 2017

@ggetz do you want to do a first pass review?

@ggetz
Copy link
Contributor

ggetz commented Jul 7, 2017

@rahwang Looks good to me, just update CHANGES.md

@rahwang
Copy link
Contributor Author

rahwang commented Jul 11, 2017

Thanks @ggetz ! Done.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 11, 2017

@mramato did you want to look at this before merging?

@mramato
Copy link
Contributor

mramato commented Jul 12, 2017

@rahwang please merge in master.

*/
Entity.prototype._getModelMatrix = function(time, result) {
Entity.prototype.computeModelMatrix = function(time, result) {
var position = Property.getValueOrUndefined(this._position, time, positionScratch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this is public, we should add a Check call for time (and unit test to go along with it) since it's required.

@@ -581,9 +581,14 @@ define([
var orientationScratch = new Quaternion();

/**
* @private
* Computes the model matrix for the entity's transform at specified time.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expand on this documentation to indicate what happens if the entity has no position or no orientation.

* @param {JulianDate} time The time to retrieve model matrix for.
* @param {Matrix4} [result] The object onto which to store the result.
*
* @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too, since undefined can be returned.

CHANGES.md Outdated
* Fixed documentation for `OrthographicFrustum` [#5586](https://github.com/AnalyticalGraphicsInc/cesium/issues/5586)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whiespace

@mramato
Copy link
Contributor

mramato commented Jul 12, 2017

I was tempted to say let's make this a Property instead of a function, but that's properly overkill for the time being and can easily be changed if we have a good use case for it.

Just those couple of comments. Thanks @rahwang!

CHANGES.md Outdated
@@ -5,8 +5,10 @@ Change Log

* Fixed a bug where a Model's compressed textures were not being displayed. [#5596](https://github.com/AnalyticalGraphicsInc/cesium/pull/5596)
* Fixed a bug where jsep was undefined when using webpack [#5593](https://github.com/AnalyticalGraphicsInc/cesium/issues/5593)
* Make Entity mode matrix public via computeModelMatrix(). [#5584](https://github.com/AnalyticalGraphicsInc/cesium/pull/5584)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually say something like Added Entity.computeModelMatrix which .... End users have no idea what was private/public so you need to explain what the function is.

@rahwang
Copy link
Contributor Author

rahwang commented Jul 18, 2017

Thanks @mramato . Done!

@mramato
Copy link
Contributor

mramato commented Jul 26, 2017

Sorry for the delay here @rahwang! I merged in master and fixed CHANGES.md but other than that this looks great.

@mramato mramato merged commit 960418e into CesiumGS:master Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants