Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CircleWaveMaterialProperty.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-03-06 17:56:39
  4. */
  5. import { Cesium } from '@dc-modules/namespace'
  6. import MaterialProperty from '../../MaterialProperty'
  7. class CircleWaveMaterialProperty extends MaterialProperty {
  8. constructor(options = {}) {
  9. super(options)
  10. this.count = Math.max(options.count || 3, 1)
  11. this.gradient = Cesium.Math.clamp(options.gradient || 0.1, 0, 1)
  12. }
  13. get isConstant() {
  14. return false
  15. }
  16. get definitionChanged() {
  17. return this._definitionChanged
  18. }
  19. getType(time) {
  20. return Cesium.Material.CircleWaveType
  21. }
  22. getValue(time, result) {
  23. if (!result) {
  24. result = {}
  25. }
  26. result.color = Cesium.Property.getValueOrUndefined(this._color, time)
  27. result.speed = this._speed
  28. result.count = this.count
  29. result.gradient = this.gradient
  30. return result
  31. }
  32. equals(other) {
  33. return (
  34. this === other ||
  35. (other instanceof CircleWaveMaterialProperty &&
  36. Cesium.Property.equals(this._color, other._color) &&
  37. Cesium.Property.equals(this._speed, other._speed))
  38. )
  39. }
  40. }
  41. Object.defineProperties(CircleWaveMaterialProperty.prototype, {
  42. color: Cesium.createPropertyDescriptor('color'),
  43. speed: Cesium.createPropertyDescriptor('speed')
  44. })
  45. export default CircleWaveMaterialProperty