JSTransparency
API for setting up excavation analysis features.
Creates with the Module.getTransparency API.
var transparency = Module.getTransparency();
clear()
Deletes all created excavations.
Module.getTransparency().clear();
create(coordinates) → number
Creates an excavation object with the given coordinates.
The coordinates input is a list of area coordinates (JSVector3D, JSVector3D, ...).
Return
Success (returns the size of the coordinate list) or failure (-1)
Sample
Refer to function createTransparency.
setAutoMove(coordinates, frame) → boolean
Sets the path and speed for an automatically moving circular excavation.
The coordinates input is a list of path coordinates (JSVector2D, JSVector2D, ...).
frame
number
Frame count for updating the excavation position.
Return
true : Setting successful.
false : Setting failed.
Sample
Refer to function setTransparencyAutoMove.
setDepth(depth)
Sets the depth of the excavation.
depth
number
Depth of the excavation from the ground surface (in meters).
Sample
Refer to function createTransparency.
setRadius(radius)
Sets the radius of the circular excavation.
radius
number
Radius of the circular excavation (in meters).
Sample
Refer to function setTransparencyRadius.
setTexture(data, width, height, type) → boolean
Sets the texture image for the excavation surface.
The data variable is a binary array data based on Uint8Array.
data
object
Image Byte Array
width
number
Image width
height
number
Image height
type
boolean
true for side texture. false for bottom texture.
Return
true : Setting successful.
false : Setting failed.
Sample
Refer to function setTransparencyTexture.
startAutoMove() → boolean
Starts the automatic movement of the excavation along a predefined path.
Return
true : Movement start successful.
false : Movement start failed.
Sample
Refer to function startTransparencyAutoMove.
stopAutoMove()
Stops the automatic movement of the excavation along a predefined path.
Sample
Refer to function stopTransparencyAutoMove.
Last updated