JSFlowPolygon

API for creating and modifying water flow effect polygon objects.

Create a API with Module.createFlowPolygon.

let flowPolygon = Module.createFlowPolygon("ID");

Properties

Name
Type
Description

opacity

number

Opacity.

fluid_activity

number

Degree of fluid fluctuation.

flow_speed

number

Flow speed.

image_type

number

Surface image display type. 0: Display with specified image. 1: Display wind flow direction legend as color. 3: Display with terrain texture buffer. Otherwise, display with the color specified by color.

position_offset

Additional position offset.

color

Color setting when in legend color display mode.

coordinates

Position of the object (get only).

Function

createGrid(options) → object

Creates a grid object.

Name
Type
Description

options

Grid information settings.

  • Return

    • Object with "result" attribute: Object creation successful.

    • Object with "error" attribute: Object creation failed.

    • Failure conditions.

      • If the "vertex" attribute is missing in options.

      • If the "index" attribute is missing in options.

      • If the "normaltexture" attribute is missing or the texture image is not valid.

      • If grid object creation failed.

      • If setting the "waterlevel" attribute failed.

createWall(options) → object

Creates a vertical wall polygon object.

Object is set with options variable.

Name
Type
Description

options

Wall information settings.

  • Return

    • Object with "result" attribute: Object creation successful.

    • Object with "error" attribute: Object creation failed.

    • Failure conditions.

      • If the "vertex" attribute is missing in options.

      • If the "normaltexture" attribute is missing or the texture image is not valid.

setCullMode(type) → boolean

Sets the culling option for the vertical wall polygon.

The culling option based on the input value of type is 0(both sides), 1(both sides), 2(CW), 3(CCW).

The initial culling option setting is 3.

Name
Type
Description

type

number

Polygon culling mode.

  • Return

    • true: Object option setting successful.

    • false: Object option setting failed.

Type Definitions

JSFlowPolygon.GridDataOption

Grid information parameters.

Name
Type
Attributes
Default
Description

vertex

array(JSVector3D)

List of coordinates forming the grid.

index

array(number)

List of index coordinates forming the grid.

normaltexture

Material normal texture.

flowtexture

optional

Direct flow map texture.

flowpath

array(JSVector2D)

optional

Flow map path.

imagetexture

optional

Surface image texture.

waterlevel

number

optional

0.0

Water level.

positionoffset

optional

(0.0, 0.0, 0.0)

Position offset.

JSFlowPolygon.WallDataOption

Wall information parameters.

Name
Type
Attributes
Default
Description

vertex

array(JSVector3D)

List of coordinates forming the wall.

normaltexture

Material normal texture.

imagetexture

optional

Surface image texture.

height

number

optional

10.0

Wall height.

positionoffset

optional

(0.0, 0.0, 0.0)

Position offset.

JSFlowPolygon.positionOffset

Name
Type
Default
Description

longitude

number

0.0

Longitude.

latitude

number

0.0

Latitude.

altitude

number

0.0

Altitude.

Last updated