Hierarchy

  • UnityUtil

Calibration

Clipping Plane

Compare Tool

Configurations

Configurations Quits unity instance & reset all custom callback and promises

GIS

Measuring tool

Model Interactions

Navigations

Object Highlighting

Other

Pins

Streaming

Calibration

  • Activates the Gizmo for the specified vertical plane, or none, if a valid plane is not given.

    Parameters

    • plane: "upper" | "lower"

    Returns void

  • Shows 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.

    Parameters

    • image: DrawingImageSource
    • rect: number[]

    Returns void

  • Sets the default height of the floor used when calling setCalibrationToolFloorToObject, in meters.

    Parameters

    • height: number

    Returns void

  • Aligns 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.

    Parameters

    • teamspace: string
    • modelid: string
    • meshid: string

    Returns void

  • Sets 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.

    Parameters

    • mode: string

      A string, ["Vector", "Vertical", "None"].

    Returns void

  • Sets 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.

    Parameters

    • opacity: number

    Returns void

  • Sets 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.

    Parameters

    • start: number[]
    • end: number[]

    Returns void

  • Sets 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.

    Parameters

    • plane: "upper" | "lower"
    • fill: string
    • border: string
    • drawing: string

    Returns void

  • Sets the lower and upper range of the vertical planes (the floor) in Project coordinates. This does not change the default floor height even if the magnitude of the range is different.

    Parameters

    • min: number
    • max: number

    Returns void

Clipping Plane

  • Move 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.

    Returns void

  • Hide all the clip planes, and reset them to the scene bounding box

    Returns void

  • Puts 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.

    Returns void

  • Puts the Clip Planes Gizmo in Rotate mode.

    Returns void

  • Puts the Clip Planes Gizmo in Scale mode.

    Returns void

  • Puts the Clip Planes Gizmo into Translate mode.

    Returns void

  • Disables the inbuilt Clip Tool Toolbar, if it was previously enabled via enableClipToolbar.

    Returns void

  • Enables the inbuilt Clip Tool Toolbar. The toolbar is always disabled by default. This may need to be called on embedded viewers that don't have the full frontend UX.

    Returns void

  • Increase or decrease the Gizmo Size on screen by the amount provided (in percent)

    Parameters

    • percent: number

    Returns void

  • Set the coefficient linking the change in Clip Box Size to proportion of the screen covered by the cursor when scaling in all three axes.

    Parameters

    • speed: number

    Returns void

  • Sets 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.

    Parameters

    • scalar: number

    Returns void

  • Start clip editing in box mode

    Returns void

  • Start editing mode with current clip plane state

    Returns void

  • Start clip editing in single plane mode

    Returns void

Compare Tool

  • When Compare tool is enabled, visalise in differencing view Models will be rendered in greyscale, detailing the difference/clash

    Returns void

  • Disable compare tool This also unloads the comparator models

    Returns void

  • Enable compare tool This starts the compare tool in clash mode

    Returns void

  • Enable compare tool This starts the compare tool in diff mode

    Returns void

  • Load comparator model for compare tool This returns a promise which will be resolved when the comparator model is loaded

    Parameters

    • teamspace: string

      teamspace

    • project: string

      project

    • container: string

      model ID

    • revision: string = 'head'

      Specific revision ID/tag to load

    Returns Promise<void>

    returns a promise that resolves upon comparator model finished loading.

  • Compare transparent objects as of normal

    Returns void

  • Ignore semi-transparent objects in diff

    Returns void

  • Compare transparent objects as if they are opaque objects

    Returns void

  • Set 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)

    Parameters

    • teamspace: string

      name of teamspace

    • project: string
    • container: string

      model ID

    Returns void

  • Set tolerance threshold. In general you should not need to tweak this, but if the differencing looks off, this is the value to tweak

    Parameters

    • theshold: number

      tolerance level for diffing/clashing

    Returns void

  • Only show the base model i.e. It will show only the original model, not the comparator nor the diff view *

    Returns void

  • Only show the comparator model i.e. Only show the model you are trying to compare with, not the base model

    Returns void

