FrustumCommands.js 840 B

123456789101112131415161718192021222324252627282930
  1. import defaultValue from "../Core/defaultValue.js";
  2. import Pass from "../Renderer/Pass.js";
  3. /**
  4. * Defines a list of commands whose geometry are bound by near and far distances from the camera.
  5. * @alias FrustumCommands
  6. * @constructor
  7. *
  8. * @param {number} [near=0.0] The lower bound or closest distance from the camera.
  9. * @param {number} [far=0.0] The upper bound or farthest distance from the camera.
  10. *
  11. * @private
  12. */
  13. function FrustumCommands(near, far) {
  14. this.near = defaultValue(near, 0.0);
  15. this.far = defaultValue(far, 0.0);
  16. const numPasses = Pass.NUMBER_OF_PASSES;
  17. const commands = new Array(numPasses);
  18. const indices = new Array(numPasses);
  19. for (let i = 0; i < numPasses; ++i) {
  20. commands[i] = [];
  21. indices[i] = 0;
  22. }
  23. this.commands = commands;
  24. this.indices = indices;
  25. }
  26. export default FrustumCommands;