opal-js_wrap-three 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile.lock +4 -4
  4. data/lib/opal/js_wrap/three/version.rb +1 -1
  5. data/lib-opal/js_wrap/three/WebGL.js +102 -0
  6. data/lib-opal/js_wrap/three/animation/AnimationClipCreator.js +116 -0
  7. data/lib-opal/js_wrap/three/animation/CCDIKSolver.js +436 -0
  8. data/lib-opal/js_wrap/three/animation/MMDAnimationHelper.js +941 -0
  9. data/lib-opal/js_wrap/three/animation/MMDPhysics.js +1183 -0
  10. data/lib-opal/js_wrap/three/cameras/CinematicCamera.js +204 -0
  11. data/lib-opal/js_wrap/three/controls/ArcballControls.js +2649 -0
  12. data/lib-opal/js_wrap/three/controls/DragControls.js +234 -0
  13. data/lib-opal/js_wrap/three/controls/FirstPersonControls.js +301 -0
  14. data/lib-opal/js_wrap/three/controls/FlyControls.js +357 -0
  15. data/lib-opal/js_wrap/three/controls/OrbitControls.js +908 -0
  16. data/lib-opal/js_wrap/three/controls/PointerLockControls.js +173 -0
  17. data/lib-opal/js_wrap/three/controls/TrackballControls.js +666 -0
  18. data/lib-opal/js_wrap/three/controls/TransformControls.js +1210 -0
  19. data/lib-opal/js_wrap/three/controls/experimental/CameraControls.js +860 -0
  20. data/lib-opal/js_wrap/three/csm/CSM.js +346 -0
  21. data/lib-opal/js_wrap/three/csm/CSMFrustum.js +123 -0
  22. data/lib-opal/js_wrap/three/csm/CSMHelper.js +197 -0
  23. data/lib-opal/js_wrap/three/csm/CSMShader.js +29 -0
  24. data/lib-opal/js_wrap/three/curves/CurveExtras.js +544 -0
  25. data/lib-opal/js_wrap/three/curves/NURBSCurve.js +122 -0
  26. data/lib-opal/js_wrap/three/curves/NURBSSurface.js +78 -0
  27. data/lib-opal/js_wrap/three/curves/NURBSUtils.js +413 -0
  28. data/lib-opal/js_wrap/three/deprecated/Geometry.js +1373 -0
  29. data/lib-opal/js_wrap/three/effects/AnaglyphEffect.js +113 -0
  30. data/lib-opal/js_wrap/three/effects/AsciiEffect.js +267 -0
  31. data/lib-opal/js_wrap/three/effects/OutlineEffect.js +400 -0
  32. data/lib-opal/js_wrap/three/effects/ParallaxBarrierEffect.js +90 -0
  33. data/lib-opal/js_wrap/three/effects/PeppersGhostEffect.js +160 -0
  34. data/lib-opal/js_wrap/three/effects/StereoEffect.js +63 -0
  35. data/lib-opal/js_wrap/three/environments/DebugEnvironment.js +107 -0
  36. data/lib-opal/js_wrap/three/environments/RoomEnvironment.js +166 -0
  37. data/lib-opal/js_wrap/three/exporters/ColladaExporter.js +442 -0
  38. data/lib-opal/js_wrap/three/exporters/DRACOExporter.js +205 -0
  39. data/lib-opal/js_wrap/three/exporters/GLTFExporter.js +2042 -0
  40. data/lib-opal/js_wrap/three/exporters/MMDExporter.js +189 -0
  41. data/lib-opal/js_wrap/three/exporters/OBJExporter.js +241 -0
  42. data/lib-opal/js_wrap/three/exporters/PLYExporter.js +370 -0
  43. data/lib-opal/js_wrap/three/exporters/STLExporter.js +186 -0
  44. data/lib-opal/js_wrap/three/exporters/USDZExporter.js +402 -0
  45. data/lib-opal/js_wrap/three/geometries/BoxLineGeometry.js +106 -0
  46. data/lib-opal/js_wrap/three/geometries/ConvexGeometry.js +88 -0
  47. data/lib-opal/js_wrap/three/geometries/DecalGeometry.js +302 -0
  48. data/lib-opal/js_wrap/three/geometries/LightningStrike.js +817 -0
  49. data/lib-opal/js_wrap/three/geometries/ParametricGeometries.js +280 -0
  50. data/lib-opal/js_wrap/three/geometries/ParametricGeometry.js +146 -0
  51. data/lib-opal/js_wrap/three/geometries/RoundedBoxGeometry.js +183 -0
  52. data/lib-opal/js_wrap/three/geometries/TeapotGeometry.js +352 -0
  53. data/lib-opal/js_wrap/three/geometries/TextGeometry.js +76 -0
  54. data/lib-opal/js_wrap/three/helpers/LightProbeHelper.js +95 -0
  55. data/lib-opal/js_wrap/three/helpers/PositionalAudioHelper.js +138 -0
  56. data/lib-opal/js_wrap/three/helpers/RectAreaLightHelper.js +115 -0
  57. data/lib-opal/js_wrap/three/helpers/VertexNormalsHelper.js +131 -0
  58. data/lib-opal/js_wrap/three/helpers/VertexTangentsHelper.js +118 -0
  59. data/lib-opal/js_wrap/three/interactive/HTMLMesh.js +307 -0
  60. data/lib-opal/js_wrap/three/interactive/InteractiveGroup.js +138 -0
  61. data/lib-opal/js_wrap/three/interactive/SelectionBox.js +264 -0
  62. data/lib-opal/js_wrap/three/interactive/SelectionHelper.js +88 -0
  63. data/lib-opal/js_wrap/three/libs/OimoPhysics/OimoPhysics.js +46059 -0
  64. data/lib-opal/js_wrap/three/libs/OimoPhysics/index.js +92 -0
  65. data/lib-opal/js_wrap/three/libs/chevrotain.module.min.js +6947 -0
  66. data/lib-opal/js_wrap/three/libs/ecsy.module.js +1999 -0
  67. data/lib-opal/js_wrap/three/libs/fflate.module.js +3002 -0
  68. data/lib-opal/js_wrap/three/libs/flow.module.js +3033 -0
  69. data/lib-opal/js_wrap/three/libs/ktx-parse.module.js +392 -0
  70. data/lib-opal/js_wrap/three/libs/lil-gui.module.min.js +821 -0
  71. data/lib-opal/js_wrap/three/libs/meshopt_decoder.module.js +136 -0
  72. data/lib-opal/js_wrap/three/libs/mmdparser.module.js +11022 -0
  73. data/lib-opal/js_wrap/three/libs/motion-controllers.module.js +589 -0
  74. data/lib-opal/js_wrap/three/libs/opentype.module.min.js +6132 -0
  75. data/lib-opal/js_wrap/three/libs/potpack.module.js +171 -0
  76. data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.js +6781 -0
  77. data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.module.js +6783 -0
  78. data/lib-opal/js_wrap/three/libs/stats.module.js +139 -0
  79. data/lib-opal/js_wrap/three/libs/tween.module.min.js +349 -0
  80. data/lib-opal/js_wrap/three/lights/LightProbeGenerator.js +233 -0
  81. data/lib-opal/js_wrap/three/lights/RectAreaLightUniformsLib.js +75 -0
  82. data/lib-opal/js_wrap/three/lines/Line2.js +66 -0
  83. data/lib-opal/js_wrap/three/lines/LineGeometry.js +122 -0
  84. data/lib-opal/js_wrap/three/lines/LineMaterial.js +227 -0
  85. data/lib-opal/js_wrap/three/lines/LineSegments2.js +312 -0
  86. data/lib-opal/js_wrap/three/lines/LineSegmentsGeometry.js +238 -0
  87. data/lib-opal/js_wrap/three/lines/Wireframe.js +98 -0
  88. data/lib-opal/js_wrap/three/lines/WireframeGeometry2.js +65 -0
  89. data/lib-opal/js_wrap/three/loaders/3DMLoader.js +1230 -0
  90. data/lib-opal/js_wrap/three/loaders/3MFLoader.js +1123 -0
  91. data/lib-opal/js_wrap/three/loaders/AMFLoader.js +445 -0
  92. data/lib-opal/js_wrap/three/loaders/BVHLoader.js +365 -0
  93. data/lib-opal/js_wrap/three/loaders/BasisTextureLoader.js +692 -0
  94. data/lib-opal/js_wrap/three/loaders/ColladaLoader.js +3046 -0
  95. data/lib-opal/js_wrap/three/loaders/DDSLoader.js +264 -0
  96. data/lib-opal/js_wrap/three/loaders/DRACOLoader.js +531 -0
  97. data/lib-opal/js_wrap/three/loaders/EXRLoader.js +1834 -0
  98. data/lib-opal/js_wrap/three/loaders/FBXLoader.js +3125 -0
  99. data/lib-opal/js_wrap/three/loaders/FontLoader.js +201 -0
  100. data/lib-opal/js_wrap/three/loaders/GCodeLoader.js +248 -0
  101. data/lib-opal/js_wrap/three/loaders/GLTFLoader.js +3334 -0
  102. data/lib-opal/js_wrap/three/loaders/HDRCubeTextureLoader.js +144 -0
  103. data/lib-opal/js_wrap/three/loaders/IFCLoader.js +2395 -0
  104. data/lib-opal/js_wrap/three/loaders/KMZLoader.js +142 -0
  105. data/lib-opal/js_wrap/three/loaders/KTX2Loader.js +535 -0
  106. data/lib-opal/js_wrap/three/loaders/KTXLoader.js +202 -0
  107. data/lib-opal/js_wrap/three/loaders/LDrawLoader.js +1737 -0
  108. data/lib-opal/js_wrap/three/loaders/LUT3dlLoader.js +163 -0
  109. data/lib-opal/js_wrap/three/loaders/LUTCubeLoader.js +171 -0
  110. data/lib-opal/js_wrap/three/loaders/LWOLoader.js +831 -0
  111. data/lib-opal/js_wrap/three/loaders/LogLuvLoader.js +713 -0
  112. data/lib-opal/js_wrap/three/loaders/LottieLoader.js +103 -0
  113. data/lib-opal/js_wrap/three/loaders/MD2Loader.js +258 -0
  114. data/lib-opal/js_wrap/three/loaders/MDDLoader.js +116 -0
  115. data/lib-opal/js_wrap/three/loaders/MMDLoader.js +1687 -0
  116. data/lib-opal/js_wrap/three/loaders/MTLLoader.js +465 -0
  117. data/lib-opal/js_wrap/three/loaders/NRRDLoader.js +554 -0
  118. data/lib-opal/js_wrap/three/loaders/NodeMaterialLoader.js +248 -0
  119. data/lib-opal/js_wrap/three/loaders/OBJLoader.js +673 -0
  120. data/lib-opal/js_wrap/three/loaders/PCDLoader.js +322 -0
  121. data/lib-opal/js_wrap/three/loaders/PDBLoader.js +318 -0
  122. data/lib-opal/js_wrap/three/loaders/PLYLoader.js +489 -0
  123. data/lib-opal/js_wrap/three/loaders/PRWMLoader.js +247 -0
  124. data/lib-opal/js_wrap/three/loaders/PVRLoader.js +240 -0
  125. data/lib-opal/js_wrap/three/loaders/RGBELoader.js +462 -0
  126. data/lib-opal/js_wrap/three/loaders/RGBMLoader.js +1169 -0
  127. data/lib-opal/js_wrap/three/loaders/STLLoader.js +345 -0
  128. data/lib-opal/js_wrap/three/loaders/SVGLoader.js +2162 -0
  129. data/lib-opal/js_wrap/three/loaders/TDSLoader.js +982 -0
  130. data/lib-opal/js_wrap/three/loaders/TGALoader.js +444 -0
  131. data/lib-opal/js_wrap/three/loaders/TTFLoader.js +210 -0
  132. data/lib-opal/js_wrap/three/loaders/TiltLoader.js +391 -0
  133. data/lib-opal/js_wrap/three/loaders/VOXLoader.js +272 -0
  134. data/lib-opal/js_wrap/three/loaders/VRMLLoader.js +2685 -0
  135. data/lib-opal/js_wrap/three/loaders/VRMLoader.js +103 -0
  136. data/lib-opal/js_wrap/three/loaders/VTKLoader.js +894 -0
  137. data/lib-opal/js_wrap/three/loaders/XYZLoader.js +136 -0
  138. data/lib-opal/js_wrap/three/loaders/ifc/web-ifc-api.js +60504 -0
  139. data/lib-opal/js_wrap/three/loaders/lwo/IFFParser.js +931 -0
  140. data/lib-opal/js_wrap/three/loaders/lwo/LWO2Parser.js +450 -0
  141. data/lib-opal/js_wrap/three/loaders/lwo/LWO3Parser.js +406 -0
  142. data/lib-opal/js_wrap/three/math/Capsule.js +133 -0
  143. data/lib-opal/js_wrap/three/math/ColorConverter.js +104 -0
  144. data/lib-opal/js_wrap/three/math/ConvexHull.js +924 -0
  145. data/lib-opal/js_wrap/three/math/ImprovedNoise.js +86 -0
  146. data/lib-opal/js_wrap/three/math/Lut.js +170 -0
  147. data/lib-opal/js_wrap/three/math/MeshSurfaceSampler.js +187 -0
  148. data/lib-opal/js_wrap/three/math/OBB.js +345 -0
  149. data/lib-opal/js_wrap/three/math/Octree.js +409 -0
  150. data/lib-opal/js_wrap/three/math/SimplexNoise.js +425 -0
  151. data/lib-opal/js_wrap/three/misc/ConvexObjectBreaker.js +447 -0
  152. data/lib-opal/js_wrap/three/misc/GPUComputationRenderer.js +322 -0
  153. data/lib-opal/js_wrap/three/misc/Gyroscope.js +94 -0
  154. data/lib-opal/js_wrap/three/misc/MD2Character.js +225 -0
  155. data/lib-opal/js_wrap/three/misc/MD2CharacterComplex.js +424 -0
  156. data/lib-opal/js_wrap/three/misc/MorphAnimMesh.js +109 -0
  157. data/lib-opal/js_wrap/three/misc/MorphBlendMesh.js +283 -0
  158. data/lib-opal/js_wrap/three/misc/ProgressiveLightMap.js +324 -0
  159. data/lib-opal/js_wrap/three/misc/RollerCoaster.js +489 -0
  160. data/lib-opal/js_wrap/three/misc/TubePainter.js +158 -0
  161. data/lib-opal/js_wrap/three/misc/Volume.js +427 -0
  162. data/lib-opal/js_wrap/three/misc/VolumeSlice.js +210 -0
  163. data/lib-opal/js_wrap/three/modifiers/CurveModifier.js +291 -0
  164. data/lib-opal/js_wrap/three/modifiers/EdgeSplitModifier.js +308 -0
  165. data/lib-opal/js_wrap/three/modifiers/SimplifyModifier.js +435 -0
  166. data/lib-opal/js_wrap/three/modifiers/TessellateModifier.js +264 -0
  167. data/lib-opal/js_wrap/three/node-editor/NodeEditor.js +402 -0
  168. data/lib-opal/js_wrap/three/node-editor/accessors/NormalEditor.js +80 -0
  169. data/lib-opal/js_wrap/three/node-editor/accessors/PositionEditor.js +80 -0
  170. data/lib-opal/js_wrap/three/node-editor/accessors/UVEditor.js +71 -0
  171. data/lib-opal/js_wrap/three/node-editor/display/BlendEditor.js +78 -0
  172. data/lib-opal/js_wrap/three/node-editor/inputs/ColorEditor.js +111 -0
  173. data/lib-opal/js_wrap/three/node-editor/inputs/FloatEditor.js +69 -0
  174. data/lib-opal/js_wrap/three/node-editor/inputs/SliderEditor.js +97 -0
  175. data/lib-opal/js_wrap/three/node-editor/inputs/Vector2Editor.js +73 -0
  176. data/lib-opal/js_wrap/three/node-editor/inputs/Vector3Editor.js +75 -0
  177. data/lib-opal/js_wrap/three/node-editor/inputs/Vector4Editor.js +77 -0
  178. data/lib-opal/js_wrap/three/node-editor/materials/StandardMaterialEditor.js +121 -0
  179. data/lib-opal/js_wrap/three/node-editor/math/DotEditor.js +76 -0
  180. data/lib-opal/js_wrap/three/node-editor/math/InvertEditor.js +80 -0
  181. data/lib-opal/js_wrap/three/node-editor/math/LimiterEditor.js +85 -0
  182. data/lib-opal/js_wrap/three/node-editor/math/NormalizeEditor.js +69 -0
  183. data/lib-opal/js_wrap/three/node-editor/math/OperatorEditor.js +91 -0
  184. data/lib-opal/js_wrap/three/node-editor/math/PowerEditor.js +73 -0
  185. data/lib-opal/js_wrap/three/node-editor/math/TrigonometryEditor.js +83 -0
  186. data/lib-opal/js_wrap/three/node-editor/procedural/CheckerEditor.js +69 -0
  187. data/lib-opal/js_wrap/three/node-editor/utils/OscillatorEditor.js +87 -0
  188. data/lib-opal/js_wrap/three/node-editor/utils/TimerEditor.js +89 -0
  189. data/lib-opal/js_wrap/three/nodes/Nodes.js +481 -0
  190. data/lib-opal/js_wrap/three/nodes/accessors/CameraNode.js +222 -0
  191. data/lib-opal/js_wrap/three/nodes/accessors/ColorsNode.js +99 -0
  192. data/lib-opal/js_wrap/three/nodes/accessors/LightNode.js +100 -0
  193. data/lib-opal/js_wrap/three/nodes/accessors/NormalNode.js +152 -0
  194. data/lib-opal/js_wrap/three/nodes/accessors/PositionNode.js +163 -0
  195. data/lib-opal/js_wrap/three/nodes/accessors/ReflectNode.js +161 -0
  196. data/lib-opal/js_wrap/three/nodes/accessors/ResolutionNode.js +99 -0
  197. data/lib-opal/js_wrap/three/nodes/accessors/ScreenUVNode.js +101 -0
  198. data/lib-opal/js_wrap/three/nodes/accessors/UVNode.js +105 -0
  199. data/lib-opal/js_wrap/three/nodes/core/AttributeNode.js +106 -0
  200. data/lib-opal/js_wrap/three/nodes/core/ConstNode.js +149 -0
  201. data/lib-opal/js_wrap/three/nodes/core/ExpressionNode.js +57 -0
  202. data/lib-opal/js_wrap/three/nodes/core/FunctionCallNode.js +138 -0
  203. data/lib-opal/js_wrap/three/nodes/core/FunctionNode.js +259 -0
  204. data/lib-opal/js_wrap/three/nodes/core/InputNode.js +124 -0
  205. data/lib-opal/js_wrap/three/nodes/core/Node.js +193 -0
  206. data/lib-opal/js_wrap/three/nodes/core/NodeBuilder.js +782 -0
  207. data/lib-opal/js_wrap/three/nodes/core/NodeFrame.js +69 -0
  208. data/lib-opal/js_wrap/three/nodes/core/NodeLib.js +56 -0
  209. data/lib-opal/js_wrap/three/nodes/core/NodeUniform.js +53 -0
  210. data/lib-opal/js_wrap/three/nodes/core/NodeUtils.js +60 -0
  211. data/lib-opal/js_wrap/three/nodes/core/StructNode.js +131 -0
  212. data/lib-opal/js_wrap/three/nodes/core/TempNode.js +160 -0
  213. data/lib-opal/js_wrap/three/nodes/core/VarNode.js +105 -0
  214. data/lib-opal/js_wrap/three/nodes/effects/BlurNode.js +160 -0
  215. data/lib-opal/js_wrap/three/nodes/effects/ColorAdjustmentNode.js +139 -0
  216. data/lib-opal/js_wrap/three/nodes/effects/LuminanceNode.js +106 -0
  217. data/lib-opal/js_wrap/three/nodes/inputs/BoolNode.js +95 -0
  218. data/lib-opal/js_wrap/three/nodes/inputs/ColorNode.js +99 -0
  219. data/lib-opal/js_wrap/three/nodes/inputs/CubeTextureNode.js +136 -0
  220. data/lib-opal/js_wrap/three/nodes/inputs/FloatNode.js +95 -0
  221. data/lib-opal/js_wrap/three/nodes/inputs/IntNode.js +95 -0
  222. data/lib-opal/js_wrap/three/nodes/inputs/Matrix3Node.js +102 -0
  223. data/lib-opal/js_wrap/three/nodes/inputs/Matrix4Node.js +102 -0
  224. data/lib-opal/js_wrap/three/nodes/inputs/PropertyNode.js +85 -0
  225. data/lib-opal/js_wrap/three/nodes/inputs/RTTNode.js +164 -0
  226. data/lib-opal/js_wrap/three/nodes/inputs/ReflectorNode.js +111 -0
  227. data/lib-opal/js_wrap/three/nodes/inputs/ScreenNode.js +69 -0
  228. data/lib-opal/js_wrap/three/nodes/inputs/TextureNode.js +140 -0
  229. data/lib-opal/js_wrap/three/nodes/inputs/Vector2Node.js +98 -0
  230. data/lib-opal/js_wrap/three/nodes/inputs/Vector3Node.js +99 -0
  231. data/lib-opal/js_wrap/three/nodes/inputs/Vector4Node.js +100 -0
  232. data/lib-opal/js_wrap/three/nodes/materials/BasicNodeMaterial.js +63 -0
  233. data/lib-opal/js_wrap/three/nodes/materials/MeshStandardNodeMaterial.js +63 -0
  234. data/lib-opal/js_wrap/three/nodes/materials/NodeMaterial.js +202 -0
  235. data/lib-opal/js_wrap/three/nodes/materials/PhongNodeMaterial.js +63 -0
  236. data/lib-opal/js_wrap/three/nodes/materials/SpriteNodeMaterial.js +63 -0
  237. data/lib-opal/js_wrap/three/nodes/materials/StandardNodeMaterial.js +63 -0
  238. data/lib-opal/js_wrap/three/nodes/materials/nodes/BasicNode.js +146 -0
  239. data/lib-opal/js_wrap/three/nodes/materials/nodes/MeshStandardNode.js +133 -0
  240. data/lib-opal/js_wrap/three/nodes/materials/nodes/PhongNode.js +273 -0
  241. data/lib-opal/js_wrap/three/nodes/materials/nodes/RawNode.js +101 -0
  242. data/lib-opal/js_wrap/three/nodes/materials/nodes/SpriteNode.js +176 -0
  243. data/lib-opal/js_wrap/three/nodes/materials/nodes/StandardNode.js +397 -0
  244. data/lib-opal/js_wrap/three/nodes/math/CondNode.js +151 -0
  245. data/lib-opal/js_wrap/three/nodes/math/MathNode.js +266 -0
  246. data/lib-opal/js_wrap/three/nodes/math/OperatorNode.js +120 -0
  247. data/lib-opal/js_wrap/three/nodes/misc/BumpMapNode.js +139 -0
  248. data/lib-opal/js_wrap/three/nodes/misc/NormalMapNode.js +122 -0
  249. data/lib-opal/js_wrap/three/nodes/misc/TextureCubeNode.js +107 -0
  250. data/lib-opal/js_wrap/three/nodes/misc/TextureCubeUVNode.js +191 -0
  251. data/lib-opal/js_wrap/three/nodes/postprocessing/NodePass.js +117 -0
  252. data/lib-opal/js_wrap/three/nodes/postprocessing/NodePostProcessing.js +128 -0
  253. data/lib-opal/js_wrap/three/nodes/procedural/CheckerNode.js +104 -0
  254. data/lib-opal/js_wrap/three/nodes/procedural/Fractal3DNode.js +121 -0
  255. data/lib-opal/js_wrap/three/nodes/procedural/Noise2DNode.js +115 -0
  256. data/lib-opal/js_wrap/three/nodes/procedural/Noise3DNode.js +112 -0
  257. data/lib-opal/js_wrap/three/nodes/utils/BypassNode.js +115 -0
  258. data/lib-opal/js_wrap/three/nodes/utils/ColorSpaceNode.js +214 -0
  259. data/lib-opal/js_wrap/three/nodes/utils/JoinNode.js +138 -0
  260. data/lib-opal/js_wrap/three/nodes/utils/MaxMIPLevelNode.js +88 -0
  261. data/lib-opal/js_wrap/three/nodes/utils/RemapNode.js +117 -0
  262. data/lib-opal/js_wrap/three/nodes/utils/SpecularMIPLevelNode.js +121 -0
  263. data/lib-opal/js_wrap/three/nodes/utils/SubSlotNode.js +112 -0
  264. data/lib-opal/js_wrap/three/nodes/utils/SwitchNode.js +129 -0
  265. data/lib-opal/js_wrap/three/nodes/utils/TimerNode.js +126 -0
  266. data/lib-opal/js_wrap/three/nodes/utils/UVTransformNode.js +104 -0
  267. data/lib-opal/js_wrap/three/nodes/utils/VelocityNode.js +181 -0
  268. data/lib-opal/js_wrap/three/objects/Lensflare.js +285 -0
  269. data/lib-opal/js_wrap/three/objects/LightningStorm.js +238 -0
  270. data/lib-opal/js_wrap/three/objects/MarchingCubes.js +667 -0
  271. data/lib-opal/js_wrap/three/objects/Reflector.js +205 -0
  272. data/lib-opal/js_wrap/three/objects/ReflectorForSSRPass.js +288 -0
  273. data/lib-opal/js_wrap/three/objects/ReflectorRTT.js +63 -0
  274. data/lib-opal/js_wrap/three/objects/Refractor.js +243 -0
  275. data/lib-opal/js_wrap/three/objects/ShadowMesh.js +100 -0
  276. data/lib-opal/js_wrap/three/objects/Sky.js +107 -0
  277. data/lib-opal/js_wrap/three/objects/Water.js +246 -0
  278. data/lib-opal/js_wrap/three/objects/Water2.js +238 -0
  279. data/lib-opal/js_wrap/three/offscreen/jank.js +51 -0
  280. data/lib-opal/js_wrap/three/offscreen/offscreen.js +24 -0
  281. data/lib-opal/js_wrap/three/offscreen/scene.js +99 -0
  282. data/lib-opal/js_wrap/three/physics/AmmoPhysics.js +266 -0
  283. data/lib-opal/js_wrap/three/physics/OimoPhysics.js +214 -0
  284. data/lib-opal/js_wrap/three/postprocessing/AdaptiveToneMappingPass.js +307 -0
  285. data/lib-opal/js_wrap/three/postprocessing/AfterimagePass.js +116 -0
  286. data/lib-opal/js_wrap/three/postprocessing/BloomPass.js +132 -0
  287. data/lib-opal/js_wrap/three/postprocessing/BokehPass.js +143 -0
  288. data/lib-opal/js_wrap/three/postprocessing/ClearPass.js +85 -0
  289. data/lib-opal/js_wrap/three/postprocessing/CubeTexturePass.js +104 -0
  290. data/lib-opal/js_wrap/three/postprocessing/DotScreenPass.js +90 -0
  291. data/lib-opal/js_wrap/three/postprocessing/EffectComposer.js +272 -0
  292. data/lib-opal/js_wrap/three/postprocessing/FilmPass.js +91 -0
  293. data/lib-opal/js_wrap/three/postprocessing/GlitchPass.js +140 -0
  294. data/lib-opal/js_wrap/three/postprocessing/HalftonePass.js +108 -0
  295. data/lib-opal/js_wrap/three/postprocessing/LUTPass.js +132 -0
  296. data/lib-opal/js_wrap/three/postprocessing/MaskPass.js +142 -0
  297. data/lib-opal/js_wrap/three/postprocessing/OutlinePass.js +480 -0
  298. data/lib-opal/js_wrap/three/postprocessing/Pass.js +101 -0
  299. data/lib-opal/js_wrap/three/postprocessing/RenderPass.js +109 -0
  300. data/lib-opal/js_wrap/three/postprocessing/SAOPass.js +384 -0
  301. data/lib-opal/js_wrap/three/postprocessing/SMAAPass.js +199 -0
  302. data/lib-opal/js_wrap/three/postprocessing/SSAARenderPass.js +186 -0
  303. data/lib-opal/js_wrap/three/postprocessing/SSAOPass.js +388 -0
  304. data/lib-opal/js_wrap/three/postprocessing/SSRPass.js +537 -0
  305. data/lib-opal/js_wrap/three/postprocessing/SSRrPass.js +481 -0
  306. data/lib-opal/js_wrap/three/postprocessing/SavePass.js +96 -0
  307. data/lib-opal/js_wrap/three/postprocessing/ShaderPass.js +98 -0
  308. data/lib-opal/js_wrap/three/postprocessing/TAARenderPass.js +159 -0
  309. data/lib-opal/js_wrap/three/postprocessing/TexturePass.js +91 -0
  310. data/lib-opal/js_wrap/three/postprocessing/UnrealBloomPass.js +335 -0
  311. data/lib-opal/js_wrap/three/renderers/CSS2DRenderer.js +213 -0
  312. data/lib-opal/js_wrap/three/renderers/CSS3DRenderer.js +277 -0
  313. data/lib-opal/js_wrap/three/renderers/Projector.js +733 -0
  314. data/lib-opal/js_wrap/three/renderers/SVGRenderer.js +470 -0
  315. data/lib-opal/js_wrap/three/renderers/nodes/Nodes.js +531 -0
  316. data/lib-opal/js_wrap/three/renderers/nodes/ShaderNode.js +386 -0
  317. data/lib-opal/js_wrap/three/renderers/nodes/accessors/CameraNode.js +114 -0
  318. data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialNode.js +140 -0
  319. data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialReferenceNode.js +79 -0
  320. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelNode.js +62 -0
  321. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelViewProjectionNode.js +80 -0
  322. data/lib-opal/js_wrap/three/renderers/nodes/accessors/NormalNode.js +113 -0
  323. data/lib-opal/js_wrap/three/renderers/nodes/accessors/Object3DNode.js +136 -0
  324. data/lib-opal/js_wrap/three/renderers/nodes/accessors/PointUVNode.js +70 -0
  325. data/lib-opal/js_wrap/three/renderers/nodes/accessors/PositionNode.js +117 -0
  326. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ReferenceNode.js +124 -0
  327. data/lib-opal/js_wrap/three/renderers/nodes/accessors/SkinningNode.js +129 -0
  328. data/lib-opal/js_wrap/three/renderers/nodes/accessors/UVNode.js +77 -0
  329. data/lib-opal/js_wrap/three/renderers/nodes/core/ArrayInputNode.js +74 -0
  330. data/lib-opal/js_wrap/three/renderers/nodes/core/AttributeNode.js +97 -0
  331. data/lib-opal/js_wrap/three/renderers/nodes/core/BypassNode.js +84 -0
  332. data/lib-opal/js_wrap/three/renderers/nodes/core/CodeNode.js +131 -0
  333. data/lib-opal/js_wrap/three/renderers/nodes/core/ContextNode.js +84 -0
  334. data/lib-opal/js_wrap/three/renderers/nodes/core/ExpressionNode.js +81 -0
  335. data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionCallNode.js +123 -0
  336. data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionNode.js +126 -0
  337. data/lib-opal/js_wrap/three/renderers/nodes/core/InputNode.js +103 -0
  338. data/lib-opal/js_wrap/three/renderers/nodes/core/Node.js +120 -0
  339. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeAttribute.js +37 -0
  340. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeBuilder.js +650 -0
  341. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeCode.js +42 -0
  342. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFrame.js +70 -0
  343. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunction.js +55 -0
  344. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunctionInput.js +44 -0
  345. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeKeywords.js +117 -0
  346. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeParser.js +46 -0
  347. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeUniform.js +55 -0
  348. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVar.js +37 -0
  349. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVary.js +37 -0
  350. data/lib-opal/js_wrap/three/renderers/nodes/core/PropertyNode.js +90 -0
  351. data/lib-opal/js_wrap/three/renderers/nodes/core/TempNode.js +89 -0
  352. data/lib-opal/js_wrap/three/renderers/nodes/core/VarNode.js +101 -0
  353. data/lib-opal/js_wrap/three/renderers/nodes/core/VaryNode.js +101 -0
  354. data/lib-opal/js_wrap/three/renderers/nodes/core/constants.js +42 -0
  355. data/lib-opal/js_wrap/three/renderers/nodes/display/ColorSpaceNode.js +165 -0
  356. data/lib-opal/js_wrap/three/renderers/nodes/display/NormalMapNode.js +120 -0
  357. data/lib-opal/js_wrap/three/renderers/nodes/functions/BSDFs.js +133 -0
  358. data/lib-opal/js_wrap/three/renderers/nodes/inputs/BufferNode.js +78 -0
  359. data/lib-opal/js_wrap/three/renderers/nodes/inputs/ColorNode.js +67 -0
  360. data/lib-opal/js_wrap/three/renderers/nodes/inputs/FloatNode.js +67 -0
  361. data/lib-opal/js_wrap/three/renderers/nodes/inputs/IntNode.js +67 -0
  362. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix3Node.js +67 -0
  363. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix4Node.js +67 -0
  364. data/lib-opal/js_wrap/three/renderers/nodes/inputs/TextureNode.js +120 -0
  365. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector2Node.js +67 -0
  366. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector3Node.js +67 -0
  367. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector4Node.js +67 -0
  368. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightContextNode.js +103 -0
  369. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightNode.js +115 -0
  370. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightsNode.js +117 -0
  371. data/lib-opal/js_wrap/three/renderers/nodes/materials/LineBasicNodeMaterial.js +82 -0
  372. data/lib-opal/js_wrap/three/renderers/nodes/materials/Materials.js +49 -0
  373. data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshBasicNodeMaterial.js +82 -0
  374. data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshStandardNodeMaterial.js +96 -0
  375. data/lib-opal/js_wrap/three/renderers/nodes/materials/PointsNodeMaterial.js +84 -0
  376. data/lib-opal/js_wrap/three/renderers/nodes/math/CondNode.js +98 -0
  377. data/lib-opal/js_wrap/three/renderers/nodes/math/MathNode.js +255 -0
  378. data/lib-opal/js_wrap/three/renderers/nodes/math/OperatorNode.js +163 -0
  379. data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeFunction.js +158 -0
  380. data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeParser.js +68 -0
  381. data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeFunction.js +126 -0
  382. data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeParser.js +68 -0
  383. data/lib-opal/js_wrap/three/renderers/nodes/procedural/CheckerNode.js +84 -0
  384. data/lib-opal/js_wrap/three/renderers/nodes/utils/ArrayElementNode.js +79 -0
  385. data/lib-opal/js_wrap/three/renderers/nodes/utils/ConvertNode.js +82 -0
  386. data/lib-opal/js_wrap/three/renderers/nodes/utils/JoinNode.js +88 -0
  387. data/lib-opal/js_wrap/three/renderers/nodes/utils/OscNode.js +105 -0
  388. data/lib-opal/js_wrap/three/renderers/nodes/utils/SplitNode.js +96 -0
  389. data/lib-opal/js_wrap/three/renderers/nodes/utils/SpriteSheetUVNode.js +98 -0
  390. data/lib-opal/js_wrap/three/renderers/nodes/utils/TimerNode.js +93 -0
  391. data/lib-opal/js_wrap/three/renderers/webgl/nodes/SlotNode.js +72 -0
  392. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodeBuilder.js +463 -0
  393. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodes.js +62 -0
  394. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLPhysicalContextNode.js +95 -0
  395. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPU.js +62 -0
  396. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUAttributes.js +118 -0
  397. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBackground.js +109 -0
  398. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBinding.js +52 -0
  399. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBindings.js +254 -0
  400. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBufferUtils.js +39 -0
  401. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUComputePipelines.js +82 -0
  402. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUGeometries.js +84 -0
  403. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUInfo.js +86 -0
  404. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUObjects.js +64 -0
  405. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProgrammableStage.js +46 -0
  406. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProperties.js +63 -0
  407. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderLists.js +180 -0
  408. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipeline.js +662 -0
  409. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipelines.js +275 -0
  410. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderer.js +883 -0
  411. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampledTexture.js +139 -0
  412. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampler.js +76 -0
  413. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUStorageBuffer.js +69 -0
  414. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureRenderer.js +64 -0
  415. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureUtils.js +125 -0
  416. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextures.js +681 -0
  417. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniform.js +237 -0
  418. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformBuffer.js +90 -0
  419. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformsGroup.js +294 -0
  420. data/lib-opal/js_wrap/three/renderers/webgpu/constants.js +263 -0
  421. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeBuilder.js +619 -0
  422. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampledTexture.js +67 -0
  423. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampler.js +71 -0
  424. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniform.js +229 -0
  425. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +68 -0
  426. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodes.js +106 -0
  427. data/lib-opal/js_wrap/three/shaders/ACESFilmicToneMappingShader.js +45 -0
  428. data/lib-opal/js_wrap/three/shaders/AfterimageShader.js +46 -0
  429. data/lib-opal/js_wrap/three/shaders/BasicShader.js +34 -0
  430. data/lib-opal/js_wrap/three/shaders/BleachBypassShader.js +43 -0
  431. data/lib-opal/js_wrap/three/shaders/BlendShader.js +47 -0
  432. data/lib-opal/js_wrap/three/shaders/BokehShader.js +65 -0
  433. data/lib-opal/js_wrap/three/shaders/BokehShader2.js +125 -0
  434. data/lib-opal/js_wrap/three/shaders/BrightnessContrastShader.js +47 -0
  435. data/lib-opal/js_wrap/three/shaders/ColorCorrectionShader.js +47 -0
  436. data/lib-opal/js_wrap/three/shaders/ColorifyShader.js +41 -0
  437. data/lib-opal/js_wrap/three/shaders/ConvolutionShader.js +75 -0
  438. data/lib-opal/js_wrap/three/shaders/CopyShader.js +41 -0
  439. data/lib-opal/js_wrap/three/shaders/DOFMipMapShader.js +49 -0
  440. data/lib-opal/js_wrap/three/shaders/DepthLimitedBlurShader.js +95 -0
  441. data/lib-opal/js_wrap/three/shaders/DigitalGlitch.js +79 -0
  442. data/lib-opal/js_wrap/three/shaders/DotScreenShader.js +52 -0
  443. data/lib-opal/js_wrap/three/shaders/FXAAShader.js +78 -0
  444. data/lib-opal/js_wrap/three/shaders/FilmShader.js +69 -0
  445. data/lib-opal/js_wrap/three/shaders/FocusShader.js +52 -0
  446. data/lib-opal/js_wrap/three/shaders/FreiChenShader.js +44 -0
  447. data/lib-opal/js_wrap/three/shaders/GammaCorrectionShader.js +39 -0
  448. data/lib-opal/js_wrap/three/shaders/GodRaysShader.js +140 -0
  449. data/lib-opal/js_wrap/three/shaders/HalftoneShader.js +77 -0
  450. data/lib-opal/js_wrap/three/shaders/HorizontalBlurShader.js +47 -0
  451. data/lib-opal/js_wrap/three/shaders/HorizontalTiltShiftShader.js +49 -0
  452. data/lib-opal/js_wrap/three/shaders/HueSaturationShader.js +47 -0
  453. data/lib-opal/js_wrap/three/shaders/KaleidoShader.js +50 -0
  454. data/lib-opal/js_wrap/three/shaders/LuminosityHighPassShader.js +52 -0
  455. data/lib-opal/js_wrap/three/shaders/LuminosityShader.js +39 -0
  456. data/lib-opal/js_wrap/three/shaders/MMDToonShader.js +48 -0
  457. data/lib-opal/js_wrap/three/shaders/MirrorShader.js +44 -0
  458. data/lib-opal/js_wrap/three/shaders/NormalMapShader.js +48 -0
  459. data/lib-opal/js_wrap/three/shaders/PixelShader.js +44 -0
  460. data/lib-opal/js_wrap/three/shaders/RGBShiftShader.js +50 -0
  461. data/lib-opal/js_wrap/three/shaders/SAOShader.js +85 -0
  462. data/lib-opal/js_wrap/three/shaders/SMAAShader.js +95 -0
  463. data/lib-opal/js_wrap/three/shaders/SSAOShader.js +113 -0
  464. data/lib-opal/js_wrap/three/shaders/SSRShader.js +126 -0
  465. data/lib-opal/js_wrap/three/shaders/SSRrShader.js +106 -0
  466. data/lib-opal/js_wrap/three/shaders/SepiaShader.js +43 -0
  467. data/lib-opal/js_wrap/three/shaders/SobelOperatorShader.js +44 -0
  468. data/lib-opal/js_wrap/three/shaders/SubsurfaceScatteringShader.js +64 -0
  469. data/lib-opal/js_wrap/three/shaders/TechnicolorShader.js +41 -0
  470. data/lib-opal/js_wrap/three/shaders/ToneMapShader.js +53 -0
  471. data/lib-opal/js_wrap/three/shaders/ToonShader.js +148 -0
  472. data/lib-opal/js_wrap/three/shaders/TriangleBlurShader.js +47 -0
  473. data/lib-opal/js_wrap/three/shaders/UnpackDepthRGBAShader.js +42 -0
  474. data/lib-opal/js_wrap/three/shaders/VerticalBlurShader.js +47 -0
  475. data/lib-opal/js_wrap/three/shaders/VerticalTiltShiftShader.js +49 -0
  476. data/lib-opal/js_wrap/three/shaders/VignetteShader.js +46 -0
  477. data/lib-opal/js_wrap/three/shaders/VolumeShader.js +55 -0
  478. data/lib-opal/js_wrap/three/shaders/WaterRefractionShader.js +46 -0
  479. data/lib-opal/js_wrap/three/textures/FlakesTexture.js +61 -0
  480. data/lib-opal/js_wrap/three/utils/BufferGeometryUtils.js +683 -0
  481. data/lib-opal/js_wrap/three/utils/CameraUtils.js +97 -0
  482. data/lib-opal/js_wrap/three/utils/GPUStatsPanel.js +154 -0
  483. data/lib-opal/js_wrap/three/utils/GeometryCompressionUtils.js +468 -0
  484. data/lib-opal/js_wrap/three/utils/GeometryUtils.js +192 -0
  485. data/lib-opal/js_wrap/three/utils/PackedPhongMaterial.js +77 -0
  486. data/lib-opal/js_wrap/three/utils/RoughnessMipmapper.js +169 -0
  487. data/lib-opal/js_wrap/three/utils/SceneUtils.js +62 -0
  488. data/lib-opal/js_wrap/three/utils/ShadowMapViewer.js +182 -0
  489. data/lib-opal/js_wrap/three/utils/SkeletonUtils.js +400 -0
  490. data/lib-opal/js_wrap/three/utils/UVsDebug.js +132 -0
  491. data/lib-opal/js_wrap/three/utils/WorkerPool.js +130 -0
  492. data/lib-opal/js_wrap/three/webxr/ARButton.js +203 -0
  493. data/lib-opal/js_wrap/three/webxr/OculusHandModel.js +131 -0
  494. data/lib-opal/js_wrap/three/webxr/OculusHandPointerModel.js +328 -0
  495. data/lib-opal/js_wrap/three/webxr/Text2D.js +54 -0
  496. data/lib-opal/js_wrap/three/webxr/VRButton.js +181 -0
  497. data/lib-opal/js_wrap/three/webxr/XRControllerModelFactory.js +266 -0
  498. data/lib-opal/js_wrap/three/webxr/XREstimatedLight.js +221 -0
  499. data/lib-opal/js_wrap/three/webxr/XRHandMeshModel.js +93 -0
  500. data/lib-opal/js_wrap/three/webxr/XRHandModelFactory.js +127 -0
  501. data/lib-opal/js_wrap/three/webxr/XRHandPrimitiveModel.js +85 -0
  502. data/opal-js_wrap-three.gemspec +4 -4
  503. metadata +502 -5