Configurations

  • Reset viewer background to default

    Returns void

  • Disable Cursor Note: Changing the snap mode can affect the cursor. Call this after setting snapping.

    Returns void

  • Disable model caching *

    Returns void

  • Tells the viewer to disable textures. This means at runtime Textures will not be loaded with Geometry even where available.

    Returns void

  • Enable Cursor Note: Changing the snap mode can affect the cursor. Call this after setting snapping.

    Returns void

  • Enable model caching *

    Returns void

  • Enable snapping to snap the cursor to the closest edge

    Returns void

  • Enable soft shadows - the highest shadow quality

    Returns void

  • Tells the viewer to enable Textures if they have previously been disabled. Any Geometry already loaded must be reloaded for Textures to show.

    Returns void

  • Hide x y z coordinates of current point

    Returns void

  • Hide progress bar while model is loading

    Returns void

  • Initialise Unity.

    Parameters

    • errorCallback: any

      function to call when an error occurs. This function should take a string(message), boolean(requires reload), boolean(came from unity).

    • progressCallback: any
    • modelLoaderProgressCallback: any

    Returns void

  • Loading 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]]

    Parameters

    • teamspace: string

      name of teamspace

    • project: string

      ID of the project

    • model: string

      name of model

    • revision: string = 'head'

      ID of revision

    • isFederation: boolean = false

      flag signaling whether the model is a container or a federation

    • initView: any = null
    • clearCanvas: boolean = true

    Returns Promise<void>

    returns a promise that resolves when the model start loading.

  • Launch the Unity Game. *

    Parameters

    Returns Promise<void>

    returns a promise which resolves when the game is loaded.

  • Offload a model that is currently loaded

    Parameters

    • account: string

      name of teamspace

    • model: string

      name of model

    • revision: string = 'head'

      ID of revision

    Returns void

  • Enables the Pause Rendering feature of the viewer - when the camera is not moving, the main scene will not be redrawn.

    Returns void

  • Clear the canvas and reset all settings

    Parameters

    • resetProjection: boolean = true

    Returns void

  • Disables the Pause Rendering feature of the viewer - the entire scene will render every frame regardless of camera behaviour.

    Returns void

  • Set API host urls. This is needs to be called before loading model.

    Parameters

    Returns void

  • Set API key to use for authentication. Ensure setAPIHost is called before this.

    Parameters

    • apiKey: string

    Returns void

  • Change the background colour of the viewer note: alpha defaults to 1 if an array of 3 numbers is sent

    Parameters

    • color: number[]

      rgba colour value to set to e.g.[1,0,0,1] for solid red.

    Returns void

  • Sets the scale factor that controls the thickness of the axis arrows or arches of the Gizmo. Default scale is 1.0

    Parameters

    • newScale: number

    Returns void

  • Sets the scale factor used by the Gizmos that determines how precise the user needs to be to select the axis arrow or arch. Default scale is 1.0

    Parameters

    • newScale: number

    Returns void

  • Sets the size that the Gizmo will take up on the screen. Default value is 80

    Parameters

    • newSize: number

    Returns void

  • Sets the size that the clip plane proxy in single plane mode will take up on the screen. Default value is 180

    Parameters

    • newSize: number

    Returns void

  • Set the default near plane value. This can be use to tweak situations where geometry closest to you are being clipped

    Parameters

    • value: number

      the closest distance (in model units) the camera will render.

    Returns void

  • How many non-trivial jobs the viewer can complete per frame when the camera is moving

    Parameters

    • numJobs: number

    Returns void

  • How many non-trivial jobs the viewer can complete per frame when the camera isnt moving

    Parameters

    • numJobs: number

    Returns void

  • Sets the maximum number of responses WebRequestManager2 should attempt to handle at any one time. The higher this is the faster models will load but the more working memory is required. The default value is 5.

    Parameters

    • max: number

    Returns void

  • Set the maximum rending distance for shadows. Smaller value may increase shadow quality.

    Parameters

    • value: number

      The maximum distance (in model units) the renderer will render shadows for

    Returns void

  • Sets the render quality to default

    Returns void

  • Set the units By default, units are set to mm. This is used for GIS and measuring tool.

    Parameters

    • units: any

      i.e. "m", "mm", "ft" etc.

    Returns void

  • Show x y z coordinates of current point

    Returns void

  • Show progress bar while model is loading

    Returns void

  • Toggle on/off rendering statistics. When it is toggled on, list of stats will be displayed in the top left corner of the viewer.

    Returns void

  • Use orthographic view

    Returns void

  • Use perspective view

    Returns void

  • Zoom to a set of objects specified by their Ids

    Parameters

    • meshEntries: {
          entries: {
              meshes: string[];
              modelId: string;
              teamspace: string;
          }[];
      }
      • entries: {
            meshes: string[];
            modelId: string;
            teamspace: string;
        }[]

    Returns void

