lore-engine
Advanced tools
Comparing version 1.0.9 to 1.0.10
{ | ||
"name": "lore-engine", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "A WebGL based 3D data visualization engine.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/lore.js", |
@@ -6,3 +6,3 @@ ![Lore](https://github.com/reymond-group/lore/blob/master/logo.png?raw=true) | ||
# Lore | ||
Current Version: 1.0.9 ([Godzilla](https://youtu.be/RTzb-sduiWc)) | ||
Current Version: 1.0.10 ([Godzilla](https://youtu.be/RTzb-sduiWc)) | ||
@@ -9,0 +9,0 @@ ### Teasers |
@@ -74,2 +74,4 @@ //@ts-check | ||
/** | ||
@@ -181,2 +183,16 @@ * Get the r, g or b value from a hue component. | ||
/** | ||
* Encode rgba colour values as a 32-bit float. | ||
* | ||
* @static | ||
* @param {Number} r | ||
* @param {Number} g | ||
* @param {Number} b | ||
* @param {Number} a | ||
* @returns {number} A 32-bit colour encoded as a float. | ||
*/ | ||
static rgbaToFloat(r, g, b, a) { | ||
return r + g * 256.0 + b * 65536.0 + a * 16777216.0; | ||
} | ||
/** | ||
* Shifts the hue so that 0.0 represents blue and 1.0 represents magenta. | ||
@@ -183,0 +199,0 @@ * |
@@ -113,3 +113,22 @@ //@ts-check | ||
/** | ||
* Sets the fog colour and it's density, as seen from the camera. | ||
* | ||
* @param {Array} color An array defining the rgba values of the fog colour. | ||
* @param {Number} fogDensity The density of the fog. | ||
* @returns {TreeHelper} Itself. | ||
*/ | ||
setFog(color, fogDensity = 6.0) { | ||
if (!this.geometry.shader.uniforms.clearColor || !this.geometry.shader.uniforms.fogDensity) { | ||
console.warn('Shader "' + this.geometry.shader.name + '" does not support fog.'); | ||
return this; | ||
} | ||
this.geometry.shader.uniforms.clearColor.value = color; | ||
this.geometry.shader.uniforms.fogDensity.value = fogDensity; | ||
return this; | ||
} | ||
addFilter(name, filter) { | ||
@@ -116,0 +135,0 @@ filter.setGeometry(this.geometry); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44206487
32385