@@ -0,0 +1,908 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "three"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("three"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.three);
11
+ global.OrbitControls = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _three) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.OrbitControls = _exports.MapControls = void 0;
20
+
21
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
22
+
23
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
24
+
25
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
+
27
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
+
29
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
+
31
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
32
+
33
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
34
+
35
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
36
+
37
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
38
+
39
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+
41
+ // This set of controls performs orbiting, dollying (zooming), and panning.
42
+ // Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
43
+ //
44
+ // Orbit - left mouse / touch: one-finger move
45
+ // Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
46
+ // Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move
47
+ var _changeEvent = {
48
+ type: 'change'
49
+ };
50
+ var _startEvent = {
51
+ type: 'start'
52
+ };
53
+ var _endEvent = {
54
+ type: 'end'
55
+ };
56
+
57
+ var OrbitControls = /*#__PURE__*/function (_EventDispatcher) {
58
+ _inherits(OrbitControls, _EventDispatcher);
59
+
60
+ var _super = _createSuper(OrbitControls);
61
+
62
+ function OrbitControls(object, domElement) {
63
+ var _this;
64
+
65
+ _classCallCheck(this, OrbitControls);
66
+
67
+ _this = _super.call(this);
68
+ if (domElement === undefined) console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.');
69
+ if (domElement === document) console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.');
70
+ _this.object = object;
71
+ _this.domElement = domElement;
72
+ _this.domElement.style.touchAction = 'none'; // disable touch scroll
73
+ // Set to false to disable this control
74
+
75
+ _this.enabled = true; // "target" sets the location of focus, where the object orbits around
76
+
77
+ _this.target = new _three.Vector3(); // How far you can dolly in and out ( PerspectiveCamera only )
78
+
79
+ _this.minDistance = 0;
80
+ _this.maxDistance = Infinity; // How far you can zoom in and out ( OrthographicCamera only )
81
+
82
+ _this.minZoom = 0;
83
+ _this.maxZoom = Infinity; // How far you can orbit vertically, upper and lower limits.
84
+ // Range is 0 to Math.PI radians.
85
+
86
+ _this.minPolarAngle = 0; // radians
87
+
88
+ _this.maxPolarAngle = Math.PI; // radians
89
+ // How far you can orbit horizontally, upper and lower limits.
90
+ // If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI )
91
+
92
+ _this.minAzimuthAngle = -Infinity; // radians
93
+
94
+ _this.maxAzimuthAngle = Infinity; // radians
95
+ // Set to true to enable damping (inertia)
96
+ // If damping is enabled, you must call controls.update() in your animation loop
97
+
98
+ _this.enableDamping = false;
99
+ _this.dampingFactor = 0.05; // This option actually enables dollying in and out; left as "zoom" for backwards compatibility.
100
+ // Set to false to disable zooming
101
+
102
+ _this.enableZoom = true;
103
+ _this.zoomSpeed = 1.0; // Set to false to disable rotating
104
+
105
+ _this.enableRotate = true;
106
+ _this.rotateSpeed = 1.0; // Set to false to disable panning
107
+
108
+ _this.enablePan = true;
109
+ _this.panSpeed = 1.0;
110
+ _this.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up
111
+
112
+ _this.keyPanSpeed = 7.0; // pixels moved per arrow key push
113
+ // Set to true to automatically rotate around the target
114
+ // If auto-rotate is enabled, you must call controls.update() in your animation loop
115
+
116
+ _this.autoRotate = false;
117
+ _this.autoRotateSpeed = 2.0; // 30 seconds per orbit when fps is 60
118
+ // The four arrow keys
119
+
120
+ _this.keys = {
121
+ LEFT: 'ArrowLeft',
122
+ UP: 'ArrowUp',
123
+ RIGHT: 'ArrowRight',
124
+ BOTTOM: 'ArrowDown'
125
+ }; // Mouse buttons
126
+
127
+ _this.mouseButtons = {
128
+ LEFT: _three.MOUSE.ROTATE,
129
+ MIDDLE: _three.MOUSE.DOLLY,
130
+ RIGHT: _three.MOUSE.PAN
131
+ }; // Touch fingers
132
+
133
+ _this.touches = {
134
+ ONE: _three.TOUCH.ROTATE,
135
+ TWO: _three.TOUCH.DOLLY_PAN
136
+ }; // for reset
137
+
138
+ _this.target0 = _this.target.clone();
139
+ _this.position0 = _this.object.position.clone();
140
+ _this.zoom0 = _this.object.zoom; // the target DOM element for key events
141
+
142
+ _this._domElementKeyEvents = null; //
143
+ // public methods
144
+ //
145
+
146
+ _this.getPolarAngle = function () {
147
+ return spherical.phi;
148
+ };
149
+
150
+ _this.getAzimuthalAngle = function () {
151
+ return spherical.theta;
152
+ };
153
+
154
+ _this.getDistance = function () {
155
+ return this.object.position.distanceTo(this.target);
156
+ };
157
+
158
+ _this.listenToKeyEvents = function (domElement) {
159
+ domElement.addEventListener('keydown', onKeyDown);
160
+ this._domElementKeyEvents = domElement;
161
+ };
162
+
163
+ _this.saveState = function () {
164
+ scope.target0.copy(scope.target);
165
+ scope.position0.copy(scope.object.position);
166
+ scope.zoom0 = scope.object.zoom;
167
+ };
168
+
169
+ _this.reset = function () {
170
+ scope.target.copy(scope.target0);
171
+ scope.object.position.copy(scope.position0);
172
+ scope.object.zoom = scope.zoom0;
173
+ scope.object.updateProjectionMatrix();
174
+ scope.dispatchEvent(_changeEvent);
175
+ scope.update();
176
+ state = STATE.NONE;
177
+ }; // this method is exposed, but perhaps it would be better if we can make it private...
178
+
179
+
180
+ _this.update = function () {
181
+ var offset = new _three.Vector3(); // so camera.up is the orbit axis
182
+
183
+ var quat = new _three.Quaternion().setFromUnitVectors(object.up, new _three.Vector3(0, 1, 0));
184
+ var quatInverse = quat.clone().invert();
185
+ var lastPosition = new _three.Vector3();
186
+ var lastQuaternion = new _three.Quaternion();
187
+ var twoPI = 2 * Math.PI;
188
+ return function update() {
189
+ var position = scope.object.position;
190
+ offset.copy(position).sub(scope.target); // rotate offset to "y-axis-is-up" space
191
+
192
+ offset.applyQuaternion(quat); // angle from z-axis around y-axis
193
+
194
+ spherical.setFromVector3(offset);
195
+
196
+ if (scope.autoRotate && state === STATE.NONE) {
197
+ rotateLeft(getAutoRotationAngle());
198
+ }
199
+
200
+ if (scope.enableDamping) {
201
+ spherical.theta += sphericalDelta.theta * scope.dampingFactor;
202
+ spherical.phi += sphericalDelta.phi * scope.dampingFactor;
203
+ } else {
204
+ spherical.theta += sphericalDelta.theta;
205
+ spherical.phi += sphericalDelta.phi;
206
+ } // restrict theta to be between desired limits
207
+
208
+
209
+ var min = scope.minAzimuthAngle;
210
+ var max = scope.maxAzimuthAngle;
211
+
212
+ if (isFinite(min) && isFinite(max)) {
213
+ if (min < -Math.PI) min += twoPI;else if (min > Math.PI) min -= twoPI;
214
+ if (max < -Math.PI) max += twoPI;else if (max > Math.PI) max -= twoPI;
215
+
216
+ if (min <= max) {
217
+ spherical.theta = Math.max(min, Math.min(max, spherical.theta));
218
+ } else {
219
+ spherical.theta = spherical.theta > (min + max) / 2 ? Math.max(min, spherical.theta) : Math.min(max, spherical.theta);
220
+ }
221
+ } // restrict phi to be between desired limits
222
+
223
+
224
+ spherical.phi = Math.max(scope.minPolarAngle, Math.min(scope.maxPolarAngle, spherical.phi));
225
+ spherical.makeSafe();
226
+ spherical.radius *= scale; // restrict radius to be between desired limits
227
+
228
+ spherical.radius = Math.max(scope.minDistance, Math.min(scope.maxDistance, spherical.radius)); // move target to panned location
229
+
230
+ if (scope.enableDamping === true) {
231
+ scope.target.addScaledVector(panOffset, scope.dampingFactor);
232
+ } else {
233
+ scope.target.add(panOffset);
234
+ }
235
+
236
+ offset.setFromSpherical(spherical); // rotate offset back to "camera-up-vector-is-up" space
237
+
238
+ offset.applyQuaternion(quatInverse);
239
+ position.copy(scope.target).add(offset);
240
+ scope.object.lookAt(scope.target);
241
+
242
+ if (scope.enableDamping === true) {
243
+ sphericalDelta.theta *= 1 - scope.dampingFactor;
244
+ sphericalDelta.phi *= 1 - scope.dampingFactor;
245
+ panOffset.multiplyScalar(1 - scope.dampingFactor);
246
+ } else {
247
+ sphericalDelta.set(0, 0, 0);
248
+ panOffset.set(0, 0, 0);
249
+ }
250
+
251
+ scale = 1; // update condition is:
252
+ // min(camera displacement, camera rotation in radians)^2 > EPS
253
+ // using small-angle approximation cos(x/2) = 1 - x^2 / 8
254
+
255
+ if (zoomChanged || lastPosition.distanceToSquared(scope.object.position) > EPS || 8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS) {
256
+ scope.dispatchEvent(_changeEvent);
257
+ lastPosition.copy(scope.object.position);
258
+ lastQuaternion.copy(scope.object.quaternion);
259
+ zoomChanged = false;
260
+ return true;
261
+ }
262
+
263
+ return false;
264
+ };
265
+ }();
266
+
267
+ _this.dispose = function () {
268
+ scope.domElement.removeEventListener('contextmenu', onContextMenu);
269
+ scope.domElement.removeEventListener('pointerdown', onPointerDown);
270
+ scope.domElement.removeEventListener('pointercancel', onPointerCancel);
271
+ scope.domElement.removeEventListener('wheel', onMouseWheel);
272
+ scope.domElement.removeEventListener('pointermove', onPointerMove);
273
+ scope.domElement.removeEventListener('pointerup', onPointerUp);
274
+
275
+ if (scope._domElementKeyEvents !== null) {
276
+ scope._domElementKeyEvents.removeEventListener('keydown', onKeyDown);
277
+ } //scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
278
+
279
+ }; //
280
+ // internals
281
+ //
282
+
283
+
284
+ var scope = _assertThisInitialized(_this);
285
+
286
+ var STATE = {
287
+ NONE: -1,
288
+ ROTATE: 0,
289
+ DOLLY: 1,
290
+ PAN: 2,
291
+ TOUCH_ROTATE: 3,
292
+ TOUCH_PAN: 4,
293
+ TOUCH_DOLLY_PAN: 5,
294
+ TOUCH_DOLLY_ROTATE: 6
295
+ };
296
+ var state = STATE.NONE;
297
+ var EPS = 0.000001; // current position in spherical coordinates
298
+
299
+ var spherical = new _three.Spherical();
300
+ var sphericalDelta = new _three.Spherical();
301
+ var scale = 1;
302
+ var panOffset = new _three.Vector3();
303
+ var zoomChanged = false;
304
+ var rotateStart = new _three.Vector2();
305
+ var rotateEnd = new _three.Vector2();
306
+ var rotateDelta = new _three.Vector2();
307
+ var panStart = new _three.Vector2();
308
+ var panEnd = new _three.Vector2();
309
+ var panDelta = new _three.Vector2();
310
+ var dollyStart = new _three.Vector2();
311
+ var dollyEnd = new _three.Vector2();
312
+ var dollyDelta = new _three.Vector2();
313
+ var pointers = [];
314
+ var pointerPositions = {};
315
+
316
+ function getAutoRotationAngle() {
317
+ return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
318
+ }
319
+
320
+ function getZoomScale() {
321
+ return Math.pow(0.95, scope.zoomSpeed);
322
+ }
323
+
324
+ function rotateLeft(angle) {
325
+ sphericalDelta.theta -= angle;
326
+ }
327
+
328
+ function rotateUp(angle) {
329
+ sphericalDelta.phi -= angle;
330
+ }
331
+
332
+ var panLeft = function () {
333
+ var v = new _three.Vector3();
334
+ return function panLeft(distance, objectMatrix) {
335
+ v.setFromMatrixColumn(objectMatrix, 0); // get X column of objectMatrix
336
+
337
+ v.multiplyScalar(-distance);
338
+ panOffset.add(v);
339
+ };
340
+ }();
341
+
342
+ var panUp = function () {
343
+ var v = new _three.Vector3();
344
+ return function panUp(distance, objectMatrix) {
345
+ if (scope.screenSpacePanning === true) {
346
+ v.setFromMatrixColumn(objectMatrix, 1);
347
+ } else {
348
+ v.setFromMatrixColumn(objectMatrix, 0);
349
+ v.crossVectors(scope.object.up, v);
350
+ }
351
+
352
+ v.multiplyScalar(distance);
353
+ panOffset.add(v);
354
+ };
355
+ }(); // deltaX and deltaY are in pixels; right and down are positive
356
+
357
+
358
+ var pan = function () {
359
+ var offset = new _three.Vector3();
360
+ return function pan(deltaX, deltaY) {
361
+ var element = scope.domElement;
362
+
363
+ if (scope.object.isPerspectiveCamera) {
364
+ // perspective
365
+ var position = scope.object.position;
366
+ offset.copy(position).sub(scope.target);
367
+ var targetDistance = offset.length(); // half of the fov is center to top of screen
368
+
369
+ targetDistance *= Math.tan(scope.object.fov / 2 * Math.PI / 180.0); // we use only clientHeight here so aspect ratio does not distort speed
370
+
371
+ panLeft(2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix);
372
+ panUp(2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix);
373
+ } else if (scope.object.isOrthographicCamera) {
374
+ // orthographic
375
+ panLeft(deltaX * (scope.object.right - scope.object.left) / scope.object.zoom / element.clientWidth, scope.object.matrix);
376
+ panUp(deltaY * (scope.object.top - scope.object.bottom) / scope.object.zoom / element.clientHeight, scope.object.matrix);
377
+ } else {
378
+ // camera neither orthographic nor perspective
379
+ console.warn('WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.');
380
+ scope.enablePan = false;
381
+ }
382
+ };
383
+ }();
384
+
385
+ function dollyOut(dollyScale) {
386
+ if (scope.object.isPerspectiveCamera) {
387
+ scale /= dollyScale;
388
+ } else if (scope.object.isOrthographicCamera) {
389
+ scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom * dollyScale));
390
+ scope.object.updateProjectionMatrix();
391
+ zoomChanged = true;
392
+ } else {
393
+ console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.');
394
+ scope.enableZoom = false;
395
+ }
396
+ }
397
+
398
+ function dollyIn(dollyScale) {
399
+ if (scope.object.isPerspectiveCamera) {
400
+ scale *= dollyScale;
401
+ } else if (scope.object.isOrthographicCamera) {
402
+ scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / dollyScale));
403
+ scope.object.updateProjectionMatrix();
404
+ zoomChanged = true;
405
+ } else {
406
+ console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.');
407
+ scope.enableZoom = false;
408
+ }
409
+ } //
410
+ // event callbacks - update the object state
411
+ //
412
+
413
+
414
+ function handleMouseDownRotate(event) {
415
+ rotateStart.set(event.clientX, event.clientY);
416
+ }
417
+
418
+ function handleMouseDownDolly(event) {
419
+ dollyStart.set(event.clientX, event.clientY);
420
+ }
421
+
422
+ function handleMouseDownPan(event) {
423
+ panStart.set(event.clientX, event.clientY);
424
+ }
425
+
426
+ function handleMouseMoveRotate(event) {
427
+ rotateEnd.set(event.clientX, event.clientY);
428
+ rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed);
429
+ var element = scope.domElement;
430
+ rotateLeft(2 * Math.PI * rotateDelta.x / element.clientHeight); // yes, height
431
+
432
+ rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight);
433
+ rotateStart.copy(rotateEnd);
434
+ scope.update();
435
+ }
436
+
437
+ function handleMouseMoveDolly(event) {
438
+ dollyEnd.set(event.clientX, event.clientY);
439
+ dollyDelta.subVectors(dollyEnd, dollyStart);
440
+
441
+ if (dollyDelta.y > 0) {
442
+ dollyOut(getZoomScale());
443
+ } else if (dollyDelta.y < 0) {
444
+ dollyIn(getZoomScale());
445
+ }
446
+
447
+ dollyStart.copy(dollyEnd);
448
+ scope.update();
449
+ }
450
+
451
+ function handleMouseMovePan(event) {
452
+ panEnd.set(event.clientX, event.clientY);
453
+ panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);
454
+ pan(panDelta.x, panDelta.y);
455
+ panStart.copy(panEnd);
456
+ scope.update();
457
+ }
458
+
459
+ function handleMouseWheel(event) {
460
+ if (event.deltaY < 0) {
461
+ dollyIn(getZoomScale());
462
+ } else if (event.deltaY > 0) {
463
+ dollyOut(getZoomScale());
464
+ }
465
+
466
+ scope.update();
467
+ }
468
+
469
+ function handleKeyDown(event) {
470
+ var needsUpdate = false;
471
+
472
+ switch (event.code) {
473
+ case scope.keys.UP:
474
+ pan(0, scope.keyPanSpeed);
475
+ needsUpdate = true;
476
+ break;
477
+
478
+ case scope.keys.BOTTOM:
479
+ pan(0, -scope.keyPanSpeed);
480
+ needsUpdate = true;
481
+ break;
482
+
483
+ case scope.keys.LEFT:
484
+ pan(scope.keyPanSpeed, 0);
485
+ needsUpdate = true;
486
+ break;
487
+
488
+ case scope.keys.RIGHT:
489
+ pan(-scope.keyPanSpeed, 0);
490
+ needsUpdate = true;
491
+ break;
492
+ }
493
+
494
+ if (needsUpdate) {
495
+ // prevent the browser from scrolling on cursor keys
496
+ event.preventDefault();
497
+ scope.update();
498
+ }
499
+ }
500
+
501
+ function handleTouchStartRotate() {
502
+ if (pointers.length === 1) {
503
+ rotateStart.set(pointers[0].pageX, pointers[0].pageY);
504
+ } else {
505
+ var x = 0.5 * (pointers[0].pageX + pointers[1].pageX);
506
+ var y = 0.5 * (pointers[0].pageY + pointers[1].pageY);
507
+ rotateStart.set(x, y);
508
+ }
509
+ }
510
+
511
+ function handleTouchStartPan() {
512
+ if (pointers.length === 1) {
513
+ panStart.set(pointers[0].pageX, pointers[0].pageY);
514
+ } else {
515
+ var x = 0.5 * (pointers[0].pageX + pointers[1].pageX);
516
+ var y = 0.5 * (pointers[0].pageY + pointers[1].pageY);
517
+ panStart.set(x, y);
518
+ }
519
+ }
520
+
521
+ function handleTouchStartDolly() {
522
+ var dx = pointers[0].pageX - pointers[1].pageX;
523
+ var dy = pointers[0].pageY - pointers[1].pageY;
524
+ var distance = Math.sqrt(dx * dx + dy * dy);
525
+ dollyStart.set(0, distance);
526
+ }
527
+
528
+ function handleTouchStartDollyPan() {
529
+ if (scope.enableZoom) handleTouchStartDolly();
530
+ if (scope.enablePan) handleTouchStartPan();
531
+ }
532
+
533
+ function handleTouchStartDollyRotate() {
534
+ if (scope.enableZoom) handleTouchStartDolly();
535
+ if (scope.enableRotate) handleTouchStartRotate();
536
+ }
537
+
538
+ function handleTouchMoveRotate(event) {
539
+ if (pointers.length == 1) {
540
+ rotateEnd.set(event.pageX, event.pageY);
541
+ } else {
542
+ var position = getSecondPointerPosition(event);
543
+ var x = 0.5 * (event.pageX + position.x);
544
+ var y = 0.5 * (event.pageY + position.y);
545
+ rotateEnd.set(x, y);
546
+ }
547
+
548
+ rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed);
549
+ var element = scope.domElement;
550
+ rotateLeft(2 * Math.PI * rotateDelta.x / element.clientHeight); // yes, height
551
+
552
+ rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight);
553
+ rotateStart.copy(rotateEnd);
554
+ }
555
+
556
+ function handleTouchMovePan(event) {
557
+ if (pointers.length === 1) {
558
+ panEnd.set(event.pageX, event.pageY);
559
+ } else {
560
+ var position = getSecondPointerPosition(event);
561
+ var x = 0.5 * (event.pageX + position.x);
562
+ var y = 0.5 * (event.pageY + position.y);
563
+ panEnd.set(x, y);
564
+ }
565
+
566
+ panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);
567
+ pan(panDelta.x, panDelta.y);
568
+ panStart.copy(panEnd);
569
+ }
570
+
571
+ function handleTouchMoveDolly(event) {
572
+ var position = getSecondPointerPosition(event);
573
+ var dx = event.pageX - position.x;
574
+ var dy = event.pageY - position.y;
575
+ var distance = Math.sqrt(dx * dx + dy * dy);
576
+ dollyEnd.set(0, distance);
577
+ dollyDelta.set(0, Math.pow(dollyEnd.y / dollyStart.y, scope.zoomSpeed));
578
+ dollyOut(dollyDelta.y);
579
+ dollyStart.copy(dollyEnd);
580
+ }
581
+
582
+ function handleTouchMoveDollyPan(event) {
583
+ if (scope.enableZoom) handleTouchMoveDolly(event);
584
+ if (scope.enablePan) handleTouchMovePan(event);
585
+ }
586
+
587
+ function handleTouchMoveDollyRotate(event) {
588
+ if (scope.enableZoom) handleTouchMoveDolly(event);
589
+ if (scope.enableRotate) handleTouchMoveRotate(event);
590
+ } //
591
+ // event handlers - FSM: listen for events and reset state
592
+ //
593
+
594
+
595
+ function onPointerDown(event) {
596
+ if (scope.enabled === false) return;
597
+
598
+ if (pointers.length === 0) {
599
+ scope.domElement.setPointerCapture(event.pointerId);
600
+ scope.domElement.addEventListener('pointermove', onPointerMove);
601
+ scope.domElement.addEventListener('pointerup', onPointerUp);
602
+ } //
603
+
604
+
605
+ addPointer(event);
606
+
607
+ if (event.pointerType === 'touch') {
608
+ onTouchStart(event);
609
+ } else {
610
+ onMouseDown(event);
611
+ }
612
+ }
613
+
614
+ function onPointerMove(event) {
615
+ if (scope.enabled === false) return;
616
+
617
+ if (event.pointerType === 'touch') {
618
+ onTouchMove(event);
619
+ } else {
620
+ onMouseMove(event);
621
+ }
622
+ }
623
+
624
+ function onPointerUp(event) {
625
+ removePointer(event);
626
+
627
+ if (pointers.length === 0) {
628
+ scope.domElement.releasePointerCapture(event.pointerId);
629
+ scope.domElement.removeEventListener('pointermove', onPointerMove);
630
+ scope.domElement.removeEventListener('pointerup', onPointerUp);
631
+ }
632
+
633
+ scope.dispatchEvent(_endEvent);
634
+ state = STATE.NONE;
635
+ }
636
+
637
+ function onPointerCancel(event) {
638
+ removePointer(event);
639
+ }
640
+
641
+ function onMouseDown(event) {
642
+ var mouseAction;
643
+
644
+ switch (event.button) {
645
+ case 0:
646
+ mouseAction = scope.mouseButtons.LEFT;
647
+ break;
648
+
649
+ case 1:
650
+ mouseAction = scope.mouseButtons.MIDDLE;
651
+ break;
652
+
653
+ case 2:
654
+ mouseAction = scope.mouseButtons.RIGHT;
655
+ break;
656
+
657
+ default:
658
+ mouseAction = -1;
659
+ }
660
+
661
+ switch (mouseAction) {
662
+ case _three.MOUSE.DOLLY:
663
+ if (scope.enableZoom === false) return;
664
+ handleMouseDownDolly(event);
665
+ state = STATE.DOLLY;
666
+ break;
667
+
668
+ case _three.MOUSE.ROTATE:
669
+ if (event.ctrlKey || event.metaKey || event.shiftKey) {
670
+ if (scope.enablePan === false) return;
671
+ handleMouseDownPan(event);
672
+ state = STATE.PAN;
673
+ } else {
674
+ if (scope.enableRotate === false) return;
675
+ handleMouseDownRotate(event);
676
+ state = STATE.ROTATE;
677
+ }
678
+
679
+ break;
680
+
681
+ case _three.MOUSE.PAN:
682
+ if (event.ctrlKey || event.metaKey || event.shiftKey) {
683
+ if (scope.enableRotate === false) return;
684
+ handleMouseDownRotate(event);
685
+ state = STATE.ROTATE;
686
+ } else {
687
+ if (scope.enablePan === false) return;
688
+ handleMouseDownPan(event);
689
+ state = STATE.PAN;
690
+ }
691
+
692
+ break;
693
+
694
+ default:
695
+ state = STATE.NONE;
696
+ }
697
+
698
+ if (state !== STATE.NONE) {
699
+ scope.dispatchEvent(_startEvent);
700
+ }
701
+ }
702
+
703
+ function onMouseMove(event) {
704
+ if (scope.enabled === false) return;
705
+
706
+ switch (state) {
707
+ case STATE.ROTATE:
708
+ if (scope.enableRotate === false) return;
709
+ handleMouseMoveRotate(event);
710
+ break;
711
+
712
+ case STATE.DOLLY:
713
+ if (scope.enableZoom === false) return;
714
+ handleMouseMoveDolly(event);
715
+ break;
716
+
717
+ case STATE.PAN:
718
+ if (scope.enablePan === false) return;
719
+ handleMouseMovePan(event);
720
+ break;
721
+ }
722
+ }
723
+
724
+ function onMouseWheel(event) {
725
+ if (scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE) return;
726
+ event.preventDefault();
727
+ scope.dispatchEvent(_startEvent);
728
+ handleMouseWheel(event);
729
+ scope.dispatchEvent(_endEvent);
730
+ }
731
+
732
+ function onKeyDown(event) {
733
+ if (scope.enabled === false || scope.enablePan === false) return;
734
+ handleKeyDown(event);
735
+ }
736
+
737
+ function onTouchStart(event) {
738
+ trackPointer(event);
739
+
740
+ switch (pointers.length) {
741
+ case 1:
742
+ switch (scope.touches.ONE) {
743
+ case _three.TOUCH.ROTATE:
744
+ if (scope.enableRotate === false) return;
745
+ handleTouchStartRotate();
746
+ state = STATE.TOUCH_ROTATE;
747
+ break;
748
+
749
+ case _three.TOUCH.PAN:
750
+ if (scope.enablePan === false) return;
751
+ handleTouchStartPan();
752
+ state = STATE.TOUCH_PAN;
753
+ break;
754
+
755
+ default:
756
+ state = STATE.NONE;
757
+ }
758
+
759
+ break;
760
+
761
+ case 2:
762
+ switch (scope.touches.TWO) {
763
+ case _three.TOUCH.DOLLY_PAN:
764
+ if (scope.enableZoom === false && scope.enablePan === false) return;
765
+ handleTouchStartDollyPan();
766
+ state = STATE.TOUCH_DOLLY_PAN;
767
+ break;
768
+
769
+ case _three.TOUCH.DOLLY_ROTATE:
770
+ if (scope.enableZoom === false && scope.enableRotate === false) return;
771
+ handleTouchStartDollyRotate();
772
+ state = STATE.TOUCH_DOLLY_ROTATE;
773
+ break;
774
+
775
+ default:
776
+ state = STATE.NONE;
777
+ }
778
+
779
+ break;
780
+
781
+ default:
782
+ state = STATE.NONE;
783
+ }
784
+
785
+ if (state !== STATE.NONE) {
786
+ scope.dispatchEvent(_startEvent);
787
+ }
788
+ }
789
+
790
+ function onTouchMove(event) {
791
+ trackPointer(event);
792
+
793
+ switch (state) {
794
+ case STATE.TOUCH_ROTATE:
795
+ if (scope.enableRotate === false) return;
796
+ handleTouchMoveRotate(event);
797
+ scope.update();
798
+ break;
799
+
800
+ case STATE.TOUCH_PAN:
801
+ if (scope.enablePan === false) return;
802
+ handleTouchMovePan(event);
803
+ scope.update();
804
+ break;
805
+
806
+ case STATE.TOUCH_DOLLY_PAN:
807
+ if (scope.enableZoom === false && scope.enablePan === false) return;
808
+ handleTouchMoveDollyPan(event);
809
+ scope.update();
810
+ break;
811
+
812
+ case STATE.TOUCH_DOLLY_ROTATE:
813
+ if (scope.enableZoom === false && scope.enableRotate === false) return;
814
+ handleTouchMoveDollyRotate(event);
815
+ scope.update();
816
+ break;
817
+
818
+ default:
819
+ state = STATE.NONE;
820
+ }
821
+ }
822
+
823
+ function onContextMenu(event) {
824
+ if (scope.enabled === false) return;
825
+ event.preventDefault();
826
+ }
827
+
828
+ function addPointer(event) {
829
+ pointers.push(event);
830
+ }
831
+
832
+ function removePointer(event) {
833
+ delete pointerPositions[event.pointerId];
834
+
835
+ for (var i = 0; i < pointers.length; i++) {
836
+ if (pointers[i].pointerId == event.pointerId) {
837
+ pointers.splice(i, 1);
838
+ return;
839
+ }
840
+ }
841
+ }
842
+
843
+ function trackPointer(event) {
844
+ var position = pointerPositions[event.pointerId];
845
+
846
+ if (position === undefined) {
847
+ position = new _three.Vector2();
848
+ pointerPositions[event.pointerId] = position;
849
+ }
850
+
851
+ position.set(event.pageX, event.pageY);
852
+ }
853
+
854
+ function getSecondPointerPosition(event) {
855
+ var pointer = event.pointerId === pointers[0].pointerId ? pointers[1] : pointers[0];
856
+ return pointerPositions[pointer.pointerId];
857
+ } //
858
+
859
+
860
+ scope.domElement.addEventListener('contextmenu', onContextMenu);
861
+ scope.domElement.addEventListener('pointerdown', onPointerDown);
862
+ scope.domElement.addEventListener('pointercancel', onPointerCancel);
863
+ scope.domElement.addEventListener('wheel', onMouseWheel, {
864
+ passive: false
865
+ }); // force an update at start
866
+
867
+ _this.update();
868
+
869
+ return _this;
870
+ }
871
+
872
+ return _createClass(OrbitControls);
873
+ }(_three.EventDispatcher); // This set of controls performs orbiting, dollying (zooming), and panning.
874
+ // Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
875
+ // This is very similar to OrbitControls, another set of touch behavior
876
+ //
877
+ // Orbit - right mouse, or left mouse + ctrl/meta/shiftKey / touch: two-finger rotate
878
+ // Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
879
+ // Pan - left mouse, or arrow keys / touch: one-finger move
880
+
881
+
882
+ _exports.OrbitControls = OrbitControls;
883
+
884
+ var MapControls = /*#__PURE__*/function (_OrbitControls) {
885
+ _inherits(MapControls, _OrbitControls);
886
+
887
+ var _super2 = _createSuper(MapControls);
888
+
889
+ function MapControls(object, domElement) {
890
+ var _this2;
891
+
892
+ _classCallCheck(this, MapControls);
893
+
894
+ _this2 = _super2.call(this, object, domElement);
895
+ _this2.screenSpacePanning = false; // pan orthogonal to world-space direction camera.up
896
+
897
+ _this2.mouseButtons.LEFT = _three.MOUSE.PAN;
898
+ _this2.mouseButtons.RIGHT = _three.MOUSE.ROTATE;
899
+ _this2.touches.ONE = _three.TOUCH.PAN;
900
+ _this2.touches.TWO = _three.TOUCH.DOLLY_ROTATE;
901
+ return _this2;
902
+ }
903
+
904
+ return _createClass(MapControls);
905
+ }(OrbitControls);
906
+
907
+ _exports.MapControls = MapControls;
908
+ });