Skip to content

Commit

Permalink
r127
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 31, 2021
1 parent afccc97 commit e48fc94
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 16 deletions.
20 changes: 14 additions & 6 deletions build/three.js
Expand Up @@ -9,7 +9,7 @@
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
}(this, (function (exports) { 'use strict';

const REVISION = '127dev';
const REVISION = '127';
const MOUSE = {
LEFT: 0,
MIDDLE: 1,
Expand Down Expand Up @@ -303,6 +303,14 @@
mapLinear: function (x, a1, a2, b1, b2) {
return b1 + (x - a1) * (b2 - b1) / (a2 - a1);
},
// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/
inverseLerp: function (x, y, value) {
if (x !== y) {
return (value - x) / (y - x);
} else {
return 0;
}
},
// https://en.wikipedia.org/wiki/Linear_interpolation
lerp: function (x, y, t) {
return (1 - t) * x + t * y;
Expand Down Expand Up @@ -18389,10 +18397,10 @@
WebGL1Renderer.prototype.isWebGL1Renderer = true;

class FogExp2 {
constructor(color, density) {
constructor(color, density = 0.00025) {
this.name = '';
this.color = new Color(color);
this.density = density !== undefined ? density : 0.00025;
this.density = density;
}

clone() {
Expand All @@ -18414,11 +18422,11 @@
FogExp2.prototype.isFogExp2 = true;

class Fog {
constructor(color, near, far) {
constructor(color, near = 1, far = 1000) {
this.name = '';
this.color = new Color(color);
this.near = near !== undefined ? near : 1;
this.far = far !== undefined ? far : 1000;
this.near = near;
this.far = far;
}

clone() {
Expand Down
2 changes: 1 addition & 1 deletion build/three.min.js

Large diffs are not rendered by default.

28 changes: 22 additions & 6 deletions build/three.module.js
Expand Up @@ -3,7 +3,7 @@
* Copyright 2010-2021 Three.js Authors
* SPDX-License-Identifier: MIT
*/
const REVISION = '127dev';
const REVISION = '127';
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
const CullFaceNone = 0;
Expand Down Expand Up @@ -347,6 +347,22 @@ const MathUtils = {

},

// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/

inverseLerp: function ( x, y, value ) {

if ( x !== y ) {

return ( value - x ) / ( y - x );

} else {

return 0;

}

},

// https://en.wikipedia.org/wiki/Linear_interpolation

lerp: function ( x, y, t ) {
Expand Down Expand Up @@ -25275,12 +25291,12 @@ WebGL1Renderer.prototype.isWebGL1Renderer = true;

class FogExp2 {

constructor( color, density ) {
constructor( color, density = 0.00025 ) {

this.name = '';

this.color = new Color( color );
this.density = ( density !== undefined ) ? density : 0.00025;
this.density = density;

}

Expand All @@ -25306,14 +25322,14 @@ FogExp2.prototype.isFogExp2 = true;

class Fog {

constructor( color, near, far ) {
constructor( color, near = 1, far = 1000 ) {

this.name = '';

this.color = new Color( color );

this.near = ( near !== undefined ) ? near : 1;
this.far = ( far !== undefined ) ? far : 1000;
this.near = near;
this.far = far;

}

Expand Down
2 changes: 1 addition & 1 deletion editor/sw.js
@@ -1,4 +1,4 @@
const cacheName = 'threejs-editor-r126';
const cacheName = 'threejs-editor-r127';

const assets = [
'./',
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "three",
"version": "0.126.0",
"version": "0.127.0",
"description": "JavaScript 3D library",
"main": "build/three.js",
"module": "build/three.module.js",
Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
@@ -1,4 +1,4 @@
export const REVISION = '127dev';
export const REVISION = '127';
export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
export const CullFaceNone = 0;
Expand Down

0 comments on commit e48fc94

Please sign in to comment.