-
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
Add tile loading events for Voxels #12430
base: main
Are you sure you want to change the base?
Conversation
Thank you for the pull request, @lukemckinstry! ✅ We can confirm we have a CLA on file for you. |
There are definitely visibility checks for the tiles (nodes), it's just not in a neat array like |
For Cesium3DTileset tileVisible, the If not, would we want to use this event, does it make sense to raise the tileVisible event without passing any info about the specific spatialNode? (I implemented this way for now fcd9a9c) |
It may be worth considering making the nodes part of the public API, and if they and |
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.
Looking good so far @lukemckinstry! A few comments, mostly around the inline documentation.
* </p> | ||
* | ||
* @type {Event} | ||
* @default new Event() |
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.
* @default new Event() |
I don't think this should be needed. Strictly speaking, we should probably prevent the public API from reassigning this at all by providing only a public getter. But this can remain consistent with what we have over in Cesium3DTileset
.
* <p> | ||
* The loaded tile is passed to the event listener. | ||
* </p> |
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.
* <p> | |
* The loaded tile is passed to the event listener. | |
* </p> |
This is raised with no arguments since the nodes are still private API, correct?
* This event is fired during the traversal while the frame is being rendered. | ||
* | ||
* @type {Event} | ||
* @default new Event() |
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.
* @default new Event() |
Same as above.
* </p> | ||
* | ||
* @type {Event} | ||
* @default new Event() |
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.
* @default new Event() |
* <p> | ||
* If there are no event listeners, error messages will be logged to the console. | ||
* </p> |
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 accurate? Please remove this line if not.
* @example | ||
* voxelPrimitive.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) { | ||
* if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) { | ||
* console.log('Stopped loading'); |
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.
Nitpick:
* console.log('Stopped loading'); | |
* console.log('Finished loading'); |
* </p> | ||
* | ||
* @type {Event} | ||
* @default new Event() |
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.
* @default new Event() |
* </p> | ||
* | ||
* @type {Event} | ||
* @default new Event() |
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.
* @default new Event() |
* </p> | ||
* | ||
* @type {Event} | ||
* @default new Event() |
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.
* @default new Event() |
|
||
if (defined(promise)) { | ||
that._simultaneousRequestCount++; | ||
keyframeNode.state = KeyframeNode.LoadState.RECEIVING; | ||
promise.then(postRequestSuccess).catch(postRequestFailure); | ||
} else { | ||
keyframeNode.state = KeyframeNode.LoadState.FAILED; | ||
that._primitive.tileFailed.raiseEvent(); |
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.
This may be a question beyond the scope of this PR, but when a provider returns undefined
instead of a promise, is that actually a failure state? Typically when undefined
is returned from a function like this, it signals that the request couldn't be scheduled this frame and will be tried again next frame.
CC @jjhembd
@jjhembd Would you be able to provide any tips on testing the unload event since you were recently looking into that part of the code? |
Description
Takes the following events from Cesium3DTileset and adds them to VoxelPrimitive
allTilesLoaded
initialTilesLoaded
loadProgress
tileLoad
tileUnload
Also makes
VoxelPrimitive
useCesium3DTilesetStatistics
class, but only makes use of 2 of the stats in the class so far.ToDo
selectedTiles
(fromCesium3DTileset
) inVoxelPrimitive
, if so I believe this would be simple.Cesium3dTilesetSpec
toVoxelPrimitiveSpec
.VoxelTraversal.printDebugInformation
.Issue number and link
related to #12297
Testing plan
Many events currently fire inside of
VoxelTraversal.printDebugInformation
. Enable this but comment out the last line of the function which logs the debug output so you can read the output from listeners you set up to listen to the new events.Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change