Configurations Quits unity instance & reset all custom callback and promises

GIS

  • Add map source.

    Parameters

    • mapSource: string

      This can be "OSM", "HERE", "HERE_AERIAL", "HERE_TRAFFIC", "HERE_TRAFFIC_FLOW"

    Returns void

  • Initialise map tiles within unity

    Parameters

    • surveyingInfo: [object]

      array of survey points and it's respective latitude and longitude value

    Returns void

  • Remove map source.

    Parameters

    • mapSource: string

      This can be "OSM", "HERE", "HERE_AERIAL", "HERE_TRAFFIC", "HERE_TRAFFIC_FLOW"

    Returns void

  • Reset map sources. This removes all currently displayed maps

    Returns void

Measuring tool

  • Add a specific measurment to the scene.

    Parameters

    • measurement: any

    Returns void

  • Clear all measurements

    Returns void

  • Remove a particular measurement.

    Parameters

    • uuid: any

      The measurement id of the measurement to be removed

    Returns void

  • Deselect a measurement

    Parameters

    • id: string

    Returns void

  • Enable the measure tool toolbar.

    Returns void

  • Disable measure display mode to xyz.

    Returns void

  • Disable the Measuring tool.

    Returns void

  • Enable the measure tool toolbar.

    Returns void

  • Enable measure display mode to xyz.

    Returns void

  • Enable measuring tool. This will allow you to start measuring by clicking on the model

    Returns void

  • Newly created measurements do not have labels.

    Returns void

  • Select a measurement

    Parameters

    • id: string

    Returns void

  • Set color of a particular measurement.

    Parameters

    • uuid: any

      The measurement id of the measurement that will change color

    • color: any

    Returns void

  • Set color of a particular measurement.

    Parameters

    • uuid: any

      The measurement id of the measurement that will change name

    • name: any

    Returns void

  • Set the measure tool mode.

    Parameters

    • mode: any

      The measuring mode, accepted values are "Point", "Raycast", "MinimumDistance", "SurfaceArea", "PolygonArea", "PolyLine", "Angle" or "Slope".

    Returns void

  • Set the measure tool units for the slope measurements.

    Parameters

    • units: any

      The measuring units accepted values are "Degrees", "Percentage"

    Returns void

  • Set the measure tool units.

    Parameters

    • units: any

      The measuring units accepted values are "cm", "mm", "m"

    Returns void

  • Newly created measurements have labels visible

    Returns void

