Class: ZincObject

ZincObject() → {ZincObject}

new ZincObject() → {ZincObject}

Provides the base object for other primitive types. This class contains multiple base methods.
Author:
  • Alan Wu
Source:
Returns:
Type
ZincObject

Members

duration

Total duration of the animation, this value interacts with the Renderer#playRate to produce the actual duration of the animation. Actual time in second = duration / playRate.
Source:

groupName

Groupname given to this geometry.
Source:

Methods

addLOD()

Add lod from an url into the lod object.
Source:

checkTransparentMesh()

Handle transparent mesh, create a clone for backside rendering if it is transparent.
Source:

dispose()

Clear this geometry and free the memory.
Source:

getBoundingBox() → {THREE.Box3}

Get the bounding box of this geometry.
Source:
Returns:
.
Type
THREE.Box3

getClosestVertex() → {THREE.Vector3}

Get the closest vertex to centroid.
Source:
Returns:
Type
THREE.Vector3

getClosestVertexDOMElementCoords() → {Object}

Get the windows coordinates.
Source:
Returns:
- position and rather the closest vertex is on screen.
Type
Object

getClosestVertexIndex() → {Number}

Get the index of the closest vertex to centroid.
Source:
Returns:
- integer index in the array
Type
Number

getColour() → {THREE.Color}

Get the colour of the mesh.
Source:
Returns:
Type
THREE.Color

getColourHex() → {String}

Get the colour of the mesh in hex string form.
Source:
Returns:
Type
String

getCurrentTime() → {Number}

Get the local time of this geometry, it returns a value between 0 and the duration.
Source:
Returns:
Type
Number

getDuration() → {Number}

Get the duration of the animation of this object.
Source:
Returns:
Type
Number

getGroup() → {Object}

Get the threejs object3D.
Source:
Returns:
Type
Object

getMorph() → {Object}

Get the threejs object3D.
Source:
Returns:
Type
Object

getRegion() → {Region}

Get the region this object belongs to.
Source:
Returns:
Type
Region

getVisibility()

Get the visibility of this Geometry.
Source:

isTimeVarying() → {Boolean}

Check if the geometry is time varying.
Source:
Returns:
Type
Boolean

markerIsEnabled() → {Boolean}

Check if marker is enabled based on the objects settings with the provided scene options.
Source:
Returns:
Type
Boolean

setAlpha(alpah)

Set the opacity of this Geometry. This function will also set the isTransparent flag according to the provided alpha value.
Parameters:
Name Type Description
alpah Number Alpha value to set for this geometry, can be any value between from 0 to 1.0.
Source:

setColour(colour)

Set the colour of the mesh.
Parameters:
Name Type Description
colour THREE.Color Colour to be set for this geometry.
Source:

setColourHex(hex)

Set the colour of the mesh using hex in string form.
Parameters:
Name Type Description
hex String The colour value in hex form.
Source:

setDuration(durationIn)

Set the duration of the animation of this object.
Parameters:
Name Type Description
durationIn Number Duration of the animation.
Source:

setEmissiveRGB(colour)

Set the emissive rgb of the mesh using rgb.
Parameters:
Name Type Description
colour String The colour value in rgb form.
Source:

setFrustumCulled(flag)

The rendering will be culled if it is outside of the frustrum when this flag is set to true, it should be set to false if morphing is enabled.
Parameters:
Name Type Description
flag Boolean Set frustrum culling on/off based on this flag.
Source:

setMarkerMode(mode) → {Boolean}

Set marker mode for this zinc object which determine rather the markers should be displayed or not.
Parameters:
Name Type Description
mode string There are three options: "on" - marker is enabled regardless of settings of scene "off" - marker is disabled regardless of settings of scene "inherited" - Marker settings on scene will determine the visibility of the marker.
Source:
Returns:
Type
Boolean

setMaterial(material)

Set the material of the geometry.
Parameters:
Name Type Description
material THREE.Material Material to be set for this geometry.
Source:

setMesh(mesh, localTimeEnabled, localMorphColour)

Set the mesh function for zincObject.
Parameters:
Name Type Description
mesh THREE.Mesh Mesh to be set for this zinc object.
localTimeEnabled Boolean A flag to indicate either the mesh is time dependent.
localMorphColour Boolean A flag to indicate either the colour is time dependent.
Source:

setMorph()

Set the internal threejs object3D.
Source:

setMorphTime(time)

Set the local time of this geometry.
Parameters:
Name Type Description
time Number Can be any value between 0 to duration.
Source:

setName(groupNameIn)

Set the name for this ZincObject.
Parameters:
Name Type Description
groupNameIn String Name to be set.
Source:

setRegion(region)

Set the region this object belongs to.
Parameters:
Name Type Description
region Region
Source:

setVertexColors(vertexColors)

Set rather a zinc object should be displayed using per vertex colour or not.
Parameters:
Name Type Description
vertexColors Boolean Set display with vertex color on/off.
Source:

setVisibility(visible)

Set the visibility of this Geometry.
Parameters:
Name Type Description
visible Boolean a boolean flag indicate the visibility to be set
Source:

updateMarker()

Update the marker's position and size based on current viewport.
Source: