new ov.FluidModule()
流體模組
Members
-
absHeight
-
Properties:
Name Type Description absHeight
Number 流體高度是否為絕對高度(2D only, 3D固定為絕對高度)。
-
arrowLengthScale
-
Properties:
Name Type Description arrowLengthScale
Number 流體長度倍率
-
arrowScale
-
Properties:
Name Type Description arrowScale
Number 流體箭頭大小倍率
-
fadeOpacity
-
Properties:
Name Type Description fadeOpacity
Number 褪色參數,不透明度每禎減少量(1/255),Ex:設定為5的話每個粒子將存活51禎(2D only)。
-
lift
-
Properties:
Name Type Description lift
Number 流體高度。
-
maxSpeed
-
Properties:
Name Type Description maxSpeed
Number 速度最大值,影響顏色分布。
-
mode
-
Properties:
Name Type Description mode
ov.FLUID_MODE 流體模式(只對3D有用)。
-
speedFactor
-
Properties:
Name Type Description speedFactor
Number 流體移動速度參數。
-
zScale
-
Properties:
Name Type Description zScale
Number ZScale值,1為不改變,越小則流體越接近攝影機,用以防止Z Fighting。
Methods
-
addSectionalPlane(setting){ov.SectionalPlaneEntity}
webgl/module/fluidModule/ov-FluidModule.js, line 272 -
新增裁切面工具
Name Type Description setting
Object 參數物件。
Name Type Default Description source
Array.<Float32Array> 資料位置。
boundary
GeoBoundary 範圍。
height
Number 資料高。
width
Number 資料寬。
date
Array.<Date> 資料時間,長度需與source相同。
useStepLayeredColorMap
Boolean false optional 使用分層設色。
layeredColorMapKey
Array.<Number> optional 分層設色圖高度表。
layeredColorMapValue
Array.<ov.Color> optional 分層設色圖顏色表。
flipY
Boolean false optional 資料源是否翻轉Y軸。
Returns:
Type Description ov.SectionalPlaneEntity 切面工具物件。 -
getAllSectionalPlanes(SectionalPlaneEntity)
webgl/module/fluidModule/ov-FluidModule.js, line 288 -
取得以建立的所有裁切面工具
Name Type Description SectionalPlaneEntity
ov.SectionalPlaneEntity 裁切面工具。
-
getFluidSpeed(pos){GeoPoint}
webgl/module/fluidModule/ov-FluidModule.js, line 230 -
取得指定位置流體速度
Name Type Description pos
GeoPoint 指定位置,4326座標系統。
Returns:
Type Description GeoPoint 流體速度,若超出範圍或未設定流體速度資料來源則回傳null。 -
release()
webgl/module/fluidModule/ov-FluidModule.js, line 221 -
釋放流體資源
-
removeFluidData()
webgl/module/fluidModule/ov-FluidModule.js, line 214 -
移除流體資料
-
removeSectionalPlane(SectionalPlaneEntity)
webgl/module/fluidModule/ov-FluidModule.js, line 280 -
移除裁切面工具
Name Type Description SectionalPlaneEntity
ov.SectionalPlaneEntity 裁切面工具。
-
setFluidDataByParam(setting)
webgl/module/fluidModule/ov-FluidModule.js, line 173 -
設定流體資料
Name Type Description setting
Object 參數物件。
Name Type Default Description boundary
GeoBoundary 所在經緯度。
image
Uint8Array | Image 流體加密圖。
height
Number 資料高。
width
Number 資料寬。
depth
Number 1 optional 資料深(3D only)。
uMax
Number 橫軸速度最大值。
uMin
Number 橫軸速度最大值。
vMax
Number 縱軸速度最大值。
vMin
Number 縱軸速度最大值。
zMax
Number optional 深度軸速度最大值(3D only)。
zMin
Number optional 深度軸速度最大值(3D only)。
is3D
Boolean true optional 是否為3D,僅在圖台以WebGL2開啟時有效。
flipY
Boolean false optional 資料是否翻轉縱軸。
flipZ
Boolean false optional 資料是否翻轉深度軸。(3D only)
date
Array.<Date> 資料時間。
maxSpeed
Number 30 optional 速度最大值,影響顏色分布。
minSpeed
Number 0 optional 速度最小值,用於過濾。
pointSize
Number 1 optional 速度最大值,影響流體軌跡大小。
layeredColorMapKey
Array.<Number> optional 分層設色圖高度表。
layeredColorMapValue
Array.<ov.Color> optional 分層設色圖顏色表。
lift
Number 3000 optional 流體高度。
lineSeg
Number 8 optional 線段節點數,最大8最小2。(3D only)
center
Geo3DPoint optional 3D精細模式中心點,僅支援經緯座標和高度。
offset
Array.<Number> [0, 1, 0, 1, 0, 1] optional 3D精細模式範圍,依序為從3D精細模式中心點再給予東西方向西界、東西方向範圍、南北方向南界、南北方向範圍、高度方向下界、高度方向範圍。
absHeight
Boolean true optional 流體高度是否為絕對高度。(2D only)
particleNumber
Number 4096 optional 粒子數量。
fadeOpacity
Number 13 optional 褪色參數,不透明度每禎減少量(1/255),預設參數下給個流體粒子將存活20禎。(2D only)
speedFactor
Number 0.25 optional 流體移動速度參數。
dropRate
Number 0.003 optional 流體重制隨機位置機率。
magFilter
String "NEAREST" optional 貼圖放大採樣方式,NEAREST或是LINEAR。(2D only)
minFilter
String "NEAREST" optional 貼圖縮小採樣方式,NEAREST/LINEAR/NEAREST_MIPMAP_NEAREST/LINEAR_MIPMAP_NEAREST/NEAREST_MIPMAP_LINEAR/LINEAR_MIPMAP_LINEAR。(2D only)
zScale
Number 0.999997 optional ZScale值,1為不改變,越小則流體越接近攝影機,用以防止Z Fighting。(2D only)
-
setFluidDataByUVData(setting)
webgl/module/fluidModule/ov-FluidModule.js, line 207 -
設定流體資料
Name Type Description setting
Object 參數物件。
Name Type Default Description boundary
GeoBoundary 所在經緯度。
uData
Float32Array 橫軸流體速度(向東為正)。
vData
Float32Array 縱軸流體速度(向北為正)。
height
Number 資料高。
width
Number 資料寬。
depth
Number 1 optional 資料深(3D only)。
is3D
Boolean true optional 是否為3D,僅在圖台以WebGL2開啟時有效。
flipY
Boolean false optional 資料是否翻轉縱軸。
flipZ
Boolean false optional 資料是否翻轉深度軸。(3D only)
maxSpeed
Number optional 速度最大值,影響顏色分布,若沒設定將會自動依照uData與vData計算。
minSpeed
Number 0 optional 速度最小值,用於過濾。
pointSize
Number 1 optional 速度最大值,影響流體軌跡大小。
layeredColorMapKey
Array.<Number> optional 分層設色圖高度表。
layeredColorMapValue
Array.<ov.Color> optional 分層設色圖顏色表。
lift
Number 3000 optional 流體高度。
lineSeg
Number 8 optional 線段節點數,最大8最小2。(3D only)
center
Geo3DPoint optional 3D精細模式中心點,僅支援經緯座標和高度。
offset
Array.<Number> [0, 1, 0, 1, 0, 1] optional 3D精細模式範圍,依序為從3D精細模式中心點再給予東西方向西界、東西方向範圍、南北方向南界、南北方向範圍、高度方向下界、高度方向範圍。
absHeight
Boolean true optional 流體高度是否為絕對高度。(2D only)
particleNumber
Number 4096 optional 粒子數量。
fadeOpacity
Number 13 optional 褪色參數,影響尾巴長度,不透明度每禎減少量(1/255),預設參數下給個流體粒子將存活20禎。(2D only)
speedFactor
Number 0.25 optional 流體移動速度參數。
dropRate
Number 0.003 optional 流體重制隨機位置機率。
magFilter
String "NEAREST" optional 貼圖放大採樣方式,NEAREST或是LINEAR。(2D only)
minFilter
String "NEAREST" optional 貼圖縮小採樣方式,NEAREST/LINEAR/NEAREST_MIPMAP_NEAREST/LINEAR_MIPMAP_NEAREST/NEAREST_MIPMAP_LINEAR/LINEAR_MIPMAP_LINEAR。(2D only)
zScale
Number 0.999997 optional ZScale值,1為不改變,越小則流體越接近攝影機,用以防止Z Fighting。(2D only)
-
setMagFilter(Filter)
webgl/module/fluidModule/ov-FluidModule.js, line 238 -
設定貼圖放大採樣方式(2D only)
Name Type Description Filter
String 貼圖放大採樣方式,NEAREST或是LINEAR。
-
setMaskViewport(Viewport)
webgl/module/fluidModule/ov-FluidModule.js, line 254 -
設定貼圖縮小採樣方式
Name Type Description Viewport
CRect 設定貼圖大小,影響最後解析度,預設為new CRect(0, 0, 4096, 2048),超過會影響效能,且若寬高不為2的pow則無法產生Mipmap。
-
setMinFilter(Filter)
webgl/module/fluidModule/ov-FluidModule.js, line 246 -
設定貼圖縮小採樣方式(2D only)
Name Type Description Filter
String 貼圖縮小採樣方式,NEAREST/LINEAR/NEAREST_MIPMAP_NEAREST/LINEAR_MIPMAP_NEAREST/NEAREST_MIPMAP_LINEAR/LINEAR_MIPMAP_LINEAR。