lore-engine
Advanced tools
Comparing version 1.1.10 to 1.1.20
{ | ||
"name": "lore-engine", | ||
"version": "1.1.10", | ||
"version": "1.1.20", | ||
"description": "A WebGL based 3D data visualization engine.", | ||
@@ -40,2 +40,2 @@ "main": "./app.js", | ||
"private": false | ||
} | ||
} |
@@ -6,3 +6,3 @@ ![Lore](https://github.com/reymond-group/lore/blob/master/logo.png?raw=true) | ||
# Lore | ||
Current Version: 1.1.10 ([Godzilla](https://youtu.be/RTzb-sduiWc)) | ||
Current Version: 1.1.20 ([Godzilla](https://youtu.be/RTzb-sduiWc)) | ||
@@ -135,2 +135,1 @@ ### Teasers | ||
Big thanks to [Browserstack](https://www.browserstack.com/) for providing us with their excellent App and Browser Testing service. This allows us to test our library quickly on a wide range of browsers and operating systems. | ||
@@ -49,2 +49,3 @@ //@ts-check | ||
updateProjectionMatrix() { | ||
//TODO: This is called in each render loop? Does it have to? | ||
let width = (this.right - this.left) / (2.0 * this.zoom); | ||
@@ -68,3 +69,19 @@ let height = (this.top - this.bottom) / (2.0 * this.zoom); | ||
/** | ||
* Calculate the required zoom factor to contain an a specified width and height. | ||
* | ||
* @param {Number} width Width of regtion to be contained. | ||
* @param {Number} height Height of region to be contained. | ||
* | ||
* @returns {Number} The zoom to be set to contain the specified width and height. | ||
*/ | ||
getRequiredZoomToContain(width, height) { | ||
let zoom_width = (this.right - this.left) / (2.0 * width); | ||
let zoom_height = (this.top - this.bottom) / (2.0 * height); | ||
return Math.min(zoom_width, zoom_height); | ||
} | ||
/** | ||
* Has to be called when the viewport size changes (e.g. window resize). | ||
@@ -71,0 +88,0 @@ * |
@@ -262,2 +262,19 @@ //@ts-check | ||
/** | ||
* Set zoom so it contains a bounding box | ||
* | ||
* @param {Number} width The width of the square to be contained. | ||
* @param {Number} height The height of the square to be contained. | ||
* @returns {OrbitalControls} Returns itself. | ||
*/ | ||
zoomTo(width, height) { | ||
if (this.camera.type !== 'Lore.OrthographicCamera') { | ||
throw('Feature not implemented.'); | ||
} | ||
this.setZoom(this.camera.getRequiredZoomToContain(width, height)); | ||
return this; | ||
} | ||
/** | ||
* Sets the view by name (left, right, top, bottom, back, front, free) | ||
@@ -264,0 +281,0 @@ * |
@@ -499,3 +499,3 @@ //@ts-check | ||
/** | ||
* Subtracts one scalar from another (u - v) | ||
* Subtracts one vector from another (u - v) | ||
* | ||
@@ -544,2 +544,18 @@ * @static | ||
/** | ||
* Calculates the midpoint between two vectors. | ||
* | ||
* @static | ||
* @param {Vector3f} u A vector. | ||
* @param {Vector3f} v A vector. | ||
* @returns {Vector3f} The midpoint between the two vectors. | ||
*/ | ||
static midpoint(u, v) { | ||
return new Vector3f( | ||
u.components[0] + v.components[0] / 2.0, | ||
u.components[1] + v.components[1] / 2.0, | ||
u.components[2] + v.components[2] / 2.0 | ||
); | ||
} | ||
/** | ||
* Returns the forward vector (0, 0, 1). | ||
@@ -546,0 +562,0 @@ * |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
47691590
193
35408
134