| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- /**
- * @author mrdoob / http://mrdoob.com/
- */
- var THREE = { REVISION: '77dev' };
- //
- if ( typeof define === 'function' && define.amd ) {
- define( 'three', THREE );
- } else if ( 'undefined' !== typeof exports && 'undefined' !== typeof module ) {
- module.exports = THREE;
- }
- //
- if ( Number.EPSILON === undefined ) {
- Number.EPSILON = Math.pow( 2, - 52 );
- }
- //
- if ( Math.sign === undefined ) {
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
- Math.sign = function ( x ) {
- return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x;
- };
- }
- if ( Function.prototype.name === undefined && Object.defineProperty !== undefined ) {
- // Missing in IE9-11.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
- Object.defineProperty( Function.prototype, 'name', {
- get: function () {
- return this.toString().match( /^\s*function\s*(\S*)\s*\(/ )[ 1 ];
- }
- } );
- }
- if ( Object.assign === undefined ) {
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
- Object.defineProperty( Object, 'assign', {
- writable: true,
- configurable: true,
- value: function ( target ) {
- 'use strict';
- if ( target === undefined || target === null ) {
- throw new TypeError( "Cannot convert first argument to object" );
- }
- var to = Object( target );
- for ( var i = 1, n = arguments.length; i !== n; ++ i ) {
- var nextSource = arguments[ i ];
- if ( nextSource === undefined || nextSource === null ) continue;
- nextSource = Object( nextSource );
- var keysArray = Object.keys( nextSource );
- for ( var nextIndex = 0, len = keysArray.length; nextIndex !== len; ++ nextIndex ) {
- var nextKey = keysArray[ nextIndex ];
- var desc = Object.getOwnPropertyDescriptor( nextSource, nextKey );
- if ( desc !== undefined && desc.enumerable ) {
- to[ nextKey ] = nextSource[ nextKey ];
- }
- }
- }
- return to;
- }
- } );
- }
- // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
- THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
- // GL STATE CONSTANTS
- THREE.CullFaceNone = 0;
- THREE.CullFaceBack = 1;
- THREE.CullFaceFront = 2;
- THREE.CullFaceFrontBack = 3;
- THREE.FrontFaceDirectionCW = 0;
- THREE.FrontFaceDirectionCCW = 1;
- // SHADOWING TYPES
- THREE.BasicShadowMap = 0;
- THREE.PCFShadowMap = 1;
- THREE.PCFSoftShadowMap = 2;
- // MATERIAL CONSTANTS
- // side
- THREE.FrontSide = 0;
- THREE.BackSide = 1;
- THREE.DoubleSide = 2;
- // shading
- THREE.FlatShading = 1;
- THREE.SmoothShading = 2;
- // colors
- THREE.NoColors = 0;
- THREE.FaceColors = 1;
- THREE.VertexColors = 2;
- // blending modes
- THREE.NoBlending = 0;
- THREE.NormalBlending = 1;
- THREE.AdditiveBlending = 2;
- THREE.SubtractiveBlending = 3;
- THREE.MultiplyBlending = 4;
- THREE.CustomBlending = 5;
- // custom blending equations
- // (numbers start from 100 not to clash with other
- // mappings to OpenGL constants defined in Texture.js)
- THREE.AddEquation = 100;
- THREE.SubtractEquation = 101;
- THREE.ReverseSubtractEquation = 102;
- THREE.MinEquation = 103;
- THREE.MaxEquation = 104;
- // custom blending destination factors
- THREE.ZeroFactor = 200;
- THREE.OneFactor = 201;
- THREE.SrcColorFactor = 202;
- THREE.OneMinusSrcColorFactor = 203;
- THREE.SrcAlphaFactor = 204;
- THREE.OneMinusSrcAlphaFactor = 205;
- THREE.DstAlphaFactor = 206;
- THREE.OneMinusDstAlphaFactor = 207;
- // custom blending source factors
- //THREE.ZeroFactor = 200;
- //THREE.OneFactor = 201;
- //THREE.SrcAlphaFactor = 204;
- //THREE.OneMinusSrcAlphaFactor = 205;
- //THREE.DstAlphaFactor = 206;
- //THREE.OneMinusDstAlphaFactor = 207;
- THREE.DstColorFactor = 208;
- THREE.OneMinusDstColorFactor = 209;
- THREE.SrcAlphaSaturateFactor = 210;
- // depth modes
- THREE.NeverDepth = 0;
- THREE.AlwaysDepth = 1;
- THREE.LessDepth = 2;
- THREE.LessEqualDepth = 3;
- THREE.EqualDepth = 4;
- THREE.GreaterEqualDepth = 5;
- THREE.GreaterDepth = 6;
- THREE.NotEqualDepth = 7;
- // TEXTURE CONSTANTS
- THREE.MultiplyOperation = 0;
- THREE.MixOperation = 1;
- THREE.AddOperation = 2;
- // Tone Mapping modes
- THREE.NoToneMapping = 0; // do not do any tone mapping, not even exposure (required for special purpose passes.)
- THREE.LinearToneMapping = 1; // only apply exposure.
- THREE.ReinhardToneMapping = 2;
- THREE.Uncharted2ToneMapping = 3; // John Hable
- THREE.CineonToneMapping = 4; // optimized filmic operator by Jim Hejl and Richard Burgess-Dawson
- // Mapping modes
- THREE.UVMapping = 300;
- THREE.CubeReflectionMapping = 301;
- THREE.CubeRefractionMapping = 302;
- THREE.EquirectangularReflectionMapping = 303;
- THREE.EquirectangularRefractionMapping = 304;
- THREE.SphericalReflectionMapping = 305;
- THREE.CubeUVReflectionMapping = 306;
- THREE.CubeUVRefractionMapping = 307;
- // Wrapping modes
- THREE.RepeatWrapping = 1000;
- THREE.ClampToEdgeWrapping = 1001;
- THREE.MirroredRepeatWrapping = 1002;
- // Filters
- THREE.NearestFilter = 1003;
- THREE.NearestMipMapNearestFilter = 1004;
- THREE.NearestMipMapLinearFilter = 1005;
- THREE.LinearFilter = 1006;
- THREE.LinearMipMapNearestFilter = 1007;
- THREE.LinearMipMapLinearFilter = 1008;
- // Data types
- THREE.UnsignedByteType = 1009;
- THREE.ByteType = 1010;
- THREE.ShortType = 1011;
- THREE.UnsignedShortType = 1012;
- THREE.IntType = 1013;
- THREE.UnsignedIntType = 1014;
- THREE.FloatType = 1015;
- THREE.HalfFloatType = 1025;
- // Pixel types
- //THREE.UnsignedByteType = 1009;
- THREE.UnsignedShort4444Type = 1016;
- THREE.UnsignedShort5551Type = 1017;
- THREE.UnsignedShort565Type = 1018;
- // Pixel formats
- THREE.AlphaFormat = 1019;
- THREE.RGBFormat = 1020;
- THREE.RGBAFormat = 1021;
- THREE.LuminanceFormat = 1022;
- THREE.LuminanceAlphaFormat = 1023;
- // THREE.RGBEFormat handled as THREE.RGBAFormat in shaders
- THREE.RGBEFormat = THREE.RGBAFormat; //1024;
- THREE.DepthFormat = 1026;
- // DDS / ST3C Compressed texture formats
- THREE.RGB_S3TC_DXT1_Format = 2001;
- THREE.RGBA_S3TC_DXT1_Format = 2002;
- THREE.RGBA_S3TC_DXT3_Format = 2003;
- THREE.RGBA_S3TC_DXT5_Format = 2004;
- // PVRTC compressed texture formats
- THREE.RGB_PVRTC_4BPPV1_Format = 2100;
- THREE.RGB_PVRTC_2BPPV1_Format = 2101;
- THREE.RGBA_PVRTC_4BPPV1_Format = 2102;
- THREE.RGBA_PVRTC_2BPPV1_Format = 2103;
- // ETC compressed texture formats
- THREE.RGB_ETC1_Format = 2151;
- // Loop styles for AnimationAction
- THREE.LoopOnce = 2200;
- THREE.LoopRepeat = 2201;
- THREE.LoopPingPong = 2202;
- // Interpolation
- THREE.InterpolateDiscrete = 2300;
- THREE.InterpolateLinear = 2301;
- THREE.InterpolateSmooth = 2302;
- // Interpolant ending modes
- THREE.ZeroCurvatureEnding = 2400;
- THREE.ZeroSlopeEnding = 2401;
- THREE.WrapAroundEnding = 2402;
- // Triangle Draw modes
- THREE.TrianglesDrawMode = 0;
- THREE.TriangleStripDrawMode = 1;
- THREE.TriangleFanDrawMode = 2;
- // Texture Encodings
- THREE.LinearEncoding = 3000; // No encoding at all.
- THREE.sRGBEncoding = 3001;
- THREE.GammaEncoding = 3007; // uses GAMMA_FACTOR, for backwards compatibility with WebGLRenderer.gammaInput/gammaOutput
- // The following Texture Encodings are for RGB-only (no alpha) HDR light emission sources.
- // These encodings should not specified as output encodings except in rare situations.
- THREE.RGBEEncoding = 3002; // AKA Radiance.
- THREE.LogLuvEncoding = 3003;
- THREE.RGBM7Encoding = 3004;
- THREE.RGBM16Encoding = 3005;
- THREE.RGBDEncoding = 3006; // MaxRange is 256.
- // Depth packing strategies
- THREE.BasicDepthPacking = 3200; // for writing to float textures for high precision or for visualizing results in RGB buffers
- THREE.RGBADepthPacking = 3201; // for packing into RGBA buffers.
|