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,683 @@
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.BufferGeometryUtils = 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.computeMorphedAttributes = computeMorphedAttributes;
20
+ _exports.computeTangents = computeTangents;
21
+ _exports.estimateBytesUsed = estimateBytesUsed;
22
+ _exports.interleaveAttributes = interleaveAttributes;
23
+ _exports.mergeBufferAttributes = mergeBufferAttributes;
24
+ _exports.mergeBufferGeometries = mergeBufferGeometries;
25
+ _exports.mergeVertices = mergeVertices;
26
+ _exports.toTrianglesDrawMode = toTrianglesDrawMode;
27
+
28
+ function computeTangents(geometry) {
29
+ geometry.computeTangents();
30
+ console.warn('THREE.BufferGeometryUtils: .computeTangents() has been removed. Use BufferGeometry.computeTangents() instead.');
31
+ }
32
+ /**
33
+ * @param {Array<BufferGeometry>} geometries
34
+ * @param {Boolean} useGroups
35
+ * @return {BufferGeometry}
36
+ */
37
+
38
+
39
+ function mergeBufferGeometries(geometries) {
40
+ var useGroups = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
41
+ var isIndexed = geometries[0].index !== null;
42
+ var attributesUsed = new Set(Object.keys(geometries[0].attributes));
43
+ var morphAttributesUsed = new Set(Object.keys(geometries[0].morphAttributes));
44
+ var attributes = {};
45
+ var morphAttributes = {};
46
+ var morphTargetsRelative = geometries[0].morphTargetsRelative;
47
+ var mergedGeometry = new _three.BufferGeometry();
48
+ var offset = 0;
49
+
50
+ for (var i = 0; i < geometries.length; ++i) {
51
+ var geometry = geometries[i];
52
+ var attributesCount = 0; // ensure that all geometries are indexed, or none
53
+
54
+ if (isIndexed !== (geometry.index !== null)) {
55
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.');
56
+ return null;
57
+ } // gather attributes, exit early if they're different
58
+
59
+
60
+ for (var name in geometry.attributes) {
61
+ if (!attributesUsed.has(name)) {
62
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure "' + name + '" attribute exists among all geometries, or in none of them.');
63
+ return null;
64
+ }
65
+
66
+ if (attributes[name] === undefined) attributes[name] = [];
67
+ attributes[name].push(geometry.attributes[name]);
68
+ attributesCount++;
69
+ } // ensure geometries have the same number of attributes
70
+
71
+
72
+ if (attributesCount !== attributesUsed.size) {
73
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. Make sure all geometries have the same number of attributes.');
74
+ return null;
75
+ } // gather morph attributes, exit early if they're different
76
+
77
+
78
+ if (morphTargetsRelative !== geometry.morphTargetsRelative) {
79
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphTargetsRelative must be consistent throughout all geometries.');
80
+ return null;
81
+ }
82
+
83
+ for (var _name in geometry.morphAttributes) {
84
+ if (!morphAttributesUsed.has(_name)) {
85
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphAttributes must be consistent throughout all geometries.');
86
+ return null;
87
+ }
88
+
89
+ if (morphAttributes[_name] === undefined) morphAttributes[_name] = [];
90
+
91
+ morphAttributes[_name].push(geometry.morphAttributes[_name]);
92
+ } // gather .userData
93
+
94
+
95
+ mergedGeometry.userData.mergedUserData = mergedGeometry.userData.mergedUserData || [];
96
+ mergedGeometry.userData.mergedUserData.push(geometry.userData);
97
+
98
+ if (useGroups) {
99
+ var count = void 0;
100
+
101
+ if (isIndexed) {
102
+ count = geometry.index.count;
103
+ } else if (geometry.attributes.position !== undefined) {
104
+ count = geometry.attributes.position.count;
105
+ } else {
106
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. The geometry must have either an index or a position attribute');
107
+ return null;
108
+ }
109
+
110
+ mergedGeometry.addGroup(offset, count, i);
111
+ offset += count;
112
+ }
113
+ } // merge indices
114
+
115
+
116
+ if (isIndexed) {
117
+ var indexOffset = 0;
118
+ var mergedIndex = [];
119
+
120
+ for (var _i = 0; _i < geometries.length; ++_i) {
121
+ var index = geometries[_i].index;
122
+
123
+ for (var j = 0; j < index.count; ++j) {
124
+ mergedIndex.push(index.getX(j) + indexOffset);
125
+ }
126
+
127
+ indexOffset += geometries[_i].attributes.position.count;
128
+ }
129
+
130
+ mergedGeometry.setIndex(mergedIndex);
131
+ } // merge attributes
132
+
133
+
134
+ for (var _name2 in attributes) {
135
+ var mergedAttribute = mergeBufferAttributes(attributes[_name2]);
136
+
137
+ if (!mergedAttribute) {
138
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + _name2 + ' attribute.');
139
+ return null;
140
+ }
141
+
142
+ mergedGeometry.setAttribute(_name2, mergedAttribute);
143
+ } // merge morph attributes
144
+
145
+
146
+ for (var _name3 in morphAttributes) {
147
+ var numMorphTargets = morphAttributes[_name3][0].length;
148
+ if (numMorphTargets === 0) break;
149
+ mergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};
150
+ mergedGeometry.morphAttributes[_name3] = [];
151
+
152
+ for (var _i2 = 0; _i2 < numMorphTargets; ++_i2) {
153
+ var morphAttributesToMerge = [];
154
+
155
+ for (var _j = 0; _j < morphAttributes[_name3].length; ++_j) {
156
+ morphAttributesToMerge.push(morphAttributes[_name3][_j][_i2]);
157
+ }
158
+
159
+ var mergedMorphAttribute = mergeBufferAttributes(morphAttributesToMerge);
160
+
161
+ if (!mergedMorphAttribute) {
162
+ console.error('THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + _name3 + ' morphAttribute.');
163
+ return null;
164
+ }
165
+
166
+ mergedGeometry.morphAttributes[_name3].push(mergedMorphAttribute);
167
+ }
168
+ }
169
+
170
+ return mergedGeometry;
171
+ }
172
+ /**
173
+ * @param {Array<BufferAttribute>} attributes
174
+ * @return {BufferAttribute}
175
+ */
176
+
177
+
178
+ function mergeBufferAttributes(attributes) {
179
+ var TypedArray;
180
+ var itemSize;
181
+ var normalized;
182
+ var arrayLength = 0;
183
+
184
+ for (var i = 0; i < attributes.length; ++i) {
185
+ var attribute = attributes[i];
186
+
187
+ if (attribute.isInterleavedBufferAttribute) {
188
+ console.error('THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported.');
189
+ return null;
190
+ }
191
+
192
+ if (TypedArray === undefined) TypedArray = attribute.array.constructor;
193
+
194
+ if (TypedArray !== attribute.array.constructor) {
195
+ console.error('THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.');
196
+ return null;
197
+ }
198
+
199
+ if (itemSize === undefined) itemSize = attribute.itemSize;
200
+
201
+ if (itemSize !== attribute.itemSize) {
202
+ console.error('THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.');
203
+ return null;
204
+ }
205
+
206
+ if (normalized === undefined) normalized = attribute.normalized;
207
+
208
+ if (normalized !== attribute.normalized) {
209
+ console.error('THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.');
210
+ return null;
211
+ }
212
+
213
+ arrayLength += attribute.array.length;
214
+ }
215
+
216
+ var array = new TypedArray(arrayLength);
217
+ var offset = 0;
218
+
219
+ for (var _i3 = 0; _i3 < attributes.length; ++_i3) {
220
+ array.set(attributes[_i3].array, offset);
221
+ offset += attributes[_i3].array.length;
222
+ }
223
+
224
+ return new _three.BufferAttribute(array, itemSize, normalized);
225
+ }
226
+ /**
227
+ * @param {Array<BufferAttribute>} attributes
228
+ * @return {Array<InterleavedBufferAttribute>}
229
+ */
230
+
231
+
232
+ function interleaveAttributes(attributes) {
233
+ // Interleaves the provided attributes into an InterleavedBuffer and returns
234
+ // a set of InterleavedBufferAttributes for each attribute
235
+ var TypedArray;
236
+ var arrayLength = 0;
237
+ var stride = 0; // calculate the the length and type of the interleavedBuffer
238
+
239
+ for (var i = 0, l = attributes.length; i < l; ++i) {
240
+ var attribute = attributes[i];
241
+ if (TypedArray === undefined) TypedArray = attribute.array.constructor;
242
+
243
+ if (TypedArray !== attribute.array.constructor) {
244
+ console.error('AttributeBuffers of different types cannot be interleaved');
245
+ return null;
246
+ }
247
+
248
+ arrayLength += attribute.array.length;
249
+ stride += attribute.itemSize;
250
+ } // Create the set of buffer attributes
251
+
252
+
253
+ var interleavedBuffer = new _three.InterleavedBuffer(new TypedArray(arrayLength), stride);
254
+ var offset = 0;
255
+ var res = [];
256
+ var getters = ['getX', 'getY', 'getZ', 'getW'];
257
+ var setters = ['setX', 'setY', 'setZ', 'setW'];
258
+
259
+ for (var j = 0, _l = attributes.length; j < _l; j++) {
260
+ var _attribute = attributes[j];
261
+ var itemSize = _attribute.itemSize;
262
+ var count = _attribute.count;
263
+ var iba = new _three.InterleavedBufferAttribute(interleavedBuffer, itemSize, offset, _attribute.normalized);
264
+ res.push(iba);
265
+ offset += itemSize; // Move the data for each attribute into the new interleavedBuffer
266
+ // at the appropriate offset
267
+
268
+ for (var c = 0; c < count; c++) {
269
+ for (var k = 0; k < itemSize; k++) {
270
+ iba[setters[k]](c, _attribute[getters[k]](c));
271
+ }
272
+ }
273
+ }
274
+
275
+ return res;
276
+ }
277
+ /**
278
+ * @param {Array<BufferGeometry>} geometry
279
+ * @return {number}
280
+ */
281
+
282
+
283
+ function estimateBytesUsed(geometry) {
284
+ // Return the estimated memory used by this geometry in bytes
285
+ // Calculate using itemSize, count, and BYTES_PER_ELEMENT to account
286
+ // for InterleavedBufferAttributes.
287
+ var mem = 0;
288
+
289
+ for (var name in geometry.attributes) {
290
+ var attr = geometry.getAttribute(name);
291
+ mem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT;
292
+ }
293
+
294
+ var indices = geometry.getIndex();
295
+ mem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0;
296
+ return mem;
297
+ }
298
+ /**
299
+ * @param {BufferGeometry} geometry
300
+ * @param {number} tolerance
301
+ * @return {BufferGeometry>}
302
+ */
303
+
304
+
305
+ function mergeVertices(geometry) {
306
+ var tolerance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1e-4;
307
+ tolerance = Math.max(tolerance, Number.EPSILON); // Generate an index buffer if the geometry doesn't have one, or optimize it
308
+ // if it's already available.
309
+
310
+ var hashToIndex = {};
311
+ var indices = geometry.getIndex();
312
+ var positions = geometry.getAttribute('position');
313
+ var vertexCount = indices ? indices.count : positions.count; // next value for triangle indices
314
+
315
+ var nextIndex = 0; // attributes and new attribute arrays
316
+
317
+ var attributeNames = Object.keys(geometry.attributes);
318
+ var attrArrays = {};
319
+ var morphAttrsArrays = {};
320
+ var newIndices = [];
321
+ var getters = ['getX', 'getY', 'getZ', 'getW']; // initialize the arrays
322
+
323
+ for (var i = 0, l = attributeNames.length; i < l; i++) {
324
+ var name = attributeNames[i];
325
+ attrArrays[name] = [];
326
+ var morphAttr = geometry.morphAttributes[name];
327
+
328
+ if (morphAttr) {
329
+ morphAttrsArrays[name] = new Array(morphAttr.length).fill().map(function () {
330
+ return [];
331
+ });
332
+ }
333
+ } // convert the error tolerance to an amount of decimal places to truncate to
334
+
335
+
336
+ var decimalShift = Math.log10(1 / tolerance);
337
+ var shiftMultiplier = Math.pow(10, decimalShift);
338
+
339
+ for (var _i4 = 0; _i4 < vertexCount; _i4++) {
340
+ var index = indices ? indices.getX(_i4) : _i4; // Generate a hash for the vertex attributes at the current index 'i'
341
+
342
+ var hash = '';
343
+
344
+ for (var j = 0, _l2 = attributeNames.length; j < _l2; j++) {
345
+ var _name4 = attributeNames[j];
346
+ var attribute = geometry.getAttribute(_name4);
347
+ var itemSize = attribute.itemSize;
348
+
349
+ for (var k = 0; k < itemSize; k++) {
350
+ // double tilde truncates the decimal value
351
+ hash += "".concat(~~(attribute[getters[k]](index) * shiftMultiplier), ",");
352
+ }
353
+ } // Add another reference to the vertex if it's already
354
+ // used by another index
355
+
356
+
357
+ if (hash in hashToIndex) {
358
+ newIndices.push(hashToIndex[hash]);
359
+ } else {
360
+ // copy data to the new index in the attribute arrays
361
+ for (var _j2 = 0, _l3 = attributeNames.length; _j2 < _l3; _j2++) {
362
+ var _name5 = attributeNames[_j2];
363
+
364
+ var _attribute2 = geometry.getAttribute(_name5);
365
+
366
+ var _morphAttr = geometry.morphAttributes[_name5];
367
+ var _itemSize = _attribute2.itemSize;
368
+ var newarray = attrArrays[_name5];
369
+ var newMorphArrays = morphAttrsArrays[_name5];
370
+
371
+ for (var _k = 0; _k < _itemSize; _k++) {
372
+ var getterFunc = getters[_k];
373
+ newarray.push(_attribute2[getterFunc](index));
374
+
375
+ if (_morphAttr) {
376
+ for (var m = 0, ml = _morphAttr.length; m < ml; m++) {
377
+ newMorphArrays[m].push(_morphAttr[m][getterFunc](index));
378
+ }
379
+ }
380
+ }
381
+ }
382
+
383
+ hashToIndex[hash] = nextIndex;
384
+ newIndices.push(nextIndex);
385
+ nextIndex++;
386
+ }
387
+ } // Generate typed arrays from new attribute arrays and update
388
+ // the attributeBuffers
389
+
390
+
391
+ var result = geometry.clone();
392
+
393
+ for (var _i5 = 0, _l4 = attributeNames.length; _i5 < _l4; _i5++) {
394
+ var _name6 = attributeNames[_i5];
395
+ var oldAttribute = geometry.getAttribute(_name6);
396
+ var buffer = new oldAttribute.array.constructor(attrArrays[_name6]);
397
+
398
+ var _attribute3 = new _three.BufferAttribute(buffer, oldAttribute.itemSize, oldAttribute.normalized);
399
+
400
+ result.setAttribute(_name6, _attribute3); // Update the attribute arrays
401
+
402
+ if (_name6 in morphAttrsArrays) {
403
+ for (var _j3 = 0; _j3 < morphAttrsArrays[_name6].length; _j3++) {
404
+ var oldMorphAttribute = geometry.morphAttributes[_name6][_j3];
405
+
406
+ var _buffer = new oldMorphAttribute.array.constructor(morphAttrsArrays[_name6][_j3]);
407
+
408
+ var morphAttribute = new _three.BufferAttribute(_buffer, oldMorphAttribute.itemSize, oldMorphAttribute.normalized);
409
+ result.morphAttributes[_name6][_j3] = morphAttribute;
410
+ }
411
+ }
412
+ } // indices
413
+
414
+
415
+ result.setIndex(newIndices);
416
+ return result;
417
+ }
418
+ /**
419
+ * @param {BufferGeometry} geometry
420
+ * @param {number} drawMode
421
+ * @return {BufferGeometry>}
422
+ */
423
+
424
+
425
+ function toTrianglesDrawMode(geometry, drawMode) {
426
+ if (drawMode === _three.TrianglesDrawMode) {
427
+ console.warn('THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.');
428
+ return geometry;
429
+ }
430
+
431
+ if (drawMode === _three.TriangleFanDrawMode || drawMode === _three.TriangleStripDrawMode) {
432
+ var index = geometry.getIndex(); // generate index if not present
433
+
434
+ if (index === null) {
435
+ var indices = [];
436
+ var position = geometry.getAttribute('position');
437
+
438
+ if (position !== undefined) {
439
+ for (var i = 0; i < position.count; i++) {
440
+ indices.push(i);
441
+ }
442
+
443
+ geometry.setIndex(indices);
444
+ index = geometry.getIndex();
445
+ } else {
446
+ console.error('THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.');
447
+ return geometry;
448
+ }
449
+ } //
450
+
451
+
452
+ var numberOfTriangles = index.count - 2;
453
+ var newIndices = [];
454
+
455
+ if (drawMode === _three.TriangleFanDrawMode) {
456
+ // gl.TRIANGLE_FAN
457
+ for (var _i6 = 1; _i6 <= numberOfTriangles; _i6++) {
458
+ newIndices.push(index.getX(0));
459
+ newIndices.push(index.getX(_i6));
460
+ newIndices.push(index.getX(_i6 + 1));
461
+ }
462
+ } else {
463
+ // gl.TRIANGLE_STRIP
464
+ for (var _i7 = 0; _i7 < numberOfTriangles; _i7++) {
465
+ if (_i7 % 2 === 0) {
466
+ newIndices.push(index.getX(_i7));
467
+ newIndices.push(index.getX(_i7 + 1));
468
+ newIndices.push(index.getX(_i7 + 2));
469
+ } else {
470
+ newIndices.push(index.getX(_i7 + 2));
471
+ newIndices.push(index.getX(_i7 + 1));
472
+ newIndices.push(index.getX(_i7));
473
+ }
474
+ }
475
+ }
476
+
477
+ if (newIndices.length / 3 !== numberOfTriangles) {
478
+ console.error('THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.');
479
+ } // build final geometry
480
+
481
+
482
+ var newGeometry = geometry.clone();
483
+ newGeometry.setIndex(newIndices);
484
+ newGeometry.clearGroups();
485
+ return newGeometry;
486
+ } else {
487
+ console.error('THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', drawMode);
488
+ return geometry;
489
+ }
490
+ }
491
+ /**
492
+ * Calculates the morphed attributes of a morphed/skinned BufferGeometry.
493
+ * Helpful for Raytracing or Decals.
494
+ * @param {Mesh | Line | Points} object An instance of Mesh, Line or Points.
495
+ * @return {Object} An Object with original position/normal attributes and morphed ones.
496
+ */
497
+
498
+
499
+ function computeMorphedAttributes(object) {
500
+ if (object.geometry.isBufferGeometry !== true) {
501
+ console.error('THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry.');
502
+ return null;
503
+ }
504
+
505
+ var _vA = new _three.Vector3();
506
+
507
+ var _vB = new _three.Vector3();
508
+
509
+ var _vC = new _three.Vector3();
510
+
511
+ var _tempA = new _three.Vector3();
512
+
513
+ var _tempB = new _three.Vector3();
514
+
515
+ var _tempC = new _three.Vector3();
516
+
517
+ var _morphA = new _three.Vector3();
518
+
519
+ var _morphB = new _three.Vector3();
520
+
521
+ var _morphC = new _three.Vector3();
522
+
523
+ function _calculateMorphedAttributeData(object, material, attribute, morphAttribute, morphTargetsRelative, a, b, c, modifiedAttributeArray) {
524
+ _vA.fromBufferAttribute(attribute, a);
525
+
526
+ _vB.fromBufferAttribute(attribute, b);
527
+
528
+ _vC.fromBufferAttribute(attribute, c);
529
+
530
+ var morphInfluences = object.morphTargetInfluences;
531
+
532
+ if (material.morphTargets && morphAttribute && morphInfluences) {
533
+ _morphA.set(0, 0, 0);
534
+
535
+ _morphB.set(0, 0, 0);
536
+
537
+ _morphC.set(0, 0, 0);
538
+
539
+ for (var _i8 = 0, _il = morphAttribute.length; _i8 < _il; _i8++) {
540
+ var influence = morphInfluences[_i8];
541
+ var morph = morphAttribute[_i8];
542
+ if (influence === 0) continue;
543
+
544
+ _tempA.fromBufferAttribute(morph, a);
545
+
546
+ _tempB.fromBufferAttribute(morph, b);
547
+
548
+ _tempC.fromBufferAttribute(morph, c);
549
+
550
+ if (morphTargetsRelative) {
551
+ _morphA.addScaledVector(_tempA, influence);
552
+
553
+ _morphB.addScaledVector(_tempB, influence);
554
+
555
+ _morphC.addScaledVector(_tempC, influence);
556
+ } else {
557
+ _morphA.addScaledVector(_tempA.sub(_vA), influence);
558
+
559
+ _morphB.addScaledVector(_tempB.sub(_vB), influence);
560
+
561
+ _morphC.addScaledVector(_tempC.sub(_vC), influence);
562
+ }
563
+ }
564
+
565
+ _vA.add(_morphA);
566
+
567
+ _vB.add(_morphB);
568
+
569
+ _vC.add(_morphC);
570
+ }
571
+
572
+ if (object.isSkinnedMesh) {
573
+ object.boneTransform(a, _vA);
574
+ object.boneTransform(b, _vB);
575
+ object.boneTransform(c, _vC);
576
+ }
577
+
578
+ modifiedAttributeArray[a * 3 + 0] = _vA.x;
579
+ modifiedAttributeArray[a * 3 + 1] = _vA.y;
580
+ modifiedAttributeArray[a * 3 + 2] = _vA.z;
581
+ modifiedAttributeArray[b * 3 + 0] = _vB.x;
582
+ modifiedAttributeArray[b * 3 + 1] = _vB.y;
583
+ modifiedAttributeArray[b * 3 + 2] = _vB.z;
584
+ modifiedAttributeArray[c * 3 + 0] = _vC.x;
585
+ modifiedAttributeArray[c * 3 + 1] = _vC.y;
586
+ modifiedAttributeArray[c * 3 + 2] = _vC.z;
587
+ }
588
+
589
+ var geometry = object.geometry;
590
+ var material = object.material;
591
+ var a, b, c;
592
+ var index = geometry.index;
593
+ var positionAttribute = geometry.attributes.position;
594
+ var morphPosition = geometry.morphAttributes.position;
595
+ var morphTargetsRelative = geometry.morphTargetsRelative;
596
+ var normalAttribute = geometry.attributes.normal;
597
+ var morphNormal = geometry.morphAttributes.position;
598
+ var groups = geometry.groups;
599
+ var drawRange = geometry.drawRange;
600
+ var i, j, il, jl;
601
+ var group, groupMaterial;
602
+ var start, end;
603
+ var modifiedPosition = new Float32Array(positionAttribute.count * positionAttribute.itemSize);
604
+ var modifiedNormal = new Float32Array(normalAttribute.count * normalAttribute.itemSize);
605
+
606
+ if (index !== null) {
607
+ // indexed buffer geometry
608
+ if (Array.isArray(material)) {
609
+ for (i = 0, il = groups.length; i < il; i++) {
610
+ group = groups[i];
611
+ groupMaterial = material[group.materialIndex];
612
+ start = Math.max(group.start, drawRange.start);
613
+ end = Math.min(group.start + group.count, drawRange.start + drawRange.count);
614
+
615
+ for (j = start, jl = end; j < jl; j += 3) {
616
+ a = index.getX(j);
617
+ b = index.getX(j + 1);
618
+ c = index.getX(j + 2);
619
+
620
+ _calculateMorphedAttributeData(object, groupMaterial, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition);
621
+
622
+ _calculateMorphedAttributeData(object, groupMaterial, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal);
623
+ }
624
+ }
625
+ } else {
626
+ start = Math.max(0, drawRange.start);
627
+ end = Math.min(index.count, drawRange.start + drawRange.count);
628
+
629
+ for (i = start, il = end; i < il; i += 3) {
630
+ a = index.getX(i);
631
+ b = index.getX(i + 1);
632
+ c = index.getX(i + 2);
633
+
634
+ _calculateMorphedAttributeData(object, material, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition);
635
+
636
+ _calculateMorphedAttributeData(object, material, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal);
637
+ }
638
+ }
639
+ } else if (positionAttribute !== undefined) {
640
+ // non-indexed buffer geometry
641
+ if (Array.isArray(material)) {
642
+ for (i = 0, il = groups.length; i < il; i++) {
643
+ group = groups[i];
644
+ groupMaterial = material[group.materialIndex];
645
+ start = Math.max(group.start, drawRange.start);
646
+ end = Math.min(group.start + group.count, drawRange.start + drawRange.count);
647
+
648
+ for (j = start, jl = end; j < jl; j += 3) {
649
+ a = j;
650
+ b = j + 1;
651
+ c = j + 2;
652
+
653
+ _calculateMorphedAttributeData(object, groupMaterial, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition);
654
+
655
+ _calculateMorphedAttributeData(object, groupMaterial, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal);
656
+ }
657
+ }
658
+ } else {
659
+ start = Math.max(0, drawRange.start);
660
+ end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);
661
+
662
+ for (i = start, il = end; i < il; i += 3) {
663
+ a = i;
664
+ b = i + 1;
665
+ c = i + 2;
666
+
667
+ _calculateMorphedAttributeData(object, material, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition);
668
+
669
+ _calculateMorphedAttributeData(object, material, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal);
670
+ }
671
+ }
672
+ }
673
+
674
+ var morphedPositionAttribute = new _three.Float32BufferAttribute(modifiedPosition, 3);
675
+ var morphedNormalAttribute = new _three.Float32BufferAttribute(modifiedNormal, 3);
676
+ return {
677
+ positionAttribute: positionAttribute,
678
+ normalAttribute: normalAttribute,
679
+ morphedPositionAttribute: morphedPositionAttribute,
680
+ morphedNormalAttribute: morphedNormalAttribute
681
+ };
682
+ }
683
+ });