Skip to content

Commit e48fc94

Browse files
committed
r127
1 parent afccc97 commit e48fc94

File tree

6 files changed

+40
-16
lines changed

6 files changed

+40
-16
lines changed

build/three.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));
1010
}(this, (function (exports) { 'use strict';
1111

12-
const REVISION = '127dev';
12+
const REVISION = '127';
1313
const MOUSE = {
1414
LEFT: 0,
1515
MIDDLE: 1,
@@ -303,6 +303,14 @@
303303
mapLinear: function (x, a1, a2, b1, b2) {
304304
return b1 + (x - a1) * (b2 - b1) / (a2 - a1);
305305
},
306+
// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/
307+
inverseLerp: function (x, y, value) {
308+
if (x !== y) {
309+
return (value - x) / (y - x);
310+
} else {
311+
return 0;
312+
}
313+
},
306314
// https://en.wikipedia.org/wiki/Linear_interpolation
307315
lerp: function (x, y, t) {
308316
return (1 - t) * x + t * y;
@@ -18389,10 +18397,10 @@
1838918397
WebGL1Renderer.prototype.isWebGL1Renderer = true;
1839018398

1839118399
class FogExp2 {
18392-
constructor(color, density) {
18400+
constructor(color, density = 0.00025) {
1839318401
this.name = '';
1839418402
this.color = new Color(color);
18395-
this.density = density !== undefined ? density : 0.00025;
18403+
this.density = density;
1839618404
}
1839718405

1839818406
clone() {
@@ -18414,11 +18422,11 @@
1841418422
FogExp2.prototype.isFogExp2 = true;
1841518423

1841618424
class Fog {
18417-
constructor(color, near, far) {
18425+
constructor(color, near = 1, far = 1000) {
1841818426
this.name = '';
1841918427
this.color = new Color(color);
18420-
this.near = near !== undefined ? near : 1;
18421-
this.far = far !== undefined ? far : 1000;
18428+
this.near = near;
18429+
this.far = far;
1842218430
}
1842318431

1842418432
clone() {

build/three.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/three.module.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright 2010-2021 Three.js Authors
44
* SPDX-License-Identifier: MIT
55
*/
6-
const REVISION = '127dev';
6+
const REVISION = '127';
77
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
88
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
99
const CullFaceNone = 0;
@@ -347,6 +347,22 @@ const MathUtils = {
347347

348348
},
349349

350+
// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/
351+
352+
inverseLerp: function ( x, y, value ) {
353+
354+
if ( x !== y ) {
355+
356+
return ( value - x ) / ( y - x );
357+
358+
} else {
359+
360+
return 0;
361+
362+
}
363+
364+
},
365+
350366
// https://en.wikipedia.org/wiki/Linear_interpolation
351367

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

2527625292
class FogExp2 {
2527725293

25278-
constructor( color, density ) {
25294+
constructor( color, density = 0.00025 ) {
2527925295

2528025296
this.name = '';
2528125297

2528225298
this.color = new Color( color );
25283-
this.density = ( density !== undefined ) ? density : 0.00025;
25299+
this.density = density;
2528425300

2528525301
}
2528625302

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

2530725323
class Fog {
2530825324

25309-
constructor( color, near, far ) {
25325+
constructor( color, near = 1, far = 1000 ) {
2531025326

2531125327
this.name = '';
2531225328

2531325329
this.color = new Color( color );
2531425330

25315-
this.near = ( near !== undefined ) ? near : 1;
25316-
this.far = ( far !== undefined ) ? far : 1000;
25331+
this.near = near;
25332+
this.far = far;
2531725333

2531825334
}
2531925335

editor/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const cacheName = 'threejs-editor-r126';
1+
const cacheName = 'threejs-editor-r127';
22

33
const assets = [
44
'./',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "three",
3-
"version": "0.126.0",
3+
"version": "0.127.0",
44
"description": "JavaScript 3D library",
55
"main": "build/three.js",
66
"module": "build/three.module.js",

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const REVISION = '127dev';
1+
export const REVISION = '127';
22
export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
33
export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
44
export const CullFaceNone = 0;

0 commit comments

Comments
 (0)