| Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
包含如下属性的Object:
|
|||||||||||||||||||||||||||||||||||||||||
callback |
CallbackBoolean |
null
|
optional
加载成功后触发的函数回调。 |
Example:
var layer = new CooWasm.ModelLayer({
url:"http://127.0.0.1/0.c3s.zip"
},(state)=>{console.log("load status:" + state)})
Demo:
Members
人工模型对象uuid。
人工模型数据是否参与阴影投射。
-
Default Value:
false
人工模型数据是否压缩。
是否为大文件格式数据。
人工模型数据是否接受阴影附着效果。
-
Default Value:
false
人工模型数据显隐状态。
-
Default Value:
true
人工模型数据亮度。
-
Default Value:
0.0
人工模型组件uuid。
人工模型数据对比度。
-
Default Value:
0.0
人工模型数据饱和度。
-
Default Value:
0.0
人工模型数据透明度。
-
Default Value:
1.0
人工模型数据路径。
人工模型数据可视距离。
Methods
从场景中销毁自身。
| Name | Type | Default | Description |
|---|---|---|---|
callback |
CallbackBoolean |
null
|
optional
销毁图层后触发的函数回调。 |
Returns:
null 空值。
Example:
// 销毁图层
layer = layer.destroy((state)=>{console.log("destroy status:" + state)})
获取图层包含的属性。
Returns:
是否获取成功。获取成功时,会自动赋值给属性。
Example:
// 获取属性
layer.getProperties()
console.log(layer.bCompress)
从场景中定位自身(自动根据数据包围盒定位,不可修改定位参数)。
| Name | Type | Default | Description |
|---|---|---|---|
callback |
CallbackBoolean |
null
|
optional
飞行结束后触发的函数回调。 |
Example:
// 定位图层
layer.locate(()=>{console.log("locate done!")})
更新单个或者多个对象属性,使之立即生效。
一般用于多个属性的同时更新,避免性能开销过大。(待启用)
| Name | Type | Default | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
optional
包含如下属性的Object。
|
||||||||||||||||||||||||||||
callback |
CallbackBoolean |
null
|
optional
更新成功后触发的函数回调。 |
Example:
layer.update({
bVisible:false
},(state)=>{console.log("update status:" + state)})
