new HotspotMaterial(viewer)
Hotspot material handles the parse of the material config and the loading of the needed resource.
In the end it provides a THREE.MeshBasicMaterial when the resources are loaded.
In the end it provides a THREE.MeshBasicMaterial when the resources are loaded.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | The viewer reference. |
- Source:
Extends
Members
(static, constant) presets :Object
Materials presets.
Type:
- Object
- Source:
(static, constant) sides :Object
Material sides list.
Type:
- Object
- Source:
(static, constant) types :Object
Material input type list.
Type:
- Object
- Source:
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
(readonly) color :string|number
Get the color of this hotspot material.
Type:
- string | number
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
(readonly) displayObject :FORGE.Image|FORGE.DisplayObject
Get the displayObject of this hotspot material.
Type:
- Source:
(readonly) material :THREE.MeshBasicMaterial
Get the THREE.MeshBasicMaterial used for this hotspot material.
Type:
- THREE.MeshBasicMaterial
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) onReady :FORGE.EventDispatcher
Get the "onReady" FORGE.EventDispatcher of this hotspot material.
Dispatched when the material texture is loaded and ready to be used by a THREE.Texture.
Dispatched when the material texture is loaded and ready to be used by a THREE.Texture.
Type:
- Source:
(readonly) opacity :number
Get the opacity of this hotspot material.
Type:
- number
- Source:
(readonly) ready :boolean
Get the ready flag of this hotspot material.
Type:
- boolean
- Source:
(readonly) side :string
Get the side of this hotspot material.
Type:
- string
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) texture :THREE.Texture
Get the THREE.Texture used for this hotspot material.
Type:
- THREE.Texture
- Source:
(readonly) transparent :boolean
Get the transparent flag of this hotspot material.
Type:
- boolean
- Source:
(readonly) type :string
Get the type of texture provider of this hotspot material.
Type:
- string
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
destroy()
Destroy sequence.
- Overrides:
- Source:
dump() → {HotspotMaterialConfig}
Dump the material configuration
- Source:
Returns:
- Type
- HotspotMaterialConfig
load(config)
Load a material configuration
Parameters:
Name | Type | Description |
---|---|---|
config |
HotspotMaterialConfig | The hotspot material configuration object. |
- Source:
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
setTextureFrame(frameopt)
Set texture frame
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
frame |
FORGE.Rectangle |
<optional> |
texture frame |
- Source:
update()
Update method taht will be called by the Hotspot.
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: