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,386 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "./core/PropertyNode.js", "./core/VarNode.js", "./inputs/ColorNode.js", "./inputs/FloatNode.js", "./inputs/Vector2Node.js", "./inputs/Vector3Node.js", "./inputs/Vector4Node.js", "./accessors/PositionNode.js", "./accessors/NormalNode.js", "./math/OperatorNode.js", "./math/CondNode.js", "./math/MathNode.js", "./utils/ArrayElementNode.js", "./utils/ConvertNode.js", "./utils/JoinNode.js", "./utils/SplitNode.js", "three"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("./core/PropertyNode.js"), require("./core/VarNode.js"), require("./inputs/ColorNode.js"), require("./inputs/FloatNode.js"), require("./inputs/Vector2Node.js"), require("./inputs/Vector3Node.js"), require("./inputs/Vector4Node.js"), require("./accessors/PositionNode.js"), require("./accessors/NormalNode.js"), require("./math/OperatorNode.js"), require("./math/CondNode.js"), require("./math/MathNode.js"), require("./utils/ArrayElementNode.js"), require("./utils/ConvertNode.js"), require("./utils/JoinNode.js"), require("./utils/SplitNode.js"), require("three"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.PropertyNode, global.VarNode, global.ColorNode, global.FloatNode, global.Vector2Node, global.Vector3Node, global.Vector4Node, global.PositionNode, global.NormalNode, global.OperatorNode, global.CondNode, global.MathNode, global.ArrayElementNode, global.ConvertNode, global.JoinNode, global.SplitNode, global.three);
11
+ global.ShaderNode = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _PropertyNode, _VarNode, _ColorNode, _FloatNode, _Vector2Node, _Vector3Node, _Vector4Node, _PositionNode, _NormalNode, _OperatorNode, _CondNode, _MathNode, _ArrayElementNode, _ConvertNode, _JoinNode, _SplitNode, _three) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.vec4 = _exports.vec3 = _exports.vec2 = _exports.uniform = _exports.transformedNormalView = _exports.transformDirection = _exports.sub = _exports.sqrt = _exports.specularColor = _exports.sin = _exports.sign = _exports.saturate = _exports.round = _exports.roughness = _exports.pow4 = _exports.pow3 = _exports.pow2 = _exports.pow = _exports.positionWorld = _exports.positionViewDirection = _exports.positionView = _exports.positionLocal = _exports.normalize = _exports.normalWorld = _exports.normalView = _exports.normalLocal = _exports.negate = _exports.mul = _exports.mod = _exports.mix = _exports.min = _exports.metalness = _exports.max = _exports.lessThanEqual = _exports.join = _exports.inversesqrt = _exports.greaterThan = _exports.fract = _exports.floor = _exports.float = _exports.exp2 = _exports.exp = _exports.equal = _exports.element = _exports.dot = _exports.div = _exports.diffuseColor = _exports.dFdy = _exports.dFdx = _exports.cross = _exports.cos = _exports.cond = _exports.color = _exports.assign = _exports.and = _exports.alphaTest = _exports.addTo = _exports.add = _exports.abs = _exports.ShaderNode = _exports.RECIPROCAL_PI2 = _exports.RECIPROCAL_PI = _exports.PI_HALF = _exports.PI2 = _exports.PI = _exports.EPSILON = void 0;
20
+ _PropertyNode = _interopRequireDefault(_PropertyNode);
21
+ _VarNode = _interopRequireDefault(_VarNode);
22
+ _ColorNode = _interopRequireDefault(_ColorNode);
23
+ _FloatNode = _interopRequireDefault(_FloatNode);
24
+ _Vector2Node = _interopRequireDefault(_Vector2Node);
25
+ _Vector3Node = _interopRequireDefault(_Vector3Node);
26
+ _Vector4Node = _interopRequireDefault(_Vector4Node);
27
+ _PositionNode = _interopRequireDefault(_PositionNode);
28
+ _NormalNode = _interopRequireDefault(_NormalNode);
29
+ _OperatorNode = _interopRequireDefault(_OperatorNode);
30
+ _CondNode = _interopRequireDefault(_CondNode);
31
+ _MathNode = _interopRequireDefault(_MathNode);
32
+ _ArrayElementNode = _interopRequireDefault(_ArrayElementNode);
33
+ _ConvertNode = _interopRequireDefault(_ConvertNode);
34
+ _JoinNode = _interopRequireDefault(_JoinNode);
35
+ _SplitNode = _interopRequireDefault(_SplitNode);
36
+
37
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
38
+
39
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
40
+
41
+ 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; } }
42
+
43
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
44
+
45
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
46
+
47
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
48
+
49
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
50
+
51
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
52
+
53
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
54
+
55
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
56
+
57
+ var NodeHandler = {
58
+ construct: function construct(NodeClosure, params) {
59
+ var inputs = params.shift();
60
+ return NodeClosure.apply(void 0, [ShaderNodeObjects(inputs)].concat(_toConsumableArray(params)));
61
+ },
62
+ get: function get(node, prop) {
63
+ if (typeof prop === 'string' && node[prop] === undefined) {
64
+ if (/^[xyzwrgbastpq]{1,4}$/.test(prop) === true) {
65
+ // accessing properties ( swizzle )
66
+ prop = prop.replace(/r|s/g, 'x').replace(/g|t/g, 'y').replace(/b|p/g, 'z').replace(/a|q/g, 'w');
67
+ return ShaderNodeObject(new _SplitNode.default(node, prop));
68
+ } else if (/^\d+$/.test(prop) === true) {
69
+ // accessing array
70
+ return ShaderNodeObject(new _ArrayElementNode.default(node, new _FloatNode.default(Number(prop)).setConst(true)));
71
+ }
72
+ }
73
+
74
+ return node[prop];
75
+ }
76
+ };
77
+
78
+ var ShaderNodeObject = function ShaderNodeObject(obj) {
79
+ var type = typeof obj;
80
+
81
+ if (type === 'number') {
82
+ return ShaderNodeObject(new _FloatNode.default(obj).setConst(true));
83
+ } else if (type === 'object') {
84
+ if (obj.isNode === true) {
85
+ var node = obj;
86
+
87
+ if (node.isProxyNode !== true) {
88
+ node.isProxyNode = true;
89
+ return new Proxy(node, NodeHandler);
90
+ }
91
+ }
92
+ }
93
+
94
+ return obj;
95
+ };
96
+
97
+ var ShaderNodeObjects = function ShaderNodeObjects(objects) {
98
+ for (var name in objects) {
99
+ objects[name] = ShaderNodeObject(objects[name]);
100
+ }
101
+
102
+ return objects;
103
+ };
104
+
105
+ var ShaderNodeArray = function ShaderNodeArray(array) {
106
+ var len = array.length;
107
+
108
+ for (var i = 0; i < len; i++) {
109
+ array[i] = ShaderNodeObject(array[i]);
110
+ }
111
+
112
+ return array;
113
+ };
114
+
115
+ var ShaderNodeProxy = function ShaderNodeProxy(NodeClass) {
116
+ var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
117
+ var factor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
118
+
119
+ if (scope === null) {
120
+ return function () {
121
+ for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
122
+ params[_key] = arguments[_key];
123
+ }
124
+
125
+ return ShaderNodeObject(_construct(NodeClass, _toConsumableArray(ShaderNodeArray(params))));
126
+ };
127
+ } else if (factor === null) {
128
+ return function () {
129
+ for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
130
+ params[_key2] = arguments[_key2];
131
+ }
132
+
133
+ return ShaderNodeObject(_construct(NodeClass, [scope].concat(_toConsumableArray(ShaderNodeArray(params)))));
134
+ };
135
+ } else {
136
+ factor = ShaderNodeObject(factor);
137
+ return function () {
138
+ for (var _len3 = arguments.length, params = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
139
+ params[_key3] = arguments[_key3];
140
+ }
141
+
142
+ return ShaderNodeObject(_construct(NodeClass, [scope].concat(_toConsumableArray(ShaderNodeArray(params)), [factor])));
143
+ };
144
+ }
145
+ };
146
+
147
+ var ShaderNodeScript = function ShaderNodeScript(jsFunc) {
148
+ return function (inputs, builder) {
149
+ ShaderNodeObjects(inputs);
150
+ return ShaderNodeObject(jsFunc(inputs, builder));
151
+ };
152
+ };
153
+
154
+ var ShaderNode = new Proxy(ShaderNodeScript, NodeHandler); //
155
+ // Node Material Shader Syntax
156
+ //
157
+
158
+ _exports.ShaderNode = ShaderNode;
159
+ var uniform = new ShaderNode(function (inputNode) {
160
+ inputNode.setConst(false);
161
+ return inputNode;
162
+ });
163
+ _exports.uniform = uniform;
164
+
165
+ var float = function float(val) {
166
+ return ShaderNodeObject(new _FloatNode.default(val).setConst(true));
167
+ };
168
+
169
+ _exports.float = float;
170
+
171
+ var color = function color() {
172
+ for (var _len4 = arguments.length, params = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
173
+ params[_key4] = arguments[_key4];
174
+ }
175
+
176
+ return ShaderNodeObject(new _ColorNode.default(_construct(_three.Color, params)).setConst(true));
177
+ };
178
+
179
+ _exports.color = color;
180
+
181
+ var join = function join() {
182
+ for (var _len5 = arguments.length, params = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
183
+ params[_key5] = arguments[_key5];
184
+ }
185
+
186
+ return ShaderNodeObject(new _JoinNode.default(ShaderNodeArray(params)));
187
+ };
188
+
189
+ _exports.join = join;
190
+
191
+ var cond = function cond() {
192
+ for (var _len6 = arguments.length, params = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
193
+ params[_key6] = arguments[_key6];
194
+ }
195
+
196
+ return ShaderNodeObject(_construct(_CondNode.default, _toConsumableArray(ShaderNodeArray(params))));
197
+ };
198
+
199
+ _exports.cond = cond;
200
+
201
+ var vec2 = function vec2() {
202
+ var _params$;
203
+
204
+ for (var _len7 = arguments.length, params = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
205
+ params[_key7] = arguments[_key7];
206
+ }
207
+
208
+ if (((_params$ = params[0]) === null || _params$ === void 0 ? void 0 : _params$.isNode) === true) {
209
+ return ShaderNodeObject(new _ConvertNode.default(params[0], 'vec2'));
210
+ } else {
211
+ // Providing one scalar value: This value is used for all components
212
+ if (params.length === 1) {
213
+ params[1] = params[0];
214
+ }
215
+
216
+ return ShaderNodeObject(new _Vector2Node.default(_construct(_three.Vector2, params)).setConst(true));
217
+ }
218
+ };
219
+
220
+ _exports.vec2 = vec2;
221
+
222
+ var vec3 = function vec3() {
223
+ var _params$2;
224
+
225
+ for (var _len8 = arguments.length, params = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
226
+ params[_key8] = arguments[_key8];
227
+ }
228
+
229
+ if (((_params$2 = params[0]) === null || _params$2 === void 0 ? void 0 : _params$2.isNode) === true) {
230
+ return ShaderNodeObject(new _ConvertNode.default(params[0], 'vec3'));
231
+ } else {
232
+ // Providing one scalar value: This value is used for all components
233
+ if (params.length === 1) {
234
+ params[1] = params[2] = params[0];
235
+ }
236
+
237
+ return ShaderNodeObject(new _Vector3Node.default(_construct(_three.Vector3, params)).setConst(true));
238
+ }
239
+ };
240
+
241
+ _exports.vec3 = vec3;
242
+
243
+ var vec4 = function vec4() {
244
+ var _params$3;
245
+
246
+ for (var _len9 = arguments.length, params = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
247
+ params[_key9] = arguments[_key9];
248
+ }
249
+
250
+ if (((_params$3 = params[0]) === null || _params$3 === void 0 ? void 0 : _params$3.isNode) === true) {
251
+ return ShaderNodeObject(new _ConvertNode.default(params[0], 'vec4'));
252
+ } else {
253
+ // Providing one scalar value: This value is used for all components
254
+ if (params.length === 1) {
255
+ params[1] = params[2] = params[3] = params[0];
256
+ }
257
+
258
+ return ShaderNodeObject(new _Vector4Node.default(_construct(_three.Vector4, params)).setConst(true));
259
+ }
260
+ };
261
+
262
+ _exports.vec4 = vec4;
263
+
264
+ var addTo = function addTo(varNode) {
265
+ for (var _len10 = arguments.length, params = new Array(_len10 > 1 ? _len10 - 1 : 0), _key10 = 1; _key10 < _len10; _key10++) {
266
+ params[_key10 - 1] = arguments[_key10];
267
+ }
268
+
269
+ varNode.node = add.apply(void 0, [varNode.node].concat(_toConsumableArray(ShaderNodeArray(params))));
270
+ return ShaderNodeObject(varNode);
271
+ };
272
+
273
+ _exports.addTo = addTo;
274
+ var add = ShaderNodeProxy(_OperatorNode.default, '+');
275
+ _exports.add = add;
276
+ var sub = ShaderNodeProxy(_OperatorNode.default, '-');
277
+ _exports.sub = sub;
278
+ var mul = ShaderNodeProxy(_OperatorNode.default, '*');
279
+ _exports.mul = mul;
280
+ var div = ShaderNodeProxy(_OperatorNode.default, '/');
281
+ _exports.div = div;
282
+ var equal = ShaderNodeProxy(_OperatorNode.default, '==');
283
+ _exports.equal = equal;
284
+ var assign = ShaderNodeProxy(_OperatorNode.default, '=');
285
+ _exports.assign = assign;
286
+ var greaterThan = ShaderNodeProxy(_OperatorNode.default, '>');
287
+ _exports.greaterThan = greaterThan;
288
+ var lessThanEqual = ShaderNodeProxy(_OperatorNode.default, '<=');
289
+ _exports.lessThanEqual = lessThanEqual;
290
+ var and = ShaderNodeProxy(_OperatorNode.default, '&&');
291
+ _exports.and = and;
292
+ var element = ShaderNodeProxy(_ArrayElementNode.default);
293
+ _exports.element = element;
294
+ var normalLocal = new _NormalNode.default(_NormalNode.default.LOCAL);
295
+ _exports.normalLocal = normalLocal;
296
+ var normalWorld = new _NormalNode.default(_NormalNode.default.WORLD);
297
+ _exports.normalWorld = normalWorld;
298
+ var normalView = new _NormalNode.default(_NormalNode.default.VIEW);
299
+ _exports.normalView = normalView;
300
+ var transformedNormalView = new _VarNode.default(new _NormalNode.default(_NormalNode.default.VIEW), 'TransformedNormalView', 'vec3');
301
+ _exports.transformedNormalView = transformedNormalView;
302
+ var positionLocal = new _PositionNode.default(_PositionNode.default.LOCAL);
303
+ _exports.positionLocal = positionLocal;
304
+ var positionWorld = new _PositionNode.default(_PositionNode.default.WORLD);
305
+ _exports.positionWorld = positionWorld;
306
+ var positionView = new _PositionNode.default(_PositionNode.default.VIEW);
307
+ _exports.positionView = positionView;
308
+ var positionViewDirection = new _PositionNode.default(_PositionNode.default.VIEW_DIRECTION);
309
+ _exports.positionViewDirection = positionViewDirection;
310
+ var PI = float(3.141592653589793);
311
+ _exports.PI = PI;
312
+ var PI2 = float(6.283185307179586);
313
+ _exports.PI2 = PI2;
314
+ var PI_HALF = float(1.5707963267948966);
315
+ _exports.PI_HALF = PI_HALF;
316
+ var RECIPROCAL_PI = float(0.3183098861837907);
317
+ _exports.RECIPROCAL_PI = RECIPROCAL_PI;
318
+ var RECIPROCAL_PI2 = float(0.15915494309189535);
319
+ _exports.RECIPROCAL_PI2 = RECIPROCAL_PI2;
320
+ var EPSILON = float(1e-6);
321
+ _exports.EPSILON = EPSILON;
322
+ var diffuseColor = new _PropertyNode.default('DiffuseColor', 'vec4');
323
+ _exports.diffuseColor = diffuseColor;
324
+ var roughness = new _PropertyNode.default('Roughness', 'float');
325
+ _exports.roughness = roughness;
326
+ var metalness = new _PropertyNode.default('Metalness', 'float');
327
+ _exports.metalness = metalness;
328
+ var alphaTest = new _PropertyNode.default('AlphaTest', 'float');
329
+ _exports.alphaTest = alphaTest;
330
+ var specularColor = new _PropertyNode.default('SpecularColor', 'color');
331
+ _exports.specularColor = specularColor;
332
+ var abs = ShaderNodeProxy(_MathNode.default, 'abs');
333
+ _exports.abs = abs;
334
+ var negate = ShaderNodeProxy(_MathNode.default, 'negate');
335
+ _exports.negate = negate;
336
+ var floor = ShaderNodeProxy(_MathNode.default, 'floor');
337
+ _exports.floor = floor;
338
+ var mod = ShaderNodeProxy(_MathNode.default, 'mod');
339
+ _exports.mod = mod;
340
+ var cross = ShaderNodeProxy(_MathNode.default, 'cross');
341
+ _exports.cross = cross;
342
+ var fract = ShaderNodeProxy(_MathNode.default, 'fract');
343
+ _exports.fract = fract;
344
+ var round = ShaderNodeProxy(_MathNode.default, 'round');
345
+ _exports.round = round;
346
+ var max = ShaderNodeProxy(_MathNode.default, 'max');
347
+ _exports.max = max;
348
+ var min = ShaderNodeProxy(_MathNode.default, 'min');
349
+ _exports.min = min;
350
+ var sin = ShaderNodeProxy(_MathNode.default, 'sin');
351
+ _exports.sin = sin;
352
+ var cos = ShaderNodeProxy(_MathNode.default, 'cos');
353
+ _exports.cos = cos;
354
+ var dot = ShaderNodeProxy(_MathNode.default, 'dot');
355
+ _exports.dot = dot;
356
+ var normalize = ShaderNodeProxy(_MathNode.default, 'normalize');
357
+ _exports.normalize = normalize;
358
+ var sqrt = ShaderNodeProxy(_MathNode.default, 'sqrt');
359
+ _exports.sqrt = sqrt;
360
+ var inversesqrt = ShaderNodeProxy(_MathNode.default, 'inversesqrt');
361
+ _exports.inversesqrt = inversesqrt;
362
+ var sign = ShaderNodeProxy(_MathNode.default, 'sign');
363
+ _exports.sign = sign;
364
+ var dFdx = ShaderNodeProxy(_MathNode.default, 'dFdx');
365
+ _exports.dFdx = dFdx;
366
+ var dFdy = ShaderNodeProxy(_MathNode.default, 'dFdy');
367
+ _exports.dFdy = dFdy;
368
+ var pow = ShaderNodeProxy(_MathNode.default, 'pow');
369
+ _exports.pow = pow;
370
+ var pow2 = ShaderNodeProxy(_MathNode.default, 'pow', 2);
371
+ _exports.pow2 = pow2;
372
+ var pow3 = ShaderNodeProxy(_MathNode.default, 'pow', 3);
373
+ _exports.pow3 = pow3;
374
+ var pow4 = ShaderNodeProxy(_MathNode.default, 'pow', 4);
375
+ _exports.pow4 = pow4;
376
+ var exp = ShaderNodeProxy(_MathNode.default, 'exp');
377
+ _exports.exp = exp;
378
+ var exp2 = ShaderNodeProxy(_MathNode.default, 'exp2');
379
+ _exports.exp2 = exp2;
380
+ var mix = ShaderNodeProxy(_MathNode.default, 'mix');
381
+ _exports.mix = mix;
382
+ var saturate = ShaderNodeProxy(_MathNode.default, 'saturate');
383
+ _exports.saturate = saturate;
384
+ var transformDirection = ShaderNodeProxy(_MathNode.default, 'transformDirection');
385
+ _exports.transformDirection = transformDirection;
386
+ });
@@ -0,0 +1,114 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "./Object3DNode.js", "../inputs/Matrix4Node.js"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("./Object3DNode.js"), require("../inputs/Matrix4Node.js"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.Object3DNode, global.Matrix4Node);
11
+ global.CameraNode = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _Object3DNode2, _Matrix4Node) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.default = void 0;
20
+ _Object3DNode2 = _interopRequireDefault(_Object3DNode2);
21
+ _Matrix4Node = _interopRequireDefault(_Matrix4Node);
22
+
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+
25
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26
+
27
+ 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); } }
28
+
29
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
30
+
31
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
32
+
33
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
34
+
35
+ 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); }
36
+
37
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
38
+
39
+ 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); }; }
40
+
41
+ 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); }
42
+
43
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
44
+
45
+ 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; } }
46
+
47
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
48
+
49
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
50
+
51
+ var CameraNode = /*#__PURE__*/function (_Object3DNode) {
52
+ _inherits(CameraNode, _Object3DNode);
53
+
54
+ var _super = _createSuper(CameraNode);
55
+
56
+ function CameraNode() {
57
+ var _this;
58
+
59
+ var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : CameraNode.POSITION;
60
+
61
+ _classCallCheck(this, CameraNode);
62
+
63
+ _this = _super.call(this, scope);
64
+ _this._inputNode = null;
65
+ return _this;
66
+ }
67
+
68
+ _createClass(CameraNode, [{
69
+ key: "getNodeType",
70
+ value: function getNodeType(builder) {
71
+ var scope = this.scope;
72
+
73
+ if (scope === CameraNode.PROJECTION_MATRIX) {
74
+ return 'mat4';
75
+ }
76
+
77
+ return _get(_getPrototypeOf(CameraNode.prototype), "getNodeType", this).call(this, builder);
78
+ }
79
+ }, {
80
+ key: "update",
81
+ value: function update(frame) {
82
+ var camera = frame.camera;
83
+ var inputNode = this._inputNode;
84
+ var scope = this.scope;
85
+
86
+ if (scope === CameraNode.PROJECTION_MATRIX) {
87
+ inputNode.value = camera.projectionMatrix;
88
+ } else if (scope === CameraNode.VIEW_MATRIX) {
89
+ inputNode.value = camera.matrixWorldInverse;
90
+ } else {
91
+ _get(_getPrototypeOf(CameraNode.prototype), "update", this).call(this, frame);
92
+ }
93
+ }
94
+ }, {
95
+ key: "generate",
96
+ value: function generate(builder) {
97
+ var scope = this.scope;
98
+
99
+ if (scope === CameraNode.PROJECTION_MATRIX) {
100
+ this._inputNode = new _Matrix4Node.default(null);
101
+ }
102
+
103
+ return _get(_getPrototypeOf(CameraNode.prototype), "generate", this).call(this, builder);
104
+ }
105
+ }]);
106
+
107
+ return CameraNode;
108
+ }(_Object3DNode2.default);
109
+
110
+ _defineProperty(CameraNode, "PROJECTION_MATRIX", 'projectionMatrix');
111
+
112
+ var _default = CameraNode;
113
+ _exports.default = _default;
114
+ });
@@ -0,0 +1,140 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "../core/Node.js", "../math/OperatorNode.js", "./MaterialReferenceNode.js"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("../core/Node.js"), require("../math/OperatorNode.js"), require("./MaterialReferenceNode.js"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.Node, global.OperatorNode, global.MaterialReferenceNode);
11
+ global.MaterialNode = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _Node2, _OperatorNode, _MaterialReferenceNode) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.default = void 0;
20
+ _Node2 = _interopRequireDefault(_Node2);
21
+ _OperatorNode = _interopRequireDefault(_OperatorNode);
22
+ _MaterialReferenceNode = _interopRequireDefault(_MaterialReferenceNode);
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
+
28
+ 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); } }
29
+
30
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
+
32
+ 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); }
33
+
34
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
+
36
+ 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); }; }
37
+
38
+ 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); }
39
+
40
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
+
42
+ 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; } }
43
+
44
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
+
46
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
47
+
48
+ var MaterialNode = /*#__PURE__*/function (_Node) {
49
+ _inherits(MaterialNode, _Node);
50
+
51
+ var _super = _createSuper(MaterialNode);
52
+
53
+ function MaterialNode() {
54
+ var _this;
55
+
56
+ var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MaterialNode.COLOR;
57
+
58
+ _classCallCheck(this, MaterialNode);
59
+
60
+ _this = _super.call(this);
61
+ _this.scope = scope;
62
+ return _this;
63
+ }
64
+
65
+ _createClass(MaterialNode, [{
66
+ key: "getNodeType",
67
+ value: function getNodeType(builder) {
68
+ var scope = this.scope;
69
+ var material = builder.context.material;
70
+
71
+ if (scope === MaterialNode.COLOR) {
72
+ return material.map !== null ? 'vec4' : 'vec3';
73
+ } else if (scope === MaterialNode.OPACITY) {
74
+ return 'float';
75
+ } else if (scope === MaterialNode.SPECULAR) {
76
+ return 'vec3';
77
+ } else if (scope === MaterialNode.ROUGHNESS || scope === MaterialNode.METALNESS) {
78
+ return 'float';
79
+ }
80
+ }
81
+ }, {
82
+ key: "generate",
83
+ value: function generate(builder, output) {
84
+ var material = builder.context.material;
85
+ var scope = this.scope;
86
+ var node = null;
87
+
88
+ if (scope === MaterialNode.ALPHA_TEST) {
89
+ node = new _MaterialReferenceNode.default('alphaTest', 'float');
90
+ } else if (scope === MaterialNode.COLOR) {
91
+ var colorNode = new _MaterialReferenceNode.default('color', 'color');
92
+
93
+ if (material.map !== null && material.map !== undefined && material.map.isTexture === true) {
94
+ node = new _OperatorNode.default('*', colorNode, new _MaterialReferenceNode.default('map', 'texture'));
95
+ } else {
96
+ node = colorNode;
97
+ }
98
+ } else if (scope === MaterialNode.OPACITY) {
99
+ var opacityNode = new _MaterialReferenceNode.default('opacity', 'float');
100
+
101
+ if (material.alphaMap !== null && material.alphaMap !== undefined && material.alphaMap.isTexture === true) {
102
+ node = new _OperatorNode.default('*', opacityNode, new _MaterialReferenceNode.default('alphaMap', 'texture'));
103
+ } else {
104
+ node = opacityNode;
105
+ }
106
+ } else if (scope === MaterialNode.SPECULAR) {
107
+ var specularColorNode = new _MaterialReferenceNode.default('specularColor', 'color');
108
+
109
+ if (material.specularColorMap !== null && material.specularColorMap !== undefined && material.specularColorMap.isTexture === true) {
110
+ node = new _OperatorNode.default('*', specularColorNode, new _MaterialReferenceNode.default('specularColorMap', 'texture'));
111
+ } else {
112
+ node = specularColorNode;
113
+ }
114
+ } else {
115
+ var outputType = this.getNodeType(builder);
116
+ node = new _MaterialReferenceNode.default(scope, outputType);
117
+ }
118
+
119
+ return node.build(builder, output);
120
+ }
121
+ }]);
122
+
123
+ return MaterialNode;
124
+ }(_Node2.default);
125
+
126
+ _defineProperty(MaterialNode, "ALPHA_TEST", 'alphaTest');
127
+
128
+ _defineProperty(MaterialNode, "COLOR", 'color');
129
+
130
+ _defineProperty(MaterialNode, "OPACITY", 'opacity');
131
+
132
+ _defineProperty(MaterialNode, "SPECULAR", 'specular');
133
+
134
+ _defineProperty(MaterialNode, "ROUGHNESS", 'roughness');
135
+
136
+ _defineProperty(MaterialNode, "METALNESS", 'metalness');
137
+
138
+ var _default = MaterialNode;
139
+ _exports.default = _default;
140
+ });