KeyframeNode.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const LoadState = Object.freeze({
  2. UNLOADED: 0, // Has no data and is in dormant state
  3. RECEIVING: 1, // Is waiting on data from the provider
  4. RECEIVED: 2, // Received data from the provider
  5. LOADED: 3, // Processed data from provider
  6. FAILED: 4, // Failed to receive data from the provider
  7. UNAVAILABLE: 5, // No data available for this tile
  8. });
  9. /**
  10. * @alias KeyframeNode
  11. * @constructor
  12. *
  13. * @param {SpatialNode} spatialNode
  14. * @param {number} keyframe
  15. *
  16. * @private
  17. */
  18. function KeyframeNode(spatialNode, keyframe) {
  19. this.spatialNode = spatialNode;
  20. this.keyframe = keyframe;
  21. this.state = LoadState.UNLOADED;
  22. this.metadatas = [];
  23. this.megatextureIndex = -1;
  24. this.priority = -Number.MAX_VALUE;
  25. this.highPriorityFrameNumber = -1;
  26. }
  27. /**
  28. * @param {KeyframeNode} a
  29. * @param {KeyframeNode} b
  30. */
  31. KeyframeNode.priorityComparator = function (a, b) {
  32. return a.priority - b.priority;
  33. };
  34. /**
  35. * @param {KeyframeNode} a
  36. * @param {KeyframeNode} b
  37. */
  38. KeyframeNode.searchComparator = function (a, b) {
  39. return a.keyframe - b.keyframe;
  40. };
  41. KeyframeNode.LoadState = LoadState;
  42. export default KeyframeNode;