JSGhostSymbolMap
API for managing the registration of ghost symbol objects.
Create a API with Module.getGhostSymbolMap.
var object = Module.getGhostSymbolMap();
Function
addGhostSymbolBy3DS(id, url, name) → boolean
Registers a ghost symbol model based on a 3DS file.
id
string
Ghost symbol registration ID.
url
string
3DS file URL path.
name
string
3DS file name (no extension entered).
Return
true: Ghost symbol model registration successful.
false: registration of ghost symbol model failed.
addGhostSymbolByXDO(id, url, name, version) → boolean
Registers a ghost symbol model based on an XDO file.
id
string
Ghost symbol registration ID.
url
string
XDO file URL path.
name
string
XDO file name (no extension entered).
version
bool
XDO file version. true: Version 3.0.0.2. false: Version 3.0.0.1.
Return
true: Ghost symbol model registration successful.
false: registration of ghost symbol model failed.
insert(option) → string
Registers a ghost symbol using a 3DS file.
Return
"success": Registration successful.
"request failed": Network request failure for the 3ds file.
Returns other exception handling messages.
Sample
Refer to function init.
setGhostSymbolTexture(id, url, name) → boolean
Specifies the texture image for a ghost symbol model.
The specified image is applied following the texture coordinates of the registered ghost symbol model.
id
string
Registration id for the ghost symbol model to specify the texture.
url
string
image file URL path.
name
string
image file name (including extension).
Return
true: Successful specification of the texture image.
false: Failed to specify texture image.
Failure conditions.
If there is no registered ghost symbol.
setModelTexture(option) → string
Specifies the face texture for the registered ghost symbol object.
Return
"success": Registration successful.
"failed load texture": Network request failure for the image file.
Returns other exception handling messages.
Sample
Refer to function init.
setModelFaceColor(id, index, color) → boolean
Specifies the face color for the registered ghost symbol object.
id
string
Registration id for the ghost symbol model.
index
number
Color change face index number.
Return
true: Successful object setting.
false: Failed object setting.
setModelFaceTextureRepeatU(id, index, repeat) → boolean
Sets the visibility of horizontal image patterns on the faces of registered ghost symbol models.
Configures the visibility method for areas outside the UV (texture) coordinate range (0.0 ~ 1.0).
Visualization options:
GL_REPEAT: Repeats the image pattern for areas outside the 0.0 ~ 1.0 range.
GL_CLAMP_TO_EDGE: Prevents image visibility for areas outside the 0.0 ~ 1.0 range.
id
string
Registration id for the ghost symbol model.
index
number
Image pattern change face index number.
repeat
boolean
Set the presence or absence of a horizontal image pattern. If true, sets a repeating image pattern. If false, sets the original image.
Return
true: Successful object setting.
false: Failed object setting.
setModelFaceTextureRepeatV(id, index, repeat) → boolean
Sets the visibility of vertical image patterns on the faces of registered ghost symbol models.
Configures the visibility method for areas outside the UV (texture) coordinate range (0.0 ~ 1.0).
Visualization options:
GL_REPEAT: Repeats the image pattern for areas outside the 0.0 ~ 1.0 range.
GL_CLAMP_TO_EDGE: Prevents image visibility for areas outside the 0.0 ~ 1.0 range.
id
string
Registration id for the ghost symbol model.
index
number
Image pattern change face index number.
repeat
boolean
Set the presence or absence of a vertical image pattern. If true, sets a repeating image pattern. If false, sets the original image.
Return
true: Successful object setting.
false: Failed object setting.
getModelFaceCount(id) → number
Returns the number of faces for the registered ghost symbol object.
id
string
Registration id for the ghost symbol model.
Return
The number of faces for the reference object.
isExistID(id) → boolean
Checks if the registered ghost symbol exists.
id
string
Registration id for the ghost symbol model.
Return
true: The object exists.
false: The object does not exist.
getGhostSymbolSize(id) → JSSize3D
Returns the size of the registered ghost symbol.
id
string
Registration id for the ghost symbol model.
Return
JSSize3D: Successful return of the ghost symbol size (x,y,z).
null: Failure to return size.
Sample
Refer to function createGhostSymbol.
Type Definitions
JSGhostSymbolMap.InsertOptions
Options for registering a 3D model object as a ghost symbol.
id
string
Registration id for the ghost symbol model.
url
string
Request URL for the reference object.
format
string
optional
Requested file format (only supports 3ds).
callback
function
optional
Callback function that operates upon completion of registration
JSGhostSymbolMap.LoadTexture
Options for registering face textures for the registered ghost symbol object.
id
number
Registration id for the ghost symbol model.
url
boolean
Request URL for the reference image.
index
number
optional
0
Face index of the reference object.
callback
function
optional
Callback function that operates upon completion of registration
Last updated