Three.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. var THREE = { REVISION: '69dev' };
  5. // browserify support
  6. if ( typeof module === 'object' ) {
  7. module.exports = THREE;
  8. }
  9. // polyfills
  10. if ( Math.sign === undefined ) {
  11. Math.sign = function ( x ) {
  12. return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : 0;
  13. };
  14. }
  15. // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
  16. THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
  17. // GL STATE CONSTANTS
  18. THREE.CullFaceNone = 0;
  19. THREE.CullFaceBack = 1;
  20. THREE.CullFaceFront = 2;
  21. THREE.CullFaceFrontBack = 3;
  22. THREE.FrontFaceDirectionCW = 0;
  23. THREE.FrontFaceDirectionCCW = 1;
  24. // SHADOWING TYPES
  25. THREE.BasicShadowMap = 0;
  26. THREE.PCFShadowMap = 1;
  27. THREE.PCFSoftShadowMap = 2;
  28. // MATERIAL CONSTANTS
  29. // side
  30. THREE.FrontSide = 0;
  31. THREE.BackSide = 1;
  32. THREE.DoubleSide = 2;
  33. // shading
  34. THREE.NoShading = 0;
  35. THREE.FlatShading = 1;
  36. THREE.SmoothShading = 2;
  37. // colors
  38. THREE.NoColors = 0;
  39. THREE.FaceColors = 1;
  40. THREE.VertexColors = 2;
  41. // blending modes
  42. THREE.NoBlending = 0;
  43. THREE.NormalBlending = 1;
  44. THREE.AdditiveBlending = 2;
  45. THREE.SubtractiveBlending = 3;
  46. THREE.MultiplyBlending = 4;
  47. THREE.CustomBlending = 5;
  48. // custom blending equations
  49. // (numbers start from 100 not to clash with other
  50. // mappings to OpenGL constants defined in Texture.js)
  51. THREE.AddEquation = 100;
  52. THREE.SubtractEquation = 101;
  53. THREE.ReverseSubtractEquation = 102;
  54. THREE.MinEquation = 103;
  55. THREE.MaxEquation = 104;
  56. // custom blending destination factors
  57. THREE.ZeroFactor = 200;
  58. THREE.OneFactor = 201;
  59. THREE.SrcColorFactor = 202;
  60. THREE.OneMinusSrcColorFactor = 203;
  61. THREE.SrcAlphaFactor = 204;
  62. THREE.OneMinusSrcAlphaFactor = 205;
  63. THREE.DstAlphaFactor = 206;
  64. THREE.OneMinusDstAlphaFactor = 207;
  65. // custom blending source factors
  66. //THREE.ZeroFactor = 200;
  67. //THREE.OneFactor = 201;
  68. //THREE.SrcAlphaFactor = 204;
  69. //THREE.OneMinusSrcAlphaFactor = 205;
  70. //THREE.DstAlphaFactor = 206;
  71. //THREE.OneMinusDstAlphaFactor = 207;
  72. THREE.DstColorFactor = 208;
  73. THREE.OneMinusDstColorFactor = 209;
  74. THREE.SrcAlphaSaturateFactor = 210;
  75. // TEXTURE CONSTANTS
  76. THREE.MultiplyOperation = 0;
  77. THREE.MixOperation = 1;
  78. THREE.AddOperation = 2;
  79. // Mapping modes
  80. THREE.UVMapping = function () {};
  81. THREE.CubeReflectionMapping = function () {};
  82. THREE.CubeRefractionMapping = function () {};
  83. THREE.SphericalReflectionMapping = function () {};
  84. THREE.SphericalRefractionMapping = function () {};
  85. // Wrapping modes
  86. THREE.RepeatWrapping = 1000;
  87. THREE.ClampToEdgeWrapping = 1001;
  88. THREE.MirroredRepeatWrapping = 1002;
  89. // Filters
  90. THREE.NearestFilter = 1003;
  91. THREE.NearestMipMapNearestFilter = 1004;
  92. THREE.NearestMipMapLinearFilter = 1005;
  93. THREE.LinearFilter = 1006;
  94. THREE.LinearMipMapNearestFilter = 1007;
  95. THREE.LinearMipMapLinearFilter = 1008;
  96. // Data types
  97. THREE.UnsignedByteType = 1009;
  98. THREE.ByteType = 1010;
  99. THREE.ShortType = 1011;
  100. THREE.UnsignedShortType = 1012;
  101. THREE.IntType = 1013;
  102. THREE.UnsignedIntType = 1014;
  103. THREE.FloatType = 1015;
  104. // Pixel types
  105. //THREE.UnsignedByteType = 1009;
  106. THREE.UnsignedShort4444Type = 1016;
  107. THREE.UnsignedShort5551Type = 1017;
  108. THREE.UnsignedShort565Type = 1018;
  109. // Pixel formats
  110. THREE.AlphaFormat = 1019;
  111. THREE.RGBFormat = 1020;
  112. THREE.RGBAFormat = 1021;
  113. THREE.LuminanceFormat = 1022;
  114. THREE.LuminanceAlphaFormat = 1023;
  115. // DDS / ST3C Compressed texture formats
  116. THREE.RGB_S3TC_DXT1_Format = 2001;
  117. THREE.RGBA_S3TC_DXT1_Format = 2002;
  118. THREE.RGBA_S3TC_DXT3_Format = 2003;
  119. THREE.RGBA_S3TC_DXT5_Format = 2004;
  120. // PVRTC compressed texture formats
  121. THREE.RGB_PVRTC_4BPPV1_Format = 2100;
  122. THREE.RGB_PVRTC_2BPPV1_Format = 2101;
  123. THREE.RGBA_PVRTC_4BPPV1_Format = 2102;
  124. THREE.RGBA_PVRTC_2BPPV1_Format = 2103;
粤ICP备19079148号