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.

WallTrailMaterialProperty.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @Author : Caven Chen
  3. */
  4. import { Cesium } from '../../../../namespace'
  5. import MaterialProperty from '../../MaterialProperty'
  6. import IMG from '../../../images/fence.png'
  7. class WallTrailMaterialProperty extends MaterialProperty {
  8. constructor(options = {}) {
  9. super(options)
  10. this._image = undefined
  11. this._imageSubscription = undefined
  12. this.image = IMG
  13. }
  14. getType(time) {
  15. return Cesium.Material.WallTrailType
  16. }
  17. getValue(time, result) {
  18. if (!result) {
  19. result = {}
  20. }
  21. result.color = Cesium.Property.getValueOrUndefined(this._color, time)
  22. result.image = Cesium.Property.getValueOrUndefined(this._image, time)
  23. result.speed = Cesium.Property.getValueOrUndefined(this._speed, time)
  24. return result
  25. }
  26. equals(other) {
  27. return (
  28. this === other ||
  29. (other instanceof WallTrailMaterialProperty &&
  30. Cesium.Property.equals(this._color, other._color) &&
  31. Cesium.Property.equals(this._speed, other._speed))
  32. )
  33. }
  34. }
  35. Object.defineProperties(WallTrailMaterialProperty.prototype, {
  36. color: Cesium.createPropertyDescriptor('color'),
  37. speed: Cesium.createPropertyDescriptor('speed'),
  38. image: Cesium.createPropertyDescriptor('image'),
  39. })
  40. export default WallTrailMaterialProperty