Skip to content

Commit

Permalink
r125
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 27, 2021
1 parent 3f03b59 commit e1037f9
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 13 deletions.
26 changes: 21 additions & 5 deletions build/three.js
Expand Up @@ -1189,6 +1189,10 @@
lerp: function lerp(x, y, t) {
return (1 - t) * x + t * y;
},
// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/
damp: function damp(x, y, lambda, dt) {
return MathUtils.lerp(x, y, 1 - Math.exp(-lambda * dt));
},
// https://www.desmos.com/calculator/vcsjnyz7x4
pingpong: function pingpong(x, length) {
if (length === void 0) {
Expand Down Expand Up @@ -7263,7 +7267,7 @@

var m;

if (m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(style)) {
if (m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(style)) {
// rgb / hsl
var color;
var name = m[1];
Expand All @@ -7272,7 +7276,7 @@
switch (name) {
case 'rgb':
case 'rgba':
if (color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
if (color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
// rgb(255,0,0) rgba(255,0,0,0.5)
this.r = Math.min(255, parseInt(color[1], 10)) / 255;
this.g = Math.min(255, parseInt(color[2], 10)) / 255;
Expand All @@ -7281,7 +7285,7 @@
return this;
}

if (color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
if (color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)
this.r = Math.min(100, parseInt(color[1], 10)) / 100;
this.g = Math.min(100, parseInt(color[2], 10)) / 100;
Expand All @@ -7294,7 +7298,7 @@

case 'hsl':
case 'hsla':
if (color = /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
if (color = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
// hsl(120,50%,50%) hsla(120,50%,50%,0.5)
var h = parseFloat(color[1]) / 360;
var s = parseInt(color[2], 10) / 100;
Expand Down Expand Up @@ -17345,7 +17349,9 @@
inputSourcesMap.forEach(function (controller, inputSource) {
controller.disconnect(inputSource);
});
inputSourcesMap.clear(); //
inputSourcesMap.clear();
_currentDepthNear = null;
_currentDepthFar = null; //

renderer.setFramebuffer(null);
renderer.setRenderTarget(renderer.getRenderTarget()); // Hack #15830
Expand Down Expand Up @@ -17570,6 +17576,8 @@


camera.matrixWorld.copy(cameraVR.matrixWorld);
camera.matrix.copy(cameraVR.matrix);
camera.matrix.decompose(camera.position, camera.quaternion, camera.scale);
var children = camera.children;

for (var _i3 = 0, l = children.length; _i3 < l; _i3++) {
Expand Down Expand Up @@ -26800,6 +26808,14 @@
texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;
texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;

if (texData.encoding !== undefined) {
texture.encoding = texData.encoding;
}

if (texData.flipY !== undefined) {
texture.flipY = texData.flipY;
}

if (texData.format !== undefined) {
texture.format = texData.format;
}
Expand Down
2 changes: 1 addition & 1 deletion build/three.min.js

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions build/three.module.js
Expand Up @@ -349,6 +349,14 @@ const MathUtils = {

},

// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/

damp: function ( x, y, lambda, dt ) {

return MathUtils.lerp( x, y, 1 - Math.exp( - lambda * dt ) );

},

// https://www.desmos.com/calculator/vcsjnyz7x4

pingpong: function ( x, length = 1 ) {
Expand Down Expand Up @@ -7958,7 +7966,7 @@ class Color {

let m;

if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) {
if ( m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec( style ) ) {

// rgb / hsl

Expand All @@ -7971,7 +7979,7 @@ class Color {
case 'rgb':
case 'rgba':

if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
if ( color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {

// rgb(255,0,0) rgba(255,0,0,0.5)
this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255;
Expand All @@ -7984,7 +7992,7 @@ class Color {

}

if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
if ( color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {

// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)
this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100;
Expand All @@ -8002,7 +8010,7 @@ class Color {
case 'hsl':
case 'hsla':

if ( color = /^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
if ( color = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {

// hsl(120,50%,50%) hsla(120,50%,50%,0.5)
const h = parseFloat( color[ 1 ] ) / 360;
Expand Down Expand Up @@ -21858,6 +21866,9 @@ function WebXRManager( renderer, gl ) {

inputSourcesMap.clear();

_currentDepthNear = null;
_currentDepthFar = null;

//

renderer.setFramebuffer( null );
Expand Down Expand Up @@ -22109,6 +22120,8 @@ function WebXRManager( renderer, gl ) {
// update camera and its children

camera.matrixWorld.copy( cameraVR.matrixWorld );
camera.matrix.copy( cameraVR.matrix );
camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );

const children = camera.children;

Expand Down Expand Up @@ -34806,6 +34819,18 @@ DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ),

texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;

if ( texData.encoding !== undefined ) {

texture.encoding = texData.encoding;

}

if ( texData.flipY !== undefined ) {

texture.flipY = texData.flipY;

}

if ( texData.format !== undefined ) {

texture.format = texData.format;
Expand Down
2 changes: 1 addition & 1 deletion editor/sw.js
@@ -1,4 +1,4 @@
// r124
// r125

const assets = [
'./',
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "three",
"version": "0.124.0",
"version": "0.125.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 = '125dev';
export const REVISION = '125';
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 e1037f9

Please sign in to comment.