Model Interactions

  • Reset clipping plane This will also toggle edit mode to false

    Returns void

  • Get 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.

    Parameters

    • account: string

      name of teamspace

    • model: string

      name of the model

    Returns Promise<object>

  • Hide objects that are hidden by default (e.g. IFCSpaces)

    Returns void

  • Move mesh/meshes by a given transformation matrix. NOTE: this currently only works as desired in Synchro Scenarios

    Parameters

    • teamspace: string

      teamspace of the model

    • modelId: string

      modelID the meshes belongs in

    • meshes: string[]

      array of mesh unique IDs

    • matrix: number[]

      array of 16 numbers, representing the transformation on the meshes (row major)

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its moveMeshes function

  • Request a screenshot. The screenshot will be returned as a JSON object with a single field, ssByte, containing the screenshot in base64.

    Returns Promise<object>

    returns a promise which will resolve with an object with a screenshot in base64 format

  • Request the information of the current viewpoint

    Parameters

    • account: string

      name of teamspace

    • model: string

      name of model

    Returns Promise<any>

    returns a promises which will resolve with the viewpoint information

  • Move mesh/meshes by a given transformation matrix. NOTE: this currently only works as desired in Synchro Scenarios

    Parameters

    • teamspace: string

      teamspace of the model

    • modelId: string

      modelID the meshes belongs in

    • meshes: string[]

      array of mesh unique IDs

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its resetMovedMeshes function

  • Sets the navigations interaction off

    Returns any

  • Sets the navigations interaction on

    Returns any

  • Change the colour of the clipping planes border

    Parameters

    • color: number[]

    Returns void

  • Change the width of the clipping planes border

    Parameters

    • width: number

      the width of the clipping plane border

    Returns void

  • Sets the render quality to high

    Returns void

  • Sets the highlighting to show xray

    Returns any

  • Sets the highlighting to show xray

    Returns any

  • Make all hidden by default objects visible (typically IFC Spaces)

    Returns void

  • Toggle visibility of the given list of objects

    Parameters

    • account: string

      name of teamspace

    • model: string

      name of model

    • ids: [string]

      list of unique ids to toggle visibility

    • visibility: boolean

      true = visible, false = invisible

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its toggleVisibility function

  • Update 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.

    Parameters

    • clipPlane: any

      object containing the clipping plane

    • requireBroadcast: boolean

      if set to true, A callback to [[viewer]].clipBroadcast will be called after it is set.

    • Optional account: string

      name of teamspace

    • Optional model: string

      name of model

    Returns void

    Example

    UnityUtil.updateClippingPlanes([{normal : [0,-1,0], distance: 10, clipDirection: -1}], false)
    
  • Zoom to highlighted meshes

    Returns void

Navigations

  • Reset the viewpoint to the back of the model.

    Returns void

  • Reset the viewpoint to Bottom up view.

    Returns void

  • Move the pivot point to the centre of the objects provided

    Parameters

    • meshIDs: {
          meshID: string[];
          model: string;
      }[]

      array of json objects each recording { model: <account.modelID>, meshID: [array of mesh IDs] }

    Returns void

  • Reset the viewpoint to the front of the model.

    Returns void

  • Decrease the speed of Helicopter navigation (by x0.75)

    Returns void

  • Reset the speed of Helicopter navigation

    Returns void

  • Increase the speed of Helicopter navigation (by x1.25)

    Returns void

  • Reset the viewpoint to the left side of the model.

    Returns void

  • Reset the viewpoint to ISO view.

    Returns void

  • Reset the viewpoint to the right side of the model.

    Returns void

  • Set navigation mode.

    Parameters

    • navMode: any

      This can be either "HELICOPTER" or "TURNTABLE"

    Returns void

  • Change the camera configuration teamspace and model is only needed if the viewpoint is relative to a model

    Parameters

    • pos: [number]

      3D point in space where the camera should be

    • up: [number]

      Up vector

    • forward: [number]

      forward vector

    • lookAt: [number]

      point in space the camera is looking at. (pivot point)

    • Optional projectionType: boolean
    • Optional orthographicSize: number
    • Optional account: string

      name of teamspace

    • Optional model: string

      name of model

    • Optional animationTime: number

      how long the camera should spend during the transition from the current viewpoint to this one

    Returns void

  • Reset the viewpoint to Top down view.

    Returns void

