|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /**
- * @Author: Caven
- * @Date: 2021-02-24 13:54:09
- */
-
- import { Cesium } from '@dc-modules/namespace'
- import MaterialProperty from '../../MaterialProperty'
- const IMG = require('@dc-modules/images/space_line.png')
-
- class WallLineTrailMaterialProperty extends MaterialProperty {
- constructor(options = {}) {
- super(options)
- this._image = undefined
- this._imageSubscription = undefined
- this._repeat = undefined
- this._repeatSubscription = undefined
- this.image = IMG
- this.repeat = new Cesium.Cartesian2(
- options.repeat?.x || 1,
- options.repeat?.y || 1
- )
- }
-
- getType(time) {
- return Cesium.Material.WallLineTrailType
- }
-
- getValue(time, result) {
- if (!result) {
- result = {}
- }
- result.color = Cesium.Property.getValueOrUndefined(this._color, time)
- result.image = Cesium.Property.getValueOrUndefined(this._image, time)
- result.repeat = Cesium.Property.getValueOrUndefined(this._repeat, time)
- result.speed = this._speed
- return result
- }
-
- equals(other) {
- return (
- this === other ||
- (other instanceof WallLineTrailMaterialProperty &&
- Cesium.Property.equals(this._color, other._color) &&
- Cesium.Property.equals(this._speed, other._speed) &&
- Cesium.Property.equals(this._repeat, other._repeat))
- )
- }
- }
-
- Object.defineProperties(WallLineTrailMaterialProperty.prototype, {
- color: Cesium.createPropertyDescriptor('color'),
- image: Cesium.createPropertyDescriptor('image'),
- repeat: Cesium.createPropertyDescriptor('repeat'),
- speed: Cesium.createPropertyDescriptor('speed')
- })
-
- export default WallLineTrailMaterialProperty
|