Constructor
new MagoFluid(viewer)
Constructor for MagoFluid class
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Cesium.Viewer | Cesium Viewer instance |
- Source:
Example
const options = {
lon: 126.978388,
lat: 37.566610,
cellSize: 1,
gridSize: 512,
}
const magoWaterSimulation = new MagoFluid(viewer);
magoWaterSimulation.initBase(options);
magoWaterSimulation.start();
magoWaterSimulation.addRandomSourcePosition();
Classes
Members
customShaderLoader :ShaderLoader
Custom shader loader
Type:
- Source:
options :MagoFluidOptions
Default options for the water simulation.
Type:
- Source:
viewer :Cesium.Viewer
Cesium Viewer instance
Type:
- Cesium.Viewer
- Source:
waterSimulator :FluidEngine
Water Simulator
Type:
- FluidEngine
- Source:
Methods
addRandomSourcePosition()
Adds a random water source position to the simulation.
- Source:
addSeaWallPosition(lon, lat) → {Object}
Adds a sea wall position to the simulation.
Parameters:
Name | Type | Description |
---|---|---|
lon |
||
lat |
- Source:
Returns:
- Type
- Object
addWaterMinusSourcePosition(lon, lat) → {Object}
Adds a water minus source position to the simulation.
Parameters:
Name | Type | Description |
---|---|---|
lon |
||
lat |
- Source:
Returns:
- Type
- Object
addWaterSourcePosition(lon, lat) → {Object}
Adds a water source position to the simulation.
Parameters:
Name | Type | Description |
---|---|---|
lon |
||
lat |
- Source:
Returns:
- Type
- Object
clearSeaWallPositions()
Clears the sea wall positions.
- Source:
clearWaterMinusSourcePositions()
Clears the water minus source positions.
- Source:
clearWaterSourcePositions()
Clears the water source positions.
- Source:
createRectangle(extent) → {Entity}
Creates a rectangle on the globe.
Parameters:
Name | Type | Description |
---|---|---|
extent |
- Source:
Returns:
- Type
- Entity
init(viewer)
Initializes the viewer to render points on a globe.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
- Source:
(async) initBase(options) → {Promise.<void>}
Initializes the water simulation with the given options.
Parameters:
Name | Type | Description |
---|---|---|
options |
- Source:
Returns:
- Type
- Promise.<void>
(async) initializeWater() → {Promise.<void>}
Initializes the water simulation.
- Source:
Returns:
- Type
- Promise.<void>
saveWaterMapImage()
Saves the water map image as a PNG file.
- Source:
(async) start() → {Promise.<void>}
Starts the water simulation.
- Source:
Returns:
- Type
- Promise.<void>
stop()
Stops the water simulation.
- Source: