Static selectStatic setShows the DrawingImageSource for the Lower and Upper vertical planes at the horizontal location specified by rect. rect should be the size and location of the image, given as the location of three corners (bottomLeft, bottomRight, topLeft) in Project coordinates. The height will be taken from the current state of the Vertical Planes. If image is null, the location of the existing image is updated. If no image has ever been loaded, a white rectangle is shown in its place.
Static setStatic setAligns the Lower floor plane to the top of the specified mesh, and the Upper floor plane to the default floor height above this. The interactive state of the planes is unchanged.
Static setSets and enables the active Calibration Mode. There is no need to explicitly enable or disable the Calibration Tool. Enabling Vertical Mode will store the current clip planes, and disabling it will restore them - the frontend must disable the Clip Tool itself however.
A string, ["Vector", "Vertical", "None"].
Static setSets the additional transparency that is applied, as a multiplier, to the image tint colour set by setCalibrationToolSelectedColors or setCalibrationToolUnselectedColors when part of the preview plane is obscured by model geometry. This should be between 0 and 1.
Static setSets or removes the Start and End of the Calibration Vector. If Start or End are set to null, the tool will immediately allow the user to place them again. Vector Mode must be explicitly enabled - calling this will not automatically enable the tool.
Static setSets the colour scheme of the image preview plane, for the specific level. All three colours should be provided as HTML colour strings (see: https://docs.unity3d.com/ScriptReference/ColorUtility.TryParseHtmlString.html) fill is the tint applied to the image, including the background. border is the colour of the border around the image. drawing is the tint applied to the image, before the background.
All three arguments support alpha values. For example, setting drawing to #00000000 and fill to #ff000008 would result in a purely red plane with an alpha value of 0.5 compared to the geometry.
Static setStatic clipMove the clipping planes to the current selection (highlighted objects). In single plane mode this moves along the normal so that the selected object(s) are fully visible. In six plane mode, the planes move to encompass the selection exactly, retaining their orientation.
Static clipStatic clipStatic clipPuts the clip tool in Realign mode. In this mode the plane (or front of the box in six plane mode) will snap to the position and orientation of the first surface to be clicked. If the background is clicked, the planes or plane will reset to the scene bounding box.
Static clipStatic clipStatic clipStatic disableStatic enableStatic scaleStatic setStatic setSets the coefficient that defines how much the clip box should be oversized when using the clip to selection function. The box is oversized to prevent the clip border being immediately visible. Setting this to 1 sets it to the default. Above 1 makes it larger and below 1 makes it smaller. 0 disables the feature.
Static startStatic startStatic startStatic stopStatic diffStatic diffStatic diffStatic diffStatic diffLoad comparator model for compare tool This returns a promise which will be resolved when the comparator model is loaded
teamspace
project
model ID
Specific revision ID/tag to load
returns a promise that resolves upon comparator model finished loading.
Static diffStatic diffStatic diffStatic diffSet an existing submodel/model as a comparator model This will return as a base model when you have cleared the comparator (i.e. disabled diff)
name of teamspace
model ID
Static diffStatic diffStatic diffStatic ResetStatic disableStatic disableStatic disableStatic disableStatic disableStatic enableStatic enableStatic enableStatic enableStatic enableStatic enableStatic hideStatic hideStatic initInitialise Unity.
function to call when an error occurs. This function should take a string(message), boolean(requires reload), boolean(came from unity).
Static loadLoading another model. NOTE: this will also clear the canvas of existing models Use branch = master and revision = head to get the latest revision. If you want to know when the model finishes loading, use [[onLoaded]]
name of teamspace
ID of the project
name of model
ID of revision
flag signaling whether the model is a container or a federation
returns a promise that resolves when the model start loading.
Static loadLaunch the Unity Game. *
the html dom of the unity canvas
host server URL (e.g. https://www.3drepo.io)
returns a promise which resolves when the game is loaded.
Static offStatic pauseStatic resetStatic resumeStatic setAPIHostSet API host urls. This is needs to be called before loading model.
list of API names to use in an object. (e.g ["https://api1.www.3drepo.io/api/"])
Static setAPIKeyStatic setStatic setStatic setStatic setStatic setStatic setStatic setStatic setStatic setStatic setStatic setStatic setStatic showStatic showStatic toggleStatic useStatic useStatic zoomZoom to a set of objects specified by their Ids
Static quitStatic addStatic mapStatic mapStatic mapStatic removeStatic resetStatic addStatic clearStatic clearStatic deselectStatic disableStatic disableStatic disableStatic enableStatic enableStatic enableStatic hideStatic selectStatic setStatic setStatic setStatic setStatic setStatic showStatic disableStatic getGet Object Status within the viewer. This will return you the list of objects that are currently set invisible, and a list of object that are currently highlighted.
The object status will be returned via the promise provided.
name of teamspace
name of the model
Static hideStatic moveMove mesh/meshes by a given transformation matrix. NOTE: this currently only works as desired in Synchro Scenarios
teamspace of the model
modelID the meshes belongs in
array of mesh unique IDs
array of 16 numbers, representing the transformation on the meshes (row major)
returns a promise which will resolve after Unity has invoked its moveMeshes function
Static requestStatic requestStatic resetMove mesh/meshes by a given transformation matrix. NOTE: this currently only works as desired in Synchro Scenarios
teamspace of the model
modelID the meshes belongs in
array of mesh unique IDs
returns a promise which will resolve after Unity has invoked its resetMovedMeshes function
Static setSets the navigations interaction off
Static setSets the navigations interaction on
Static setStatic setStatic setStatic setXRayStatic setXRayStatic showStatic toggleToggle visibility of the given list of objects
name of teamspace
name of model
list of unique ids to toggle visibility
true = visible, false = invisible
returns a promise which will resolve after Unity has invoked its toggleVisibility function
Static updateUpdate the clipping plane to the given direction teamspace and model is only needed if the viewpoint is relative to a model Clipping plane is defined by the plane normal, distance from origin and it's direction direction = -1 means it will clip anything above the plane, 1 otherwise.
object containing the clipping plane
if set to true, A callback to [[viewer]].clipBroadcast will be called after it is set.
Optional account: stringname of teamspace
Optional model: stringname of model
UnityUtil.updateClippingPlanes([{normal : [0,-1,0], distance: 10, clipDirection: -1}], false)
Static zoomStatic backStatic bottomStatic centreStatic frontStatic helicopterStatic helicopterStatic helicopterStatic leftStatic resetStatic rightStatic setSet navigation mode.
This can be either "HELICOPTER" or "TURNTABLE"
Static setChange the camera configuration teamspace and model is only needed if the viewpoint is relative to a model
3D point in space where the camera should be
Up vector
forward vector
point in space the camera is looking at. (pivot point)
Optional projectionType: booleanOptional orthographicSize: numberOptional account: stringname of teamspace
Optional model: stringname of model
Optional animationTime: numberhow long the camera should spend during the transition from the current viewpoint to this one
Static topStatic clearStatic highlightHighlight objects
name of teamspace
name of model
array of unique IDs associated with the objects to highlight
RGB value of the highlighting colour
If set to true, existing highlighted objects will stay highlighted. Also any objects that are already highlighted will be unhighlighted
If set to true, existing highlighted objects will be forced to re-highlight itself. This is typically used for re-colouring a highlight ] or when you want a specific set of objects to stay highlighted when toggle mode is on
returns a promise which will resolve after Unity has invoked its highlightObjects function
Static overrideOverride the colour of given object(s)
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
RGB value of the override color (note: alpha will be ignored)
returns a promise which will resolve after Unity has invoked its overrideMeshColor function
Static overrideOverride the alpha value of given object(s) If you are setting opacity to 0, use toggleVisibility instead.
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
opacity (>0 - 1) value to override with
returns a promise which will resolve after Unity has invoked its overrideMeshOpacity function
Static resetRestore the meshes to its original color values
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
returns a promise which will resolve after Unity has invoked its resetMeshColor function
Static resetReset override alpha value of given object(s)
teamspace the meshes resides in
model ID the meshes resides in
unique IDs of the meshes to operate on
returns a promise which will resolve after Unity has invoked its resetMeshOpacity function
Static startStatic stopStatic unhighlightUnhighlight objects
name of teamspace
name of model
array of unique IDs associated with the objects to highlight
returns a promise which will resolve after Unity has invoked its unhighlightObjects function
Static Private indexedDBAvailableStart by assuming IndexedDB is available. If there are any access failures during the preamble, then this will be set to false.
Static unityA URL containing the subfolder under unityUrl where the Unity build and its associated dependencies can be found. This should usually be set to "/unity/Build"
Static unityContains a list of calls to make during the Unity Update method. One call is made per Unity frame.
Static verboseStatic viewerviewer can be assigned, containing any callback function the user wishes to hook onto. The following functions are supported:
viewer.clipBroadcast(object): Called when a clipping plane broadcast occurs with the new clipping plane information
viewer.numClipPlanesUpdated(int): Called when the number of clipping planes changed, with the latest number of clipping planes in place
viewer.objectSelected(object): Notify the user which object/pin is clicked after a mouse event
viewer.objectsSelected(object): Notify the user which objects is selected after a rectangular select event
viewer.pickPointEvent(object): Notify the user what position within the 3D world was clicked after a mouse event.
UnityUtil.viewer = {
numClipPlanesUpdated = (nPlanes) => console.log(`Current no. planes: ${nPlanes}`}
Static Private checkStatic Private clearStatic onStatic onStatic onStatic onStatic setWhen true, moving the camera will push the clip gizmo around from the edges of the screen so that it remains in view, so long as the clip plane is in front of the camera, so it doesn't need to pulled around manually during navigation. The gizmo will also be constrained to the bounds of the model. This only takes effect in single-plane mode.
Static setStatic setStatic unityStatic changeStatic deselectStatic dropAdd a bookmark pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Static dropAdd an issue pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Static dropAdd a Risk pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Static dropAdd a ticket pin
Identifier for the pin
point in space where the pin should generate
normal vector for the pin (note: this is no longer used)
RGB value for the colour of the pin
Static removeStatic selectStatic setStatic setStatic setSets the three parameters that control the fade in and out of the Supermesh bounding boxes based on camera distance
how quickly the bounds fade-in with respect to the distance from the camera (to the far plane). (Does not have to be between 0 and 1 - making it larger will make the fade in more gradual.)
distance from the far plane that the bounds should start to fade out. When this is zero the bounds will not fade out. Should otherwise be above 1.
how sharply the fade out occurs
UnityUtil.SetStreamingBundlesFade(0.7,1.6,5);
Static setStatic setStatic setStatic setStatic setStatic setStatic setThe amount of space the geometry streaming should leave in the unmanaged heap. The unmanaged heap is not measured directly, but considered to be the space between the top of the Unity heap (typically 2Gb) and the top of the managed heap. (The available space for geometry will shrink dynamically as the managed heap grows, always leaving thresholdInMb available to Unity for other uses).
Static setStatic setStatic setGenerated using TypeDoc
Activates the Gizmo for the specified vertical plane, or none, if a valid plane is not given.