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

Fix updateBatchTableBoundingSpheres #4461

Merged
merged 5 commits into from
Oct 21, 2016
Merged

Fix updateBatchTableBoundingSpheres #4461

merged 5 commits into from
Oct 21, 2016

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Oct 19, 2016

updateBatchTableBoundingSpheres was using the BoundingSphere center without applying the modelMatrix to the sphere first.

Fixes #4431 and #4428

@bagnell as discussed offline, this may not be the most correct fix, but let me know what you think. We probably want a unit test for this as well.

updateBatchTableBoundingSpheres was using the BoundingSphere center without
applying the modelMatrix to the sphere first.


Fixes #4431 and #4428
@hpinkos hpinkos assigned bagnell and hpinkos and unassigned bagnell Oct 19, 2016
@hpinkos
Copy link
Contributor

hpinkos commented Oct 20, 2016

Just waiting on unit tests. @mramato let me know when this is ready =)

@hpinkos
Copy link
Contributor

hpinkos commented Oct 21, 2016

#4428 is fixed, but I'm still getting a crash with the KML file included in #4431

DeveloperError: sphere is required.
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:44:19)
    at Function.BoundingSphere.transform (http://localhost:8080/Source/Core/BoundingSphere.js:1003:19)
    at updateBatchTableBoundingSpheres (http://localhost:8080/Source/Scene/Primitive.js:1197:45)

We were previously only applying if a display condition existed.
@mramato
Copy link
Contributor Author

mramato commented Oct 21, 2016

I'm still working on this, so there's a chance that I'll fix it or it's a completely different unrelated crash.

@hpinkos
Copy link
Contributor

hpinkos commented Oct 21, 2016

alright, let me know when this is ready then

@mramato
Copy link
Contributor Author

mramato commented Oct 21, 2016

This is ready. I'm going to open a PR for #4431 separately since fixing the first issue exposes a new one.

@hpinkos
Copy link
Contributor

hpinkos commented Oct 21, 2016

@pjcozzi can you take a quick look at this and merge it? It fixes the problem, I'm just not 100% sure on the code changes.

batchTable.setBatchedAttribute(i, center2DLowIndex, encodedCenter.low);

batchTable.setBatchedAttribute(i, radiusIndex, radius);
var modelMatrix = defaultValue(primitive.modelMatrix, Matrix4.IDENTITY);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not

var modelMatrix = primitive.modelMatrix;
if (defined(modelMatrix)) {
   boundingSphere = BoundingSphere.transform(boundingSphere, modelMatrix, boundingSphere);
}

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 21, 2016

Just that comment.

Also, update CHANGES.md

Also clean up model modelMatrix check.
@mramato
Copy link
Contributor Author

mramato commented Oct 21, 2016

Thanks @pjcozzi, good call. Both are done.

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 21, 2016

#4428 is fixed.

With #4431, I get this on drag and drop:

image

@mramato
Copy link
Contributor Author

mramato commented Oct 21, 2016

With #4431, I get this on drag and drop:

Yes, we discussed this earlier in the PR: #4461 (comment)

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 21, 2016

Sounds good.

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.

Kml file loading regression: works in 1.25, not 1.26 "Cannot read property 'center' of undefined"
4 participants