zincjs 1.13.2 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/zinc.frontend.js +1 -1
- package/build/zinc.js +8 -3
- package/build/zinc.js.map +1 -1
- package/package.json +1 -1
- package/src/primitives/zincObject.js +30 -0
package/package.json
CHANGED
|
@@ -61,6 +61,9 @@ const ZincObject = function() {
|
|
|
61
61
|
//Draw range is only used by primitives added
|
|
62
62
|
//programatically with addVertices function
|
|
63
63
|
this.drawRange = -1;
|
|
64
|
+
//Default value of colour
|
|
65
|
+
this.origColour = undefined;
|
|
66
|
+
this.origVertexColors = false;
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
/**
|
|
@@ -352,6 +355,33 @@ ZincObject.prototype.setColour = function(colour) {
|
|
|
352
355
|
this._lod.setColour(colour);
|
|
353
356
|
}
|
|
354
357
|
|
|
358
|
+
/**
|
|
359
|
+
* Set the colour of the mesh.
|
|
360
|
+
*
|
|
361
|
+
* @param {THREE.Color} colour - Colour to be set for this geometry.
|
|
362
|
+
*/
|
|
363
|
+
ZincObject.prototype.setGreyScale = function(flag) {
|
|
364
|
+
if (flag) {
|
|
365
|
+
if (!this.origColour) {
|
|
366
|
+
if (this._lod._material) {
|
|
367
|
+
this.origColour = this._lod._material.color;
|
|
368
|
+
this.origVertexColors = this._lod._material.vertexColors;
|
|
369
|
+
this._lod.setVertexColors(false);
|
|
370
|
+
this._lod.setColour(new THREE.Color().setHex( 0xBBBBBB ));
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
if (this.origColour) {
|
|
376
|
+
this._lod.setColour(this.origColour);
|
|
377
|
+
this._lod.setVertexColors(this.origVertexColors);
|
|
378
|
+
this.origColour = undefined;
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
|
|
355
385
|
/**
|
|
356
386
|
* Get the colour of the mesh in hex string form.
|
|
357
387
|
*
|