-
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
Finish Matrix4 implementation. #129
Conversation
There are still some regressions that need to be fixed but it now matches Matrix2 and Matrix3 API-wise.
Replace Jobs.downloadImage and getImageFromUrl with promise-based loadImage. Change jsonp to work in a promise-based way. Fix some other random documentation problems I noticed along the way.
1. All toEqual calls in specs were actually doing toString result comparisons, which was cuastom some tests to pass even though they failed. I added a toEqual override in addDefaultMatchers and fixed offending tests. 2. Fix inverseTransformation and add more tests to Matrix4.
1. Coverage up to 100% 2. Fix missing semicolons in loadImage.js 3. There's still a bug in 2D/Columbus mode that I need to track down.
Conflicts: Source/Core/loadImage.js
Also add missing error check in Cartesian3.
1. Flesh out documentation. 2. Rename some Matrix4.fromX functions to Matrix4.computeX so they make sense. 3. Optimize internal Matrix4 computations to avoid needless array indexing and checks.
}); | ||
|
||
it('createPerspectiveFieldOfView works without a result parameter', function() { | ||
var expected = new Matrix4(1, 0, 0, 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.
Spacing is a bit off here and below if you care.
I can't figure out to expand the diff for changes to
|
Good catch on As for toArray, I definitely plan on looking into it. To ease your conscience in the mean time, I'll add that I've eliminated so many unnecessary temporary Matrix instances, that things are still faster even with the toArray call. I want to look into using cached TypeArrays in places like this as well to see how it affects performance and memory pressure. I definitely plan on doing this all in a separate effort once all of the Core cleanup I'm working on it finished. I'm optimistic that there is a ton of room for performance improvement in our code base. |
This is great and those optimizations are long overdue. However, there are several types of matrices like the projection matrix, east-north-up-to-fixed, and matrices in a transform hierarchy for a model, that will not change frame-to-frame, which we didn't help in this case. Anyway, I know you're all over it... |
Okay, documentation changes are in. I found a few prototype functions that were missing doc and there were stray param tags missing in some places. Everything has correct doc now. |
@shunter review and merge this when you can, please. It's OK with me. |
* All functions starting with `multiplyWith` now start with `multiplyBy` to be consistent with functions starting with `divideBy`. | ||
* The `multiplyWithMatrix` function on each `Matrix` type was renamed to `multiply`. | ||
* All three Matrix classes have been largely re-written for consistency and performance. The `values` property has been eliminated and Matrices are no longer immutable. Code that previously looked like `matrix = matrix.setColumn0Row0(12);` now looks like `matrix[Matrix2.COLUMN0ROW0] = 12;`. Code that previously looked like `matrix.setColumn3(cartesian3);` now looked like `matrix.setColum(3, cartesian3, matrix)`. |
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.
typo at the end: setColum
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.
Thanks, fixed.
|
||
return a === b; | ||
if (a !== null && b !== null && typeof a !== 'undefined' && typeof b !== 'undefined') { | ||
return a.toString() === b.toString(); |
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.
Is this a good idea? I wouldn't expect a.toEqual(b) to potentially toString them and compare. Any object without a toString override will compare equal to any other object.
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.
okay @shunter I think we're good to go. |
Finish Matrix4 implementation.
updated STK Cesium examples to use fromDegrees
Hello, |
Thanks for the report, @anne-gropler. I submitted #3927. |
These changes are related to issues #71, #84, #86 (those issues will remain open until we address them for every Core type).