You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MaterialPass.js 825B

12345678910111213141516171819202122232425262728293031323334
  1. const { Cesium } = DC.Namespace
  2. function MaterialPass() {
  3. this.ambientColor = new Cesium.Color()
  4. this.diffuseColor = new Cesium.Color()
  5. this.specularColor = new Cesium.Color(0.0, 0.0, 0.0, 0.0)
  6. this.shininess = 50.0
  7. this.bTransparentSorting = false
  8. this.texMatrix = Cesium.Matrix4.clone(
  9. Cesium.Matrix4.IDENTITY,
  10. new Cesium.Matrix4()
  11. )
  12. this.textures = []
  13. }
  14. MaterialPass.prototype.isDestroyed = function() {
  15. return false
  16. }
  17. MaterialPass.prototype.destroy = function() {
  18. let length = this.textures.length
  19. for (let i = 0; i < length; i++) {
  20. let texture = this.textures[i]
  21. texture.destroy()
  22. }
  23. this.textures.length = 0
  24. this.ambientColor = undefined
  25. this.diffuseColor = undefined
  26. this.specularColor = undefined
  27. return Cesium.destroyObject(this)
  28. }
  29. export default MaterialPass