Object Highlighting

  • Clear all highlighting on currently highlighted objects

    Returns void

  • Highlight objects

    Parameters

    • account: string

      name of teamspace

    • model: string

      name of model

    • idArr: string[]

      array of unique IDs associated with the objects to highlight

    • color: [number]

      RGB value of the highlighting colour

    • toggleMode: boolean

      If set to true, existing highlighted objects will stay highlighted. Also any objects that are already highlighted will be unhighlighted

    • forceReHighlight: boolean

      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 Promise<unknown>

    returns a promise which will resolve after Unity has invoked its highlightObjects function

  • Override the colour of given object(s)

    Parameters

    • account: string

      teamspace the meshes resides in

    • model: string

      model ID the meshes resides in

    • meshIDs: [string]

      unique IDs of the meshes to operate on

    • color: [number]

      RGB value of the override color (note: alpha will be ignored)

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its overrideMeshColor function

  • Override the alpha value of given object(s) If you are setting opacity to 0, use toggleVisibility instead.

    Parameters

    • account: string

      teamspace the meshes resides in

    • model: string

      model ID the meshes resides in

    • meshIDs: [string]

      unique IDs of the meshes to operate on

    • opacity: number

      opacity (>0 - 1) value to override with

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its overrideMeshOpacity function

  • Restore the meshes to its original color values

    Parameters

    • account: string

      teamspace the meshes resides in

    • model: string

      model ID the meshes resides in

    • meshIDs: [string]

      unique IDs of the meshes to operate on

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its resetMeshColor function

  • Reset override alpha value of given object(s)

    Parameters

    • account: string

      teamspace the meshes resides in

    • model: string

      model ID the meshes resides in

    • meshIDs: [string]

      unique IDs of the meshes to operate on

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its resetMeshOpacity function

  • Start rectangular select

    Returns void

  • Stop rectangular select

    Returns void

  • Unhighlight objects

    Parameters

    • account: string

      name of teamspace

    • model: string

      name of model

    • idArr: string[]

      array of unique IDs associated with the objects to highlight

    Returns Promise<unknown>

    returns a promise which will resolve after Unity has invoked its unhighlightObjects function

Other

indexedDBAvailable: boolean = true

Start by assuming IndexedDB is available. If there are any access failures during the preamble, then this will be set to false.

unityBuildSubdirectory: any

A 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"

unityOnUpdateActions: any[] = []

Contains a list of calls to make during the Unity Update method. One call is made per Unity frame.

verbose: boolean = false
viewer: any

viewer 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.

Example

