-
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
Snorm range max #4121
Snorm range max #4121
Conversation
* @returns {Cartesian2} The 2 byte oct-encoded unit length vector. | ||
* | ||
* @exception {DeveloperError} vector must be normalized. | ||
* | ||
* @see AttributeCompression.octDecode | ||
*/ | ||
AttributeCompression.octEncode = function(vector, result) { | ||
AttributeCompression.octEncode = function(vector, result, rangeMax) { |
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.
result
parameters should come last so we need to introduce a new function (and we can implement this function using that new one; no need to deprecate this).
* | ||
* @see AttributeCompression.octEncode | ||
*/ | ||
AttributeCompression.octDecode = function(x, y, result) { | ||
AttributeCompression.octDecode = function(x, y, result, rangeMax) { |
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.
Same comment.
@bagnell can you take a quick look at the math and the tests? |
@pjcozzi Updated |
The code looks good to me. The only comment I have is do we want to use an arbitrary range? Shouldn't it take the number of bits? |
Did you remember to commit CHANGES.md? I don't see it. |
You're right, I missed it. It has been added. |
I wanted to avoid calling Math.pow; I would be fine with it either way though. |
I'm fine with it either way as well, but if we keep it this way, it should be mentioned in the doc. |
Could you be more specific? Is there a part of the doc that is unclear? |
|
The behavior of
|
Yes, it can be an arbitrary range but it determines how many bits the number can be stored in. No need to throw an exception. Add something like |
Updated |
Can I get an update on this? I'm going to need this to finish i3dm. |
Looks good to me. @pjcozzi do you want to take another look? |
Thanks @lasalvavida. @lilleyse can you merge |
Ok |
Ready now. |
Adds the ability to vary the range size for SNORM and oct-encoding values for #100.
@pjcozzi, can you look at this when you get a chance?
You can use this to get oct24P and oct32P.