IconHandler
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
A Icon Handler holds and handle interaction of icons and it´s gpu representation.
Parameters
api: BimCoreApi
The API is required for accessing current scene.
optionaloptions: IconAtlasOptions
Here you can provide a everything you need to set the icon texture atlas.
Returns IconHandler
Properties
publicalphaSortInterval
Defines how often the Icons in the IconHandler are alpha sorted (back to front) relative the camera if icons are transparent.
- If 0 then alpha sort runs every frame. Very expensive. Avoid
- If > 0 then alpha sort culling runs only when the interval is exceeded.
- If < 0 alpha sort is disabled.
- Defaults to 500 ms.
publicreadonlyapi
The API is required for accessing current scene.
publicreadonlyid
Unique id of IconHandler.
publicocclusionCullingInterval
Defines how often the Icons in the IconHandler are occlusion culled in milliseconds.
- If 0 then occlusion culling runs every frame. Very expensive. Avoid
- If > 0 then occlusion culling runs only when the interval is exceeded.
- If < 0 occlusion culling is disabled.
- Defaults to -1
Accessors
publiciconCount
Number if icons.
Returns number
publicrenderGroup
Render group icons are rendered in.
Returns number
Sets the render group id 0-4 for all icons. Use this with a larger value to render it on top of other geometry in the engine.
Parameters
i: number
Returns void
Methods
publicattach
publicclear
Clears icon handler of all currently attached icons. Attached icons will be detached.
Returns void
publicdetach
publicdispose
Disposes icon handler. Call when it is no longer in use. After call the icon handler cannot be used again.
Returns void
publicforEach
Iterate over each icon in the handler. See also icons.
Parameters
action: (i: Icon) => unknown
This method will run on each icon in the handler. This is a easy way for updating its position or color.
Returns void
publicgetIconById
publicicons
Icons currently attached to IconHandler.
Returns IterableIterator<Icon>
publicsetIconAtlas
This function adds a texture and metadata about it to the icon handler. Changes are not reflected in rendering unless apply is called afterwards.
Parameters
o: IconAtlasOptions
Option in the form of IconAtlasOptions.
Returns void
Icon Handler is a class for handling a set of Icon:s. Make a instance and setIconAtlas with a texture. Then addIcons to provide a array of Icon[]. Each Icon in the handler can be updated using forEach(). Followed by update().