From 1bacebbfc14b28665d1e4e8d35770546a8b3b205 Mon Sep 17 00:00:00 2001 From: WestLangley Date: Sat, 27 Jul 2019 21:27:02 -0400 Subject: [PATCH] Added build files for live demo --- build/three.js | 145 ++++++++++++++++++++++-------------------- build/three.module.js | 145 ++++++++++++++++++++++-------------------- 2 files changed, 150 insertions(+), 140 deletions(-) diff --git a/build/three.js b/build/three.js index 1ffe64dc1b9967..56ffd8926941de 100644 --- a/build/three.js +++ b/build/three.js @@ -2349,6 +2349,8 @@ * @author tschw */ + var _vector; + function Matrix3() { this.elements = [ @@ -2432,29 +2434,25 @@ }, - applyToBufferAttribute: function () { - - var v1 = new Vector3(); - - return function applyToBufferAttribute( attribute ) { + applyToBufferAttribute: function ( attribute ) { - for ( var i = 0, l = attribute.count; i < l; i ++ ) { + if ( _vector === undefined ) _vector = new Vector3(); - v1.x = attribute.getX( i ); - v1.y = attribute.getY( i ); - v1.z = attribute.getZ( i ); + for ( var i = 0, l = attribute.count; i < l; i ++ ) { - v1.applyMatrix3( this ); + _vector.x = attribute.getX( i ); + _vector.y = attribute.getY( i ); + _vector.z = attribute.getZ( i ); - attribute.setXYZ( i, v1.x, v1.y, v1.z ); + _vector.applyMatrix3( this ); - } + attribute.setXYZ( i, _vector.x, _vector.y, _vector.z ); - return attribute; + } - }; + return attribute; - }(), + }, multiply: function ( m ) { @@ -4825,6 +4823,8 @@ * @author bhouston / http://clara.io */ + var _matrix, _quaternion; + function Euler( x, y, z, order ) { this._x = x || 0; @@ -5069,19 +5069,15 @@ }, - setFromQuaternion: function () { - - var matrix = new Matrix4(); - - return function setFromQuaternion( q, order, update ) { + setFromQuaternion: function ( q, order, update ) { - matrix.makeRotationFromQuaternion( q ); + if ( _matrix === undefined ) _matrix = new Matrix4(); - return this.setFromRotationMatrix( matrix, order, update ); + _matrix.makeRotationFromQuaternion( q ); - }; + return this.setFromRotationMatrix( _matrix, order, update ); - }(), + }, setFromVector3: function ( v, order ) { @@ -5089,21 +5085,17 @@ }, - reorder: function () { + reorder: function ( newOrder ) { // WARNING: this discards revolution information -bhouston - var q = new Quaternion(); - - return function reorder( newOrder ) { + if ( _quaternion === undefined ) _quaternion = new Quaternion(); - q.setFromEuler( this ); + _quaternion.setFromEuler( this ); - return this.setFromQuaternion( q, newOrder ); - - }; + return this.setFromQuaternion( _quaternion, newOrder ); - }(), + }, equals: function ( euler ) { @@ -6807,6 +6799,8 @@ * @author mrdoob / http://mrdoob.com/ */ + var _box; + function Sphere( center, radius ) { this.center = ( center !== undefined ) ? center : new Vector3(); @@ -6825,39 +6819,35 @@ }, - setFromPoints: function () { + setFromPoints: function ( points, optionalCenter ) { - var box = new Box3(); - - return function setFromPoints( points, optionalCenter ) { - - var center = this.center; + if ( _box === undefined ) _box = new Box3(); - if ( optionalCenter !== undefined ) { + var center = this.center; - center.copy( optionalCenter ); + if ( optionalCenter !== undefined ) { - } else { + center.copy( optionalCenter ); - box.setFromPoints( points ).getCenter( center ); + } else { - } + _box.setFromPoints( points ).getCenter( center ); - var maxRadiusSq = 0; + } - for ( var i = 0, il = points.length; i < il; i ++ ) { + var maxRadiusSq = 0; - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + for ( var i = 0, il = points.length; i < il; i ++ ) { - } + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); - this.radius = Math.sqrt( maxRadiusSq ); + } - return this; + this.radius = Math.sqrt( maxRadiusSq ); - }; + return this; - }(), + }, clone: function () { @@ -14572,7 +14562,7 @@ var meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; - var meshphysical_frag = "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; + var meshphysical_frag = "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n\tuniform float transparency;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; var meshphysical_vert = "#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; @@ -15180,7 +15170,8 @@ ShaderLib.standard.uniforms, { clearCoat: { value: 0 }, - clearCoatRoughness: { value: 0 } + clearCoatRoughness: { value: 0 }, + transparency: { value: 0 } } ] ), @@ -25347,6 +25338,8 @@ uniforms.clearCoat.value = material.clearCoat; uniforms.clearCoatRoughness.value = material.clearCoatRoughness; + uniforms.transparency.value = material.transparency; + } function refreshUniformsMatcap( uniforms, material ) { @@ -32238,6 +32231,8 @@ this.clearCoat = 0.0; this.clearCoatRoughness = 0.0; + this.transparency = 0.0; + this.setValues( parameters ); } @@ -32258,6 +32253,8 @@ this.clearCoat = source.clearCoat; this.clearCoatRoughness = source.clearCoatRoughness; + this.transparency = source.transparency; + return this; }; @@ -40138,7 +40135,13 @@ var glyph = data.glyphs[ char ] || data.glyphs[ '?' ]; - if ( ! glyph ) return; + if ( ! glyph ) { + + console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' ); + + return; + + } var path = new ShapePath(); @@ -45158,6 +45161,8 @@ * @author bhouston / http://clara.io */ + var _startP, _startEnd; + function Line3( start, end ) { this.start = ( start !== undefined ) ? start : new Vector3(); @@ -45242,32 +45247,32 @@ }, - closestPointToPointParameter: function () { + closestPointToPointParameter: function ( point, clampToLine ) { - var startP = new Vector3(); - var startEnd = new Vector3(); + if ( _startP === undefined ) { - return function closestPointToPointParameter( point, clampToLine ) { + _startP = new Vector3(); + _startEnd = new Vector3(); - startP.subVectors( point, this.start ); - startEnd.subVectors( this.end, this.start ); + } - var startEnd2 = startEnd.dot( startEnd ); - var startEnd_startP = startEnd.dot( startP ); + _startP.subVectors( point, this.start ); + _startEnd.subVectors( this.end, this.start ); - var t = startEnd_startP / startEnd2; + var startEnd2 = _startEnd.dot( _startEnd ); + var startEnd_startP = _startEnd.dot( _startP ); - if ( clampToLine ) { + var t = startEnd_startP / startEnd2; - t = _Math.clamp( t, 0, 1 ); + if ( clampToLine ) { - } + t = _Math.clamp( t, 0, 1 ); - return t; + } - }; + return t; - }(), + }, closestPointToPoint: function ( point, clampToLine, target ) { diff --git a/build/three.module.js b/build/three.module.js index bec91f48d06955..60110eeb8cd63d 100644 --- a/build/three.module.js +++ b/build/three.module.js @@ -2343,6 +2343,8 @@ Object.assign( Vector3.prototype, { * @author tschw */ +var _vector; + function Matrix3() { this.elements = [ @@ -2426,29 +2428,25 @@ Object.assign( Matrix3.prototype, { }, - applyToBufferAttribute: function () { - - var v1 = new Vector3(); - - return function applyToBufferAttribute( attribute ) { + applyToBufferAttribute: function ( attribute ) { - for ( var i = 0, l = attribute.count; i < l; i ++ ) { + if ( _vector === undefined ) _vector = new Vector3(); - v1.x = attribute.getX( i ); - v1.y = attribute.getY( i ); - v1.z = attribute.getZ( i ); + for ( var i = 0, l = attribute.count; i < l; i ++ ) { - v1.applyMatrix3( this ); + _vector.x = attribute.getX( i ); + _vector.y = attribute.getY( i ); + _vector.z = attribute.getZ( i ); - attribute.setXYZ( i, v1.x, v1.y, v1.z ); + _vector.applyMatrix3( this ); - } + attribute.setXYZ( i, _vector.x, _vector.y, _vector.z ); - return attribute; + } - }; + return attribute; - }(), + }, multiply: function ( m ) { @@ -4819,6 +4817,8 @@ Object.assign( Matrix4.prototype, { * @author bhouston / http://clara.io */ +var _matrix, _quaternion; + function Euler( x, y, z, order ) { this._x = x || 0; @@ -5063,19 +5063,15 @@ Object.assign( Euler.prototype, { }, - setFromQuaternion: function () { - - var matrix = new Matrix4(); - - return function setFromQuaternion( q, order, update ) { + setFromQuaternion: function ( q, order, update ) { - matrix.makeRotationFromQuaternion( q ); + if ( _matrix === undefined ) _matrix = new Matrix4(); - return this.setFromRotationMatrix( matrix, order, update ); + _matrix.makeRotationFromQuaternion( q ); - }; + return this.setFromRotationMatrix( _matrix, order, update ); - }(), + }, setFromVector3: function ( v, order ) { @@ -5083,21 +5079,17 @@ Object.assign( Euler.prototype, { }, - reorder: function () { + reorder: function ( newOrder ) { // WARNING: this discards revolution information -bhouston - var q = new Quaternion(); - - return function reorder( newOrder ) { + if ( _quaternion === undefined ) _quaternion = new Quaternion(); - q.setFromEuler( this ); + _quaternion.setFromEuler( this ); - return this.setFromQuaternion( q, newOrder ); - - }; + return this.setFromQuaternion( _quaternion, newOrder ); - }(), + }, equals: function ( euler ) { @@ -6801,6 +6793,8 @@ Object.assign( Box3.prototype, { * @author mrdoob / http://mrdoob.com/ */ +var _box; + function Sphere( center, radius ) { this.center = ( center !== undefined ) ? center : new Vector3(); @@ -6819,39 +6813,35 @@ Object.assign( Sphere.prototype, { }, - setFromPoints: function () { + setFromPoints: function ( points, optionalCenter ) { - var box = new Box3(); - - return function setFromPoints( points, optionalCenter ) { - - var center = this.center; + if ( _box === undefined ) _box = new Box3(); - if ( optionalCenter !== undefined ) { + var center = this.center; - center.copy( optionalCenter ); + if ( optionalCenter !== undefined ) { - } else { + center.copy( optionalCenter ); - box.setFromPoints( points ).getCenter( center ); + } else { - } + _box.setFromPoints( points ).getCenter( center ); - var maxRadiusSq = 0; + } - for ( var i = 0, il = points.length; i < il; i ++ ) { + var maxRadiusSq = 0; - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); + for ( var i = 0, il = points.length; i < il; i ++ ) { - } + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); - this.radius = Math.sqrt( maxRadiusSq ); + } - return this; + this.radius = Math.sqrt( maxRadiusSq ); - }; + return this; - }(), + }, clone: function () { @@ -14566,7 +14556,7 @@ var meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissiv var meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}"; -var meshphysical_frag = "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; +var meshphysical_frag = "#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n\tuniform float transparency;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}"; var meshphysical_vert = "#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}"; @@ -15174,7 +15164,8 @@ ShaderLib.physical = { ShaderLib.standard.uniforms, { clearCoat: { value: 0 }, - clearCoatRoughness: { value: 0 } + clearCoatRoughness: { value: 0 }, + transparency: { value: 0 } } ] ), @@ -25341,6 +25332,8 @@ function WebGLRenderer( parameters ) { uniforms.clearCoat.value = material.clearCoat; uniforms.clearCoatRoughness.value = material.clearCoatRoughness; + uniforms.transparency.value = material.transparency; + } function refreshUniformsMatcap( uniforms, material ) { @@ -32232,6 +32225,8 @@ function MeshPhysicalMaterial( parameters ) { this.clearCoat = 0.0; this.clearCoatRoughness = 0.0; + this.transparency = 0.0; + this.setValues( parameters ); } @@ -32252,6 +32247,8 @@ MeshPhysicalMaterial.prototype.copy = function ( source ) { this.clearCoat = source.clearCoat; this.clearCoatRoughness = source.clearCoatRoughness; + this.transparency = source.transparency; + return this; }; @@ -40132,7 +40129,13 @@ function createPath( char, scale, offsetX, offsetY, data ) { var glyph = data.glyphs[ char ] || data.glyphs[ '?' ]; - if ( ! glyph ) return; + if ( ! glyph ) { + + console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' ); + + return; + + } var path = new ShapePath(); @@ -45152,6 +45155,8 @@ Object.assign( Box2.prototype, { * @author bhouston / http://clara.io */ +var _startP, _startEnd; + function Line3( start, end ) { this.start = ( start !== undefined ) ? start : new Vector3(); @@ -45236,32 +45241,32 @@ Object.assign( Line3.prototype, { }, - closestPointToPointParameter: function () { + closestPointToPointParameter: function ( point, clampToLine ) { - var startP = new Vector3(); - var startEnd = new Vector3(); + if ( _startP === undefined ) { - return function closestPointToPointParameter( point, clampToLine ) { + _startP = new Vector3(); + _startEnd = new Vector3(); - startP.subVectors( point, this.start ); - startEnd.subVectors( this.end, this.start ); + } - var startEnd2 = startEnd.dot( startEnd ); - var startEnd_startP = startEnd.dot( startP ); + _startP.subVectors( point, this.start ); + _startEnd.subVectors( this.end, this.start ); - var t = startEnd_startP / startEnd2; + var startEnd2 = _startEnd.dot( _startEnd ); + var startEnd_startP = _startEnd.dot( _startP ); - if ( clampToLine ) { + var t = startEnd_startP / startEnd2; - t = _Math.clamp( t, 0, 1 ); + if ( clampToLine ) { - } + t = _Math.clamp( t, 0, 1 ); - return t; + } - }; + return t; - }(), + }, closestPointToPoint: function ( point, clampToLine, target ) {