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.

RadarOuterMaterialProperty.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @Author : Caven Chen
  3. */
  4. import { Cesium } from '../../../../libs'
  5. import MaterialProperty from '../../MaterialProperty'
  6. class RadarOuterMaterialProperty extends MaterialProperty {
  7. constructor(options = {}) {
  8. super(options)
  9. this._repeat = undefined
  10. this._repeatSubscription = undefined
  11. this._thickness = undefined
  12. this._thicknessSubscription = undefined
  13. this.repeat = options.repeat || 30.0
  14. this.thickness = options.thickness || 0.3
  15. }
  16. getType(time) {
  17. return Cesium.Material.RadarOuterType
  18. }
  19. getValue(time, result) {
  20. result = Cesium.defaultValue(result, {})
  21. result.color = Cesium.Property.getValueOrUndefined(this._color, time)
  22. result.speed = Cesium.Property.getValueOrUndefined(this._speed, time)
  23. result.repeat = Cesium.Property.getValueOrUndefined(this._repeat, time)
  24. result.thickness = Cesium.Property.getValueOrUndefined(
  25. this._thickness,
  26. time
  27. )
  28. return result
  29. }
  30. equals(other) {
  31. return (
  32. this === other ||
  33. (other instanceof RadarOuterMaterialProperty &&
  34. Cesium.Property.equals(this._color, other._color) &&
  35. Cesium.Property.equals(this._speed, other._speed) &&
  36. Cesium.Property.equals(this._repeat, other._repeat) &&
  37. Cesium.Property.equals(this._thickness, other._thickness))
  38. )
  39. }
  40. }
  41. Object.defineProperties(RadarOuterMaterialProperty.prototype, {
  42. color: Cesium.createPropertyDescriptor('color'),
  43. repeat: Cesium.createPropertyDescriptor('repeat'),
  44. thickness: Cesium.createPropertyDescriptor('thickness'),
  45. speed: Cesium.createPropertyDescriptor('speed'),
  46. })
  47. export default RadarOuterMaterialProperty