MeshInstanceData

class MeshInstanceData()

Object representing a Mesh instance that will be created by the client at run time. This class allows for the specification of instance specific properties of a mesh.

Constructors

Properties


Constructors

MeshInstanceData.constructor([meshId[, matrix[, instanceName[, faceColor[, lineColor[, pointColor[, creationFlags]]]]]]])
Arguments:
  • meshId (null | MeshId()) – optional the [[MeshId]] of the mesh to instantiate
  • matrix (null | Matrix()) – optional a matrix that will be applied to this instance
  • instanceName (null | string()) – optional a name that will be visible when querying the model hierarchy
  • faceColor (null | Color()) – optional the color for faces of this instance
  • lineColor (null | Color()) – optional the color for lines of this instance
  • pointColor (null | Color()) – optional the color for points of this instance
  • creationFlags (null | MeshInstanceCreationFlags()) – optional additional options that can be used to alter the behavior of this instance

Creates a new MeshInstanceData object.

Return type:MeshInstanceData

Properties

MeshInstanceData.overlayId
Type:OverlayId

The overlay for this instance.

Methods

clear

MeshInstanceData.clear()

Resets all fields of this object.

Return type:void

copy

MeshInstanceData.copy()

Creates a copy of this MeshInstanceData.

Returns:Copy of this MeshInstanceData object.
Return type:MeshInstanceData

getCreationFlags

MeshInstanceData.getCreationFlags()

Gets the mesh instance creation flags (SuppressCameraScale, DoNotExplode, DoNotLight…)

Returns:the mesh instance creation flags (null if none set)
Return type:MeshInstanceCreationFlags

getFaceColor

MeshInstanceData.getFaceColor()

Gets the color for face elements in this instance.

Returns:the color for face elements.
Return type:null | Color

getInstanceName

MeshInstanceData.getInstanceName()

Gets the name that will be applied to the instance.

Returns:the instance name.
Return type:null | string

getLineColor

MeshInstanceData.getLineColor()

Gets the color for line elements in this instance.

Returns:the color for line elements.
Return type:null | Color

getLineOpacity

MeshInstanceData.getLineOpacity()

Gets the line opacity value for this instance.

Returns:the line opacity value for this instance.
Return type:number

getMatrix

MeshInstanceData.getMatrix()

Gets the matrix to apply to this instance.

Returns:the current matrix that will be applied to this instance upon creation.
Return type:null | Matrix

getMeshId

MeshInstanceData.getMeshId()

Gets the [[MeshId]] of the mesh to use for this instance. [[MeshId]]s are created with [[Model.createMesh]] or retrieved with [[Model.getMeshIds]].

Returns:the mesh ID to use for this instance.
Return type:null | MeshId

getOpacity

MeshInstanceData.getOpacity()

Gets the face opacity value for this instance.

Returns:the face opacity value for this instance.
Return type:number

getOverlayIndex

MeshInstanceData.getOverlayIndex()

Gets the overlay index for this instance.

Returns:the overlay index for this instance, but not the associated view.
Deprecated:use [[overlayId]] instead.
Return type:number

getPointColor

MeshInstanceData.getPointColor()

Gets the color for point elements in this instance.

Returns:the color for point elements.
Return type:null | Color

getPointOpacity

MeshInstanceData.getPointOpacity()

Gets the point opacity value for this instance.

Returns:the point opacity value for this instance.
Return type:number

setCreationFlags

MeshInstanceData.setCreationFlags(flags)
Arguments:
  • flags (MeshInstanceCreationFlags()) – creation flags

Sets the mesh instance creation flags (SuppressCameraScale, DoNotExplode, DoNotLight…)

Return type:void

setFaceColor

MeshInstanceData.setFaceColor(faceColor)
Arguments:
  • faceColor (Color()) – the color to apply to face elements.

Sets the color for face elements in this instance.

Return type:void

setInstanceName

MeshInstanceData.setInstanceName(instanceName)
Arguments:
  • instanceName (string()) – the name to assign to this instance.

Sets the name that will be assigned to this instance. This name will be visible when querying the model hierarchy.

Return type:void

setLineColor

MeshInstanceData.setLineColor(lineColor)
Arguments:
  • lineColor (Color()) – the color to apply to line elements.

Sets the color for line elements in this instance.

Return type:void

setLineOpacity

MeshInstanceData.setLineOpacity(lineOpacity)
Arguments:
  • lineOpacity (number()) – opacity value to set.

Sets the line opacity for this instance.

Return type:void

setMatrix

MeshInstanceData.setMatrix(matrix)
Arguments:
  • matrix (Matrix()) – the matrix to apply.

Sets the matrix that will be applied to this instance.

Return type:void

setMeshId

MeshInstanceData.setMeshId(meshId)
Arguments:
  • meshId (MeshId()) – the [[MeshId]] to use.

Sets the [[MeshId]] of the mesh to use for the instance. [[MeshId]]s are created with [[Model.createMesh]] or retrieved with [[Model.getMeshIds]].

Return type:void

setOpacity

MeshInstanceData.setOpacity(faceOpacity)
Arguments:
  • faceOpacity (number()) – opacity value to set.

Sets the face opacity for this instance.

Return type:void

setOverlayIndex

MeshInstanceData.setOverlayIndex(overlayIndex)
Arguments:
  • overlayIndex (number()) – overlay index to set.

Sets the overlay index for this instance but doesn’t change the associated view.

Deprecated:use [[overlayId]] instead.
Return type:void

setPointColor

MeshInstanceData.setPointColor(pointColor)
Arguments:
  • pointColor (Color()) – the color to apply to point elements.

Sets the color for point elements in this instance.

Return type:void

setPointOpacity

MeshInstanceData.setPointOpacity(pointOpacity)
Arguments:
  • pointOpacity (number()) – opacity value to set.

Sets the point opacity for this instance.

Return type:void