Appearance
Class: DynamicMaterialProperty
动态材质属性类,随时间变化而变化的动态材质属性 MaterialProperty
Table of contents
Constructors
Accessors
Methods
Constructors
constructor
• new DynamicMaterialProperty(options): DynamicMaterialProperty
动态材质属性类,随时间变化而变化的动态材质属性 MaterialProperty
| Name | Type | Default | Description |
|---|---|---|---|
image | String | 图片地址 | |
color | Color | Color.WHITE | optional 颜色 |
repeat | Cartesian2 |
new Cesium.Cartesian2(1, 1)| optional 纹理图片重复平铺 | | axisY | Boolean | false | optional 是否沿Y轴平铺贴图 | | duration | Number | 1000 | optional 持续时间 (毫秒) |
Parameters
| Name | Type |
|---|---|
options | DynamicMaterialPropertyOptions |
Returns
Example
js
// 动态墙
viewer.entities.add({
name: "DynamicWall",
wall: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([
113.4144, 23.1797, 10.1, 113.4168, 23.1797, 4, 113.41936, 23.18086, 22,
113.4202, 23.1834, 14, 113.4175, 23.18406, 8, 113.4156, 23.18321, 9
]),
maximumHeights: [100, 100, 100, 100, 100, 100],
minimumHeights: [38.9, 44, 34.7, 34.4, 34.7, 34.4],
material: new joDVF.DynamicMaterialProperty({
color: Cesium.Color.YELLOW,
duration: 2000,
image: "img/flowLine.png",
repeat: new Cesium.Cartesian2(1, 1)
})
}
});Defined in
src/materials/DynamicMaterialProperty.ts:92
Accessors
isConstant
• get isConstant(): boolean
是否为常量
Returns
boolean
Memberof
DynamicMaterialProperty
Defined in
src/materials/DynamicMaterialProperty.ts:228
definitionChanged
• get definitionChanged(): Event<(...args: any[]) => void>
定义改变事件
Returns
Event<(...args: any[]) => void>
Memberof
DynamicMaterialProperty
Defined in
src/materials/DynamicMaterialProperty.ts:244
Methods
getType
▸ getType(): string
获取材质的类型
Returns
string
Defined in
src/materials/DynamicMaterialProperty.ts:136
getValue
▸ getValue(time, result?): Object
获取材质属性值
Parameters
| Name | Type | Description |
|---|---|---|
time | Object | 时间 |
time.dayNumber | number | - |
time.secondsOfDay | number | - |
result? | Object | 结果 |
result.image? | string | - |
result.color? | Color | - |
result.repeat? | Cartesian2 | - |
result.axisY? | boolean | - |
result.time? | number | - |
Returns
Object
返回当前时间结果
| Name | Type |
|---|---|
image? | string |
color? | Color |
repeat? | Cartesian2 |
axisY? | boolean |
time? | number |
Defined in
src/materials/DynamicMaterialProperty.ts:146
equals
▸ equals(other): boolean
判断两材质是否相等
Parameters
| Name | Type | Description |
|---|---|---|
other | any | 材质 |
Returns
boolean
Defined in
src/materials/DynamicMaterialProperty.ts:211

