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

Use frameState.afterRender to fire QuadtreePrimitive.tileLoadProgressEvent #3450

Closed
pjcozzi opened this issue Jan 21, 2016 · 4 comments
Closed
Labels
cleanup good first issue An opportunity for first time contributors

Comments

@pjcozzi
Copy link
Contributor

pjcozzi commented Jan 21, 2016

In case, for example, someone adds new primitives in the callback.

For example, see https:/AnalyticalGraphicsInc/cesium/blob/7d449906cf65cf06e75d5cde7bf2dd5921bc95dd/Source/Scene/ModelAnimationCollection.js#L387

@pjcozzi pjcozzi added cleanup good first issue An opportunity for first time contributors labels Jan 21, 2016
@kepta
Copy link

kepta commented Jan 23, 2016

@pjcozzi Can I take this one?

@pjcozzi
Copy link
Contributor Author

pjcozzi commented Jan 23, 2016

@kepta
Copy link

kepta commented Jan 24, 2016

I tried changing the code to this,

  function raiseTileLoadProgressEvent(primitive, frameState) {
        var currentLoadQueueLength = primitive._tileLoadQueue.length;
        if (currentLoadQueueLength !== primitive._lastTileLoadQueueLength) {
          frameState.afterRender.push(function() {
            primitive._tileLoadProgressEvent.raiseEvent(currentLoadQueueLength);
            primitive._lastTileLoadQueueLength = currentLoadQueueLength;
          });
        }
    }

However, the test case

Scene/QuadtreePrimitive tileLoadProgressEvent is raised when tile loaded and when new children discovered
TypeError: Cannot read property 'args' of undefined

fails, what am I missing ?

@kepta
Copy link

kepta commented Jan 30, 2016

@pjcozzi a little help here please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup good first issue An opportunity for first time contributors
Projects
None yet
Development

No branches or pull requests

2 participants