UnityUtil.viewer = {
numClipPlanesUpdated = (nPlanes) => console.log(`Current no. planes: ${nPlanes}`}
  • Checks if access to IndexedDb is available, and updates the indexedDBAvailable flag accordingly.

    Returns Promise<void>

  • Removes the IndexedDb database /idbfs, which emulates a synchronous filesystem. The viewer should not store anything use the File API between runs.

    Returns Promise<void>

  • Returns a promise that lets you know when the model has finished loading.

    Returns Promise<object>

    returns a Promise that resolves when the model has finished loading. The Promise returns the bounding box of the model.

    Category

    State Queries

  • Returns a promise that lets you know when the model has started to load

    Returns Promise<void>

    returns a Promise that resolves when the model has started to load

    Category

    State Queries

  • Returns a promise that lets you know when the game is loaded.

    Returns Promise<void>

    returns a Promise that resolves when the game is loaded.

    Category

    State Queries

  • Called from within the viewer on each Unity frame.

    Returns void

  • When 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.

    Parameters

    • enable: boolean

    Returns void

  • Parameters

    • value: number

    Returns void

  • Parameters

    • value: number

    Returns void

  • Returns the relative path of the Unity Loader to the current domain

    Returns string

Pins

  • Change the colour of an existing pin

    Parameters

    • id: string

      ID of the pin

    • colour: number[]

      colour RGB value of the colour to change to. e.g. [1, 0, 0]

    Returns void

  • Deselect a selected Pin by Id

    Parameters

    • id: string

    Returns void

  • Add a bookmark pin

    Parameters

    • id: string

      Identifier for the pin

    • position: number[]

      point in space where the pin should generate

    • normal: number[]

      normal vector for the pin (note: this is no longer used)

    • colour: number[]

      RGB value for the colour of the pin

    Returns void

  • Add an issue pin

    Parameters

    • id: string

      Identifier for the pin

    • position: number[]

      point in space where the pin should generate

    • normal: number[]

      normal vector for the pin (note: this is no longer used)

    • colour: number[]

      RGB value for the colour of the pin

    Returns void

  • Add a Risk pin

    Parameters

    • id: string

      Identifier for the pin

    • position: number[]

      point in space where the pin should generate

    • normal: number[]

      normal vector for the pin (note: this is no longer used)

    • colour: number[]

      RGB value for the colour of the pin

    Returns void

  • Add a ticket pin

    Parameters

    • id: string

      Identifier for the pin

    • position: number[]

      point in space where the pin should generate

    • normal: number[]

      normal vector for the pin (note: this is no longer used)

    • colour: number[]

      RGB value for the colour of the pin

    Returns void

  • Remove a pin from the viewer

    Parameters

    • id: string

      pin identifier

    Returns void

  • Select a Pin by Id

    Parameters

    • id: string

    Returns void

Streaming

  • Sets the colour of the bounding boxes representing yet-to-be-loaded Supermeshes

    Parameters

    • colour: number[]

    Returns void

    Code

    UnityUtil.setStreamingBundlesColor([0.2,0.8,0.2]);

  • Sets the transparency of the Supermesh Bounding Boxes faces/sides. Setting both this and the Lines Alpha to zero will disable the Supermesh Bounds.

    Parameters

    • alpha: number

    Returns void

  • Sets the three parameters that control the fade in and out of the Supermesh bounding boxes based on camera distance

    Parameters

    • distance: number

      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.)

    • bias: number

      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.

    • power: number

      how sharply the fade out occurs

    Returns void

    Code

    UnityUtil.SetStreamingBundlesFade(0.7,1.6,5);

  • Sets the transparency of the Supermesh Bounding Boxes edges/outlines. Setting both this and the Faces Alpha to zero will disable the Supermesh Bounds.

    Parameters

    • alpha: number

    Returns void

  • Sets the colour of the bounding boxes representing yet-to-be-loaded individual model elements

    Parameters

    • colour: number[]

    Returns void

    Code

    UnityUtil.setStreamingElementsColor([0.2,0.8,0.2]);

  • Sets the transparency of the Elements Bounding Boxes faces/sides. Setting both this and the Lines Alpha to zero will disable the Elements Bounds.

    Parameters

    • alpha: number

    Returns void

  • Sets the transparency of the Elements Bounding Boxes edges/outlines. Setting both this and the Faces Alpha to zero will disable the Elements Bounds.

    Parameters

    • alpha: number

    Returns void

  • Sets the radius - as fraction of the camera near/far plane - within which the bounding boxes of individual yet-to-be-loaded elemenets should be drawn.

    Parameters

    • radius: number

      the distance from the camera towards the far plane, between 0 and 1.

    Returns void

  • Adjusts how the visibilty of a Supermesh affects its priority when deciding whether or not to load it.

    Parameters

    • weight: number

    Returns void

  • The 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).

    Parameters

    • thresholdInMb: number

    Returns void

  • Adjusts the correction factor applied to mesh size estimates to account for Unity overheads.

    Parameters

    • factor: number

    Returns void

  • Sets the priority of a model namespace (making it higher or lower than the others). This can be used for example to ensure a model always loads fully, at the expense of others.

    Parameters

    • modelNamespace: string
    • priority: number

    Returns void

  • Tells the viewer the maximum amount of memory it can expect to be able to allocate for its heap. 0 means the maximum amount that the browser can handle, determined by hueristics in this method.

    Parameters

    • maxMemoryInMb: number

    Returns void

Generated using TypeDoc