Factory which creates SKARF.ArLibs
NOTE: This is meant for internal usage only as the created instance needs some manual variable assignments and initializations before they are usable. These are done internally by a
NOTE: This is meant for internal usage only as the created instance needs some manual variable assignments and initializations before they are usable. These are done internally by a
Skarf
instance.Methods
-
<static> create(type, options)
-
Function to create a SKARF.ArLib instance
Parameters:
Name Type Description type
string Type of ArLib to create: 'jsartoolkit', 'jsaruco' options
object Options Properties
Name Type Argument Default Description trackingElem
canvas Canvas DOM element used for tracking markerSize
number Size of marker in mm, determines scale of scene mainMarkerId
number ID of main marker verticalFov
number <optional>
Vertical field-of-view of web cam (you will have to estimate this). If this is not defined, it will use use some default field-of-view which works in general for web cams. threshold
number <optional>
128 Threshold value for turning tracking stream into a binary image. Ranges from 0 to 255. Used only for JSARToolKit. debug
boolean <optional>
false Whether to turn on debug view/mode -
<static> register(mappingName, mappingClass)
-
Registers a type string to a class
Parameters:
Name Type Description mappingName
string Name of the mapping which is used to identify the type when creating instances e.g. 'jsartoolkit' mappingClass
SKARF.ArLib ArLib class that will be created when the associated type is used