x_ite 8.11.7 → 8.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +23 -23
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +26 -26
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +17 -17
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +37 -37
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +30 -30
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +18 -18
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +159 -145
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/package.json +16 -13
- package/.github/workflows/pages-deploy.yml +0 -64
- package/.vscode/launch.json +0 -15
- package/.vscode/settings.json +0 -44
- package/.vscode/tasks.json +0 -31
- package/Makefile +0 -82
- package/build/bin/bump.pl +0 -21
- package/build/bin/tests.pl +0 -203
- package/build/bin/version.pl +0 -157
- package/build/docs/components.js +0 -218
- package/build/docs/glTF-samples.pl +0 -151
- package/build/docs/nodes.pl +0 -434
- package/build/docs/tags.pl +0 -28
- package/build/src/nodes.pl +0 -41
- package/docs/Gemfile +0 -19
- package/docs/LICENSE +0 -21
- package/docs/README.md +0 -46
- package/docs/_config.yml +0 -203
- package/docs/_data/assets/cross_origin.yml +0 -62
- package/docs/_data/assets/self_host.yml +0 -51
- package/docs/_data/contact.yml +0 -30
- package/docs/_data/locales/bg-BG.yml +0 -83
- package/docs/_data/locales/de-DE.yml +0 -82
- package/docs/_data/locales/en.yml +0 -93
- package/docs/_data/locales/es-ES.yml +0 -79
- package/docs/_data/locales/fr-FR.yml +0 -79
- package/docs/_data/locales/hu-HU.yml +0 -81
- package/docs/_data/locales/id-ID.yml +0 -79
- package/docs/_data/locales/ko-KR.yml +0 -86
- package/docs/_data/locales/my-MM.yml +0 -79
- package/docs/_data/locales/pt-BR.yml +0 -79
- package/docs/_data/locales/ru-RU.yml +0 -79
- package/docs/_data/locales/tr-TR.yml +0 -79
- package/docs/_data/locales/uk-UA.yml +0 -79
- package/docs/_data/locales/vi-VN.yml +0 -77
- package/docs/_data/locales/zh-CN.yml +0 -85
- package/docs/_data/nav/components-CADGeometry.yml +0 -14
- package/docs/_data/nav/components-Core.yml +0 -16
- package/docs/_data/nav/components-CubeMapTexturing.yml +0 -8
- package/docs/_data/nav/components-DIS.yml +0 -14
- package/docs/_data/nav/components-EnvironmentalEffects.yml +0 -12
- package/docs/_data/nav/components-EnvironmentalSensor.yml +0 -8
- package/docs/_data/nav/components-EventUtilities.yml +0 -16
- package/docs/_data/nav/components-Followers.yml +0 -30
- package/docs/_data/nav/components-Geometry2D.yml +0 -18
- package/docs/_data/nav/components-Geometry3D.yml +0 -16
- package/docs/_data/nav/components-Geospatial.yml +0 -24
- package/docs/_data/nav/components-Grouping.yml +0 -10
- package/docs/_data/nav/components-HAnim.yml +0 -14
- package/docs/_data/nav/components-Interpolation.yml +0 -28
- package/docs/_data/nav/components-KeyDeviceSensor.yml +0 -6
- package/docs/_data/nav/components-Layering.yml +0 -8
- package/docs/_data/nav/components-Layout.yml +0 -12
- package/docs/_data/nav/components-Lighting.yml +0 -10
- package/docs/_data/nav/components-NURBS.yml +0 -30
- package/docs/_data/nav/components-Navigation.yml +0 -16
- package/docs/_data/nav/components-Networking.yml +0 -8
- package/docs/_data/nav/components-ParticleSystems.yml +0 -22
- package/docs/_data/nav/components-Picking.yml +0 -12
- package/docs/_data/nav/components-PointingDeviceSensor.yml +0 -10
- package/docs/_data/nav/components-Rendering.yml +0 -30
- package/docs/_data/nav/components-RigidBodyPhysics.yml +0 -30
- package/docs/_data/nav/components-Scripting.yml +0 -4
- package/docs/_data/nav/components-Shaders.yml +0 -18
- package/docs/_data/nav/components-Shape.yml +0 -22
- package/docs/_data/nav/components-Sound.yml +0 -44
- package/docs/_data/nav/components-Text.yml +0 -6
- package/docs/_data/nav/components-TextureProjector.yml +0 -6
- package/docs/_data/nav/components-Texturing.yml +0 -22
- package/docs/_data/nav/components-Texturing3D.yml +0 -18
- package/docs/_data/nav/components-Time.yml +0 -4
- package/docs/_data/nav/components-VolumeRendering.yml +0 -28
- package/docs/_data/nav/components-X_ITE.yml +0 -4
- package/docs/_data/nav/main.yml +0 -26
- package/docs/_data/nav/reference.yml +0 -18
- package/docs/_data/nav/tutorials-animation-sensors-and-geometry.yml +0 -18
- package/docs/_data/nav/tutorials-basic.yml +0 -6
- package/docs/_data/nav/tutorials-optimize-your-scene.yml +0 -6
- package/docs/_data/nav/tutorials-scripts-and-prototypes.yml +0 -12
- package/docs/_data/nav/tutorials-shapes-geometry-and-appearance.yml +0 -16
- package/docs/_data/nav/tutorials-textures-lights-and-environment.yml +0 -20
- package/docs/_data/share.yml +0 -27
- package/docs/_includes/nav.html +0 -19
- package/docs/_includes/scripts.html +0 -3
- package/docs/_layouts/compress.html +0 -11
- package/docs/_layouts/redirect-page.html +0 -6
- package/docs/_layouts/wide.html +0 -52
- package/docs/_layouts/wrap.html +0 -4
- package/docs/_layouts/x_ite.html +0 -8
- package/docs/_plugins/no_date.rb +0 -11
- package/docs/_plugins/posts-lastmod-hook.rb +0 -14
- package/docs/_posts/accessing-the-external-browser.md +0 -312
- package/docs/_posts/browser-support.md +0 -53
- package/docs/_posts/components/CADGeometry/CADAssembly.md +0 -126
- package/docs/_posts/components/CADGeometry/CADFace.md +0 -113
- package/docs/_posts/components/CADGeometry/CADLayer.md +0 -126
- package/docs/_posts/components/CADGeometry/CADPart.md +0 -164
- package/docs/_posts/components/CADGeometry/IndexedQuadSet.md +0 -154
- package/docs/_posts/components/CADGeometry/QuadSet.md +0 -145
- package/docs/_posts/components/Core/MetadataBoolean.md +0 -83
- package/docs/_posts/components/Core/MetadataDouble.md +0 -84
- package/docs/_posts/components/Core/MetadataFloat.md +0 -84
- package/docs/_posts/components/Core/MetadataInteger.md +0 -83
- package/docs/_posts/components/Core/MetadataSet.md +0 -80
- package/docs/_posts/components/Core/MetadataString.md +0 -83
- package/docs/_posts/components/Core/WorldInfo.md +0 -65
- package/docs/_posts/components/CubeMapTexturing/ComposedCubeMapTexture.md +0 -123
- package/docs/_posts/components/CubeMapTexturing/GeneratedCubeMapTexture.md +0 -82
- package/docs/_posts/components/CubeMapTexturing/ImageCubeMapTexture.md +0 -112
- package/docs/_posts/components/DIS/DISEntityManager.md +0 -98
- package/docs/_posts/components/DIS/DISEntityTypeMapping.md +0 -131
- package/docs/_posts/components/DIS/EspduTransform.md +0 -566
- package/docs/_posts/components/DIS/ReceiverPdu.md +0 -235
- package/docs/_posts/components/DIS/SignalPdu.md +0 -239
- package/docs/_posts/components/DIS/TransmitterPdu.md +0 -299
- package/docs/_posts/components/EnvironmentalEffects/Background.md +0 -230
- package/docs/_posts/components/EnvironmentalEffects/Fog.md +0 -118
- package/docs/_posts/components/EnvironmentalEffects/FogCoordinate.md +0 -44
- package/docs/_posts/components/EnvironmentalEffects/LocalFog.md +0 -91
- package/docs/_posts/components/EnvironmentalEffects/TextureBackground.md +0 -194
- package/docs/_posts/components/EnvironmentalSensor/ProximitySensor.md +0 -118
- package/docs/_posts/components/EnvironmentalSensor/TransformSensor.md +0 -115
- package/docs/_posts/components/EnvironmentalSensor/VisibilitySensor.md +0 -89
- package/docs/_posts/components/EventUtilities/BooleanFilter.md +0 -75
- package/docs/_posts/components/EventUtilities/BooleanSequencer.md +0 -115
- package/docs/_posts/components/EventUtilities/BooleanToggle.md +0 -67
- package/docs/_posts/components/EventUtilities/BooleanTrigger.md +0 -64
- package/docs/_posts/components/EventUtilities/IntegerSequencer.md +0 -119
- package/docs/_posts/components/EventUtilities/IntegerTrigger.md +0 -76
- package/docs/_posts/components/EventUtilities/TimeTrigger.md +0 -68
- package/docs/_posts/components/Followers/ColorChaser.md +0 -101
- package/docs/_posts/components/Followers/ColorDamper.md +0 -105
- package/docs/_posts/components/Followers/CoordinateChaser.md +0 -100
- package/docs/_posts/components/Followers/CoordinateDamper.md +0 -100
- package/docs/_posts/components/Followers/OrientationChaser.md +0 -96
- package/docs/_posts/components/Followers/OrientationDamper.md +0 -100
- package/docs/_posts/components/Followers/PositionChaser.md +0 -96
- package/docs/_posts/components/Followers/PositionChaser2D.md +0 -96
- package/docs/_posts/components/Followers/PositionDamper.md +0 -100
- package/docs/_posts/components/Followers/PositionDamper2D.md +0 -100
- package/docs/_posts/components/Followers/ScalarChaser.md +0 -100
- package/docs/_posts/components/Followers/ScalarDamper.md +0 -100
- package/docs/_posts/components/Followers/TexCoordChaser2D.md +0 -96
- package/docs/_posts/components/Followers/TexCoordDamper2D.md +0 -100
- package/docs/_posts/components/Geometry2D/Arc2D.md +0 -96
- package/docs/_posts/components/Geometry2D/ArcClose2D.md +0 -115
- package/docs/_posts/components/Geometry2D/Circle2D.md +0 -66
- package/docs/_posts/components/Geometry2D/Disk2D.md +0 -93
- package/docs/_posts/components/Geometry2D/Polyline2D.md +0 -69
- package/docs/_posts/components/Geometry2D/Polypoint2D.md +0 -62
- package/docs/_posts/components/Geometry2D/Rectangle2D.md +0 -77
- package/docs/_posts/components/Geometry2D/TriangleSet2D.md +0 -77
- package/docs/_posts/components/Geometry3D/Box.md +0 -79
- package/docs/_posts/components/Geometry3D/Cone.md +0 -98
- package/docs/_posts/components/Geometry3D/Cylinder.md +0 -102
- package/docs/_posts/components/Geometry3D/ElevationGrid.md +0 -206
- package/docs/_posts/components/Geometry3D/Extrusion.md +0 -222
- package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +0 -260
- package/docs/_posts/components/Geometry3D/Sphere.md +0 -78
- package/docs/_posts/components/Geospatial/GeoCoordinate.md +0 -81
- package/docs/_posts/components/Geospatial/GeoElevationGrid.md +0 -225
- package/docs/_posts/components/Geospatial/GeoLOD.md +0 -184
- package/docs/_posts/components/Geospatial/GeoLocation.md +0 -148
- package/docs/_posts/components/Geospatial/GeoMetadata.md +0 -117
- package/docs/_posts/components/Geospatial/GeoOrigin.md +0 -84
- package/docs/_posts/components/Geospatial/GeoPositionInterpolator.md +0 -141
- package/docs/_posts/components/Geospatial/GeoProximitySensor.md +0 -158
- package/docs/_posts/components/Geospatial/GeoTouchSensor.md +0 -153
- package/docs/_posts/components/Geospatial/GeoTransform.md +0 -182
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +0 -214
- package/docs/_posts/components/Grouping/Group.md +0 -108
- package/docs/_posts/components/Grouping/StaticGroup.md +0 -103
- package/docs/_posts/components/Grouping/Switch.md +0 -125
- package/docs/_posts/components/Grouping/Transform.md +0 -160
- package/docs/_posts/components/HAnim/HAnimDisplacer.md +0 -108
- package/docs/_posts/components/HAnim/HAnimHumanoid.md +0 -351
- package/docs/_posts/components/HAnim/HAnimJoint.md +0 -256
- package/docs/_posts/components/HAnim/HAnimMotion.md +0 -186
- package/docs/_posts/components/HAnim/HAnimSegment.md +0 -172
- package/docs/_posts/components/HAnim/HAnimSite.md +0 -176
- package/docs/_posts/components/Interpolation/ColorInterpolator.md +0 -103
- package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +0 -102
- package/docs/_posts/components/Interpolation/CoordinateInterpolator2D.md +0 -102
- package/docs/_posts/components/Interpolation/EaseInEaseOut.md +0 -91
- package/docs/_posts/components/Interpolation/NormalInterpolator.md +0 -98
- package/docs/_posts/components/Interpolation/OrientationInterpolator.md +0 -102
- package/docs/_posts/components/Interpolation/PositionInterpolator.md +0 -102
- package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +0 -106
- package/docs/_posts/components/Interpolation/ScalarInterpolator.md +0 -102
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator.md +0 -118
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator2D.md +0 -118
- package/docs/_posts/components/Interpolation/SplineScalarInterpolator.md +0 -122
- package/docs/_posts/components/Interpolation/SquadOrientationInterpolator.md +0 -102
- package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +0 -120
- package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +0 -92
- package/docs/_posts/components/Layering/Layer.md +0 -92
- package/docs/_posts/components/Layering/LayerSet.md +0 -84
- package/docs/_posts/components/Layering/Viewport.md +0 -113
- package/docs/_posts/components/Layout/Layout.md +0 -118
- package/docs/_posts/components/Layout/LayoutGroup.md +0 -118
- package/docs/_posts/components/Layout/LayoutLayer.md +0 -99
- package/docs/_posts/components/Layout/ScreenFontStyle.md +0 -164
- package/docs/_posts/components/Layout/ScreenGroup.md +0 -104
- package/docs/_posts/components/Lighting/DirectionalLight.md +0 -108
- package/docs/_posts/components/Lighting/EnvironmentLight.md +0 -87
- package/docs/_posts/components/Lighting/PointLight.md +0 -115
- package/docs/_posts/components/Lighting/SpotLight.md +0 -145
- package/docs/_posts/components/NURBS/Contour2D.md +0 -65
- package/docs/_posts/components/NURBS/ContourPolyline2D.md +0 -50
- package/docs/_posts/components/NURBS/CoordinateDouble.md +0 -51
- package/docs/_posts/components/NURBS/NurbsCurve.md +0 -75
- package/docs/_posts/components/NURBS/NurbsCurve2D.md +0 -70
- package/docs/_posts/components/NURBS/NurbsOrientationInterpolator.md +0 -86
- package/docs/_posts/components/NURBS/NurbsPatchSurface.md +0 -112
- package/docs/_posts/components/NURBS/NurbsPositionInterpolator.md +0 -86
- package/docs/_posts/components/NURBS/NurbsSet.md +0 -117
- package/docs/_posts/components/NURBS/NurbsSurfaceInterpolator.md +0 -110
- package/docs/_posts/components/NURBS/NurbsSweptSurface.md +0 -86
- package/docs/_posts/components/NURBS/NurbsSwungSurface.md +0 -76
- package/docs/_posts/components/NURBS/NurbsTextureCoordinate.md +0 -81
- package/docs/_posts/components/NURBS/NurbsTrimmedSurface.md +0 -124
- package/docs/_posts/components/Navigation/Billboard.md +0 -121
- package/docs/_posts/components/Navigation/Collision.md +0 -156
- package/docs/_posts/components/Navigation/LOD.md +0 -146
- package/docs/_posts/components/Navigation/NavigationInfo.md +0 -170
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +0 -209
- package/docs/_posts/components/Navigation/Viewpoint.md +0 -213
- package/docs/_posts/components/Navigation/ViewpointGroup.md +0 -91
- package/docs/_posts/components/Networking/Anchor.md +0 -160
- package/docs/_posts/components/Networking/Inline.md +0 -161
- package/docs/_posts/components/Networking/LoadSensor.md +0 -123
- package/docs/_posts/components/ParticleSystems/BoundedPhysicsModel.md +0 -62
- package/docs/_posts/components/ParticleSystems/ConeEmitter.md +0 -95
- package/docs/_posts/components/ParticleSystems/ExplosionEmitter.md +0 -83
- package/docs/_posts/components/ParticleSystems/ForcePhysicsModel.md +0 -65
- package/docs/_posts/components/ParticleSystems/ParticleSystem.md +0 -249
- package/docs/_posts/components/ParticleSystems/PointEmitter.md +0 -87
- package/docs/_posts/components/ParticleSystems/PolylineEmitter.md +0 -106
- package/docs/_posts/components/ParticleSystems/SurfaceEmitter.md +0 -101
- package/docs/_posts/components/ParticleSystems/VolumeEmitter.md +0 -109
- package/docs/_posts/components/ParticleSystems/WindPhysicsModel.md +0 -72
- package/docs/_posts/components/Picking/LinePickSensor.md +0 -151
- package/docs/_posts/components/Picking/PickableGroup.md +0 -128
- package/docs/_posts/components/Picking/PointPickSensor.md +0 -133
- package/docs/_posts/components/Picking/PrimitivePickSensor.md +0 -126
- package/docs/_posts/components/Picking/VolumePickSensor.md +0 -124
- package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +0 -147
- package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +0 -137
- package/docs/_posts/components/PointingDeviceSensor/SphereSensor.md +0 -111
- package/docs/_posts/components/PointingDeviceSensor/TouchSensor.md +0 -121
- package/docs/_posts/components/Rendering/ClipPlane.md +0 -72
- package/docs/_posts/components/Rendering/Color.md +0 -56
- package/docs/_posts/components/Rendering/ColorRGBA.md +0 -65
- package/docs/_posts/components/Rendering/Coordinate.md +0 -49
- package/docs/_posts/components/Rendering/IndexedLineSet.md +0 -156
- package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +0 -149
- package/docs/_posts/components/Rendering/IndexedTriangleSet.md +0 -149
- package/docs/_posts/components/Rendering/IndexedTriangleStripSet.md +0 -141
- package/docs/_posts/components/Rendering/LineSet.md +0 -97
- package/docs/_posts/components/Rendering/Normal.md +0 -63
- package/docs/_posts/components/Rendering/PointSet.md +0 -89
- package/docs/_posts/components/Rendering/TriangleFanSet.md +0 -137
- package/docs/_posts/components/Rendering/TriangleSet.md +0 -133
- package/docs/_posts/components/Rendering/TriangleStripSet.md +0 -141
- package/docs/_posts/components/RigidBodyPhysics/BallJoint.md +0 -90
- package/docs/_posts/components/RigidBodyPhysics/CollidableOffset.md +0 -115
- package/docs/_posts/components/RigidBodyPhysics/CollidableShape.md +0 -118
- package/docs/_posts/components/RigidBodyPhysics/CollisionCollection.md +0 -95
- package/docs/_posts/components/RigidBodyPhysics/CollisionSensor.md +0 -74
- package/docs/_posts/components/RigidBodyPhysics/CollisionSpace.md +0 -106
- package/docs/_posts/components/RigidBodyPhysics/Contact.md +0 -121
- package/docs/_posts/components/RigidBodyPhysics/DoubleAxisHingeJoint.md +0 -164
- package/docs/_posts/components/RigidBodyPhysics/MotorJoint.md +0 -235
- package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +0 -185
- package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +0 -136
- package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +0 -118
- package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +0 -118
- package/docs/_posts/components/RigidBodyPhysics/UniversalJoint.md +0 -127
- package/docs/_posts/components/Scripting/Script.md +0 -139
- package/docs/_posts/components/Shaders/ComposedShader.md +0 -94
- package/docs/_posts/components/Shaders/FloatVertexAttribute.md +0 -74
- package/docs/_posts/components/Shaders/Matrix3VertexAttribute.md +0 -62
- package/docs/_posts/components/Shaders/Matrix4VertexAttribute.md +0 -62
- package/docs/_posts/components/Shaders/PackagedShader.md +0 -137
- package/docs/_posts/components/Shaders/ProgramShader.md +0 -91
- package/docs/_posts/components/Shaders/ShaderPart.md +0 -127
- package/docs/_posts/components/Shaders/ShaderProgram.md +0 -121
- package/docs/_posts/components/Shape/AcousticProperties.md +0 -80
- package/docs/_posts/components/Shape/Appearance.md +0 -130
- package/docs/_posts/components/Shape/FillProperties.md +0 -74
- package/docs/_posts/components/Shape/LineProperties.md +0 -71
- package/docs/_posts/components/Shape/Material.md +0 -235
- package/docs/_posts/components/Shape/PhysicalMaterial.md +0 -189
- package/docs/_posts/components/Shape/PointProperties.md +0 -83
- package/docs/_posts/components/Shape/Shape.md +0 -107
- package/docs/_posts/components/Shape/TwoSidedMaterial.md +0 -148
- package/docs/_posts/components/Shape/UnlitMaterial.md +0 -119
- package/docs/_posts/components/Sound/Analyser.md +0 -205
- package/docs/_posts/components/Sound/AudioClip.md +0 -223
- package/docs/_posts/components/Sound/AudioDestination.md +0 -128
- package/docs/_posts/components/Sound/BiquadFilter.md +0 -213
- package/docs/_posts/components/Sound/BufferAudioSource.md +0 -284
- package/docs/_posts/components/Sound/ChannelMerger.md +0 -108
- package/docs/_posts/components/Sound/ChannelSelector.md +0 -112
- package/docs/_posts/components/Sound/ChannelSplitter.md +0 -116
- package/docs/_posts/components/Sound/Convolver.md +0 -190
- package/docs/_posts/components/Sound/Delay.md +0 -185
- package/docs/_posts/components/Sound/DynamicsCompressor.md +0 -201
- package/docs/_posts/components/Sound/Gain.md +0 -177
- package/docs/_posts/components/Sound/ListenerPointSource.md +0 -171
- package/docs/_posts/components/Sound/MicrophoneSource.md +0 -145
- package/docs/_posts/components/Sound/OscillatorSource.md +0 -153
- package/docs/_posts/components/Sound/PeriodicWave.md +0 -83
- package/docs/_posts/components/Sound/Sound.md +0 -139
- package/docs/_posts/components/Sound/SpatialSound.md +0 -187
- package/docs/_posts/components/Sound/StreamAudioDestination.md +0 -132
- package/docs/_posts/components/Sound/StreamAudioSource.md +0 -145
- package/docs/_posts/components/Sound/WaveShaper.md +0 -189
- package/docs/_posts/components/Text/FontStyle.md +0 -171
- package/docs/_posts/components/Text/Text.md +0 -124
- package/docs/_posts/components/TextureProjector/TextureProjector.md +0 -111
- package/docs/_posts/components/TextureProjector/TextureProjectorParallel.md +0 -112
- package/docs/_posts/components/Texturing/ImageTexture.md +0 -138
- package/docs/_posts/components/Texturing/MovieTexture.md +0 -264
- package/docs/_posts/components/Texturing/MultiTexture.md +0 -128
- package/docs/_posts/components/Texturing/MultiTextureCoordinate.md +0 -64
- package/docs/_posts/components/Texturing/MultiTextureTransform.md +0 -69
- package/docs/_posts/components/Texturing/PixelTexture.md +0 -100
- package/docs/_posts/components/Texturing/TextureCoordinate.md +0 -62
- package/docs/_posts/components/Texturing/TextureCoordinateGenerator.md +0 -74
- package/docs/_posts/components/Texturing/TextureProperties.md +0 -162
- package/docs/_posts/components/Texturing/TextureTransform.md +0 -82
- package/docs/_posts/components/Texturing3D/ComposedTexture3D.md +0 -84
- package/docs/_posts/components/Texturing3D/ImageTexture3D.md +0 -141
- package/docs/_posts/components/Texturing3D/ImageTextureAtlas.md +0 -137
- package/docs/_posts/components/Texturing3D/PixelTexture3D.md +0 -87
- package/docs/_posts/components/Texturing3D/TextureCoordinate3D.md +0 -65
- package/docs/_posts/components/Texturing3D/TextureCoordinate4D.md +0 -64
- package/docs/_posts/components/Texturing3D/TextureTransform3D.md +0 -78
- package/docs/_posts/components/Texturing3D/TextureTransformMatrix3D.md +0 -67
- package/docs/_posts/components/Time/TimeSensor.md +0 -187
- package/docs/_posts/components/VolumeRendering/BlendedVolumeStyle.md +0 -113
- package/docs/_posts/components/VolumeRendering/BoundaryEnhancementVolumeStyle.md +0 -63
- package/docs/_posts/components/VolumeRendering/CartoonVolumeStyle.md +0 -86
- package/docs/_posts/components/VolumeRendering/ComposedVolumeStyle.md +0 -59
- package/docs/_posts/components/VolumeRendering/EdgeEnhancementVolumeStyle.md +0 -75
- package/docs/_posts/components/VolumeRendering/IsoSurfaceVolumeData.md +0 -138
- package/docs/_posts/components/VolumeRendering/OpacityMapVolumeStyle.md +0 -59
- package/docs/_posts/components/VolumeRendering/ProjectionVolumeStyle.md +0 -70
- package/docs/_posts/components/VolumeRendering/SegmentedVolumeData.md +0 -130
- package/docs/_posts/components/VolumeRendering/ShadedVolumeStyle.md +0 -83
- package/docs/_posts/components/VolumeRendering/SilhouetteEnhancementVolumeStyle.md +0 -71
- package/docs/_posts/components/VolumeRendering/ToneMappedVolumeStyle.md +0 -80
- package/docs/_posts/components/VolumeRendering/VolumeData.md +0 -105
- package/docs/_posts/components/X_ITE/BlendMode.md +0 -101
- package/docs/_posts/custom-shaders.md +0 -720
- package/docs/_posts/dom-integration.md +0 -237
- package/docs/_posts/features.md +0 -56
- package/docs/_posts/getting-started.md +0 -845
- package/docs/_posts/glossary.md +0 -344
- package/docs/_posts/how-to-configure-your-web-server.md +0 -61
- package/docs/_posts/laboratory/x3d-file-converter.md +0 -188
- package/docs/_posts/reference/browser-services.md +0 -466
- package/docs/_posts/reference/constants-services.md +0 -381
- package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +0 -50
- package/docs/_posts/reference/field-services-and-objects.md +0 -1137
- package/docs/_posts/reference/prototype-services.md +0 -146
- package/docs/_posts/reference/route-services.md +0 -54
- package/docs/_posts/reference/scene-services.md +0 -392
- package/docs/_posts/reference/script-node-authoring-interface.md +0 -347
- package/docs/_posts/report-a-bug.md +0 -17
- package/docs/_posts/setup-a-localhost-server.md +0 -46
- package/docs/_posts/supported-nodes.md +0 -378
- package/docs/_posts/tutorials/adding-backgrounds.md +0 -273
- package/docs/_posts/tutorials/adding-fog.md +0 -72
- package/docs/_posts/tutorials/adding-sound.md +0 -333
- package/docs/_posts/tutorials/animating-transforms.md +0 -390
- package/docs/_posts/tutorials/basic-nodes.md +0 -312
- package/docs/_posts/tutorials/building-a-x3d-world.md +0 -174
- package/docs/_posts/tutorials/building-elevation-grids.md +0 -177
- package/docs/_posts/tutorials/building-extruded-shapes.md +0 -150
- package/docs/_posts/tutorials/building-primitive-shapes.md +0 -211
- package/docs/_posts/tutorials/building-shapes-out-of-points-lines-and-faces.md +0 -315
- package/docs/_posts/tutorials/controlling-appearance-with-materials.md +0 -193
- package/docs/_posts/tutorials/controlling-color-on-coordinate-based-geometry.md +0 -213
- package/docs/_posts/tutorials/controlling-detail.md +0 -137
- package/docs/_posts/tutorials/controlling-how-textures-are-mapped.md +0 -282
- package/docs/_posts/tutorials/controlling-navigation.md +0 -75
- package/docs/_posts/tutorials/controlling-shading-on-coordinate-based-geometry.md +0 -185
- package/docs/_posts/tutorials/controlling-the-viewpoint.md +0 -54
- package/docs/_posts/tutorials/creating-new-node-types.md +0 -340
- package/docs/_posts/tutorials/grouping-nodes.md +0 -242
- package/docs/_posts/tutorials/hello-world.md +0 -198
- package/docs/_posts/tutorials/improving-performance.md +0 -229
- package/docs/_posts/tutorials/increasing-rendering-speed.md +0 -115
- package/docs/_posts/tutorials/introducing-animation.md +0 -216
- package/docs/_posts/tutorials/introducing-script-use.md +0 -132
- package/docs/_posts/tutorials/introducing-x3d.md +0 -100
- package/docs/_posts/tutorials/lighting-your-world.md +0 -144
- package/docs/_posts/tutorials/mapping-textures.md +0 -217
- package/docs/_posts/tutorials/naming-nodes.md +0 -168
- package/docs/_posts/tutorials/overview.md +0 -83
- package/docs/_posts/tutorials/providing-information-about-your-world.md +0 -35
- package/docs/_posts/tutorials/sensing-the-viewer.md +0 -210
- package/docs/_posts/tutorials/sensing-viewer-actions.md +0 -219
- package/docs/_posts/tutorials/transforming-shapes.md +0 -275
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +0 -637
- package/docs/_posts/what's-new.md +0 -1115
- package/docs/_tabs/components.md +0 -383
- package/docs/_tabs/laboratory.md +0 -52
- package/docs/_tabs/playground.html +0 -407
- package/docs/_tabs/reference.md +0 -8
- package/docs/_tabs/tags.md +0 -5
- package/docs/_tabs/tutorials.md +0 -7
- package/docs/assets/X3D/teaser/Michroma-Regular.ttf +0 -0
- package/docs/assets/X3D/teaser/peakpx.jpg +0 -0
- package/docs/assets/X3D/teaser/teaser.x3d +0 -55
- package/docs/assets/css/style.scss +0 -320
- package/docs/assets/img/favicons/android-chrome-192x192.png +0 -0
- package/docs/assets/img/favicons/android-chrome-512x512.png +0 -0
- package/docs/assets/img/favicons/apple-touch-icon.png +0 -0
- package/docs/assets/img/favicons/favicon-16x16.png +0 -0
- package/docs/assets/img/favicons/favicon-32x32.png +0 -0
- package/docs/assets/img/favicons/favicon.ico +0 -0
- package/docs/assets/img/favicons/mstile-150x150.png +0 -0
- package/docs/assets/img/favicons/safari-pinned-tab.svg +0 -71
- package/docs/assets/img/laboratory/blend-mode.png +0 -0
- package/docs/assets/img/laboratory/dicom-nrrd.png +0 -0
- package/docs/assets/img/laboratory/earthquake.png +0 -0
- package/docs/assets/img/laboratory/gltf.png +0 -0
- package/docs/assets/img/laboratory/l-system.png +0 -0
- package/docs/assets/img/logo.png +0 -0
- package/docs/assets/js/example.js +0 -128
- package/docs/google3696ee938394d7b6.html +0 -1
- package/docs/laboratory/3d-l-system-generator.html +0 -169
- package/docs/laboratory/gltf-sample-viewer.html +0 -811
- package/docs/laboratory/online-dicom-and-nrrd-file-viewer.html +0 -72
- package/docs/laboratory/real-time-earth-quake-information.html +0 -50
- package/docs/laboratory/x3d-visual-blend-mode-editor.html +0 -228
- package/meta/logo/icon.svg +0 -432
- package/meta/logo/logo.png +0 -0
- package/meta/logo/logo.s.svg +0 -470
- package/meta/logo/logo.svg +0 -396
- package/src/LICENSE.txt +0 -46
- package/src/assets/components/Annotation.js +0 -74
- package/src/assets/components/CADGeometry.js +0 -74
- package/src/assets/components/CubeMapTexturing.js +0 -68
- package/src/assets/components/DIS.js +0 -72
- package/src/assets/components/EventUtilities.js +0 -78
- package/src/assets/components/Geometry2D.js +0 -78
- package/src/assets/components/Geospatial.js +0 -84
- package/src/assets/components/HAnim.js +0 -72
- package/src/assets/components/KeyDeviceSensor.js +0 -68
- package/src/assets/components/Layout.js +0 -74
- package/src/assets/components/NURBS.js +0 -94
- package/src/assets/components/ParticleSystems.js +0 -86
- package/src/assets/components/Picking.js +0 -74
- package/src/assets/components/RigidBodyPhysics.js +0 -94
- package/src/assets/components/Scripting.js +0 -64
- package/src/assets/components/Text.js +0 -68
- package/src/assets/components/TextureProjector.js +0 -66
- package/src/assets/components/Texturing3D.js +0 -78
- package/src/assets/components/VolumeRendering.js +0 -94
- package/src/assets/components/X_ITE.js +0 -62
- package/src/assets/fonts/DroidSerif-Bold.ttf +0 -0
- package/src/assets/fonts/DroidSerif-BoldItalic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Italic.ttf +0 -0
- package/src/assets/fonts/DroidSerif-Regular.ttf +0 -0
- package/src/assets/fonts/Ubuntu-B.ttf +0 -0
- package/src/assets/fonts/Ubuntu-BI.ttf +0 -0
- package/src/assets/fonts/Ubuntu-R.ttf +0 -0
- package/src/assets/fonts/Ubuntu-RI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-B.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-BI.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-R.ttf +0 -0
- package/src/assets/fonts/UbuntuMono-RI.ttf +0 -0
- package/src/assets/hatching/1.png +0 -0
- package/src/assets/hatching/10.png +0 -0
- package/src/assets/hatching/11.png +0 -0
- package/src/assets/hatching/12.png +0 -0
- package/src/assets/hatching/13.png +0 -0
- package/src/assets/hatching/14.png +0 -0
- package/src/assets/hatching/15.png +0 -0
- package/src/assets/hatching/16.png +0 -0
- package/src/assets/hatching/17.png +0 -0
- package/src/assets/hatching/18.png +0 -0
- package/src/assets/hatching/19.png +0 -0
- package/src/assets/hatching/2.png +0 -0
- package/src/assets/hatching/3.png +0 -0
- package/src/assets/hatching/4.png +0 -0
- package/src/assets/hatching/5.png +0 -0
- package/src/assets/hatching/6.png +0 -0
- package/src/assets/hatching/7.png +0 -0
- package/src/assets/hatching/8.png +0 -0
- package/src/assets/hatching/9.png +0 -0
- package/src/assets/images/ExamineViewer.png +0 -0
- package/src/assets/images/FlyViewer.png +0 -0
- package/src/assets/images/NoneViewer.png +0 -0
- package/src/assets/images/PlaneViewer.png +0 -0
- package/src/assets/images/PrimitiveQuality.png +0 -0
- package/src/assets/images/Shading.png +0 -0
- package/src/assets/images/TextureQuality.png +0 -0
- package/src/assets/images/Time.png +0 -0
- package/src/assets/images/Viewpoint.png +0 -0
- package/src/assets/images/WalkViewer.png +0 -0
- package/src/assets/images/go-next.png +0 -0
- package/src/assets/images/gtk-fullscreen.png +0 -0
- package/src/assets/images/gtk-leave-fullscreen.png +0 -0
- package/src/assets/images/gtk-zoom-fit.png +0 -0
- package/src/assets/images/gtk-zoom-in.png +0 -0
- package/src/assets/images/help-about.png +0 -0
- package/src/assets/images/icon.bw.png +0 -0
- package/src/assets/images/icon.png +0 -0
- package/src/assets/images/logo.128.png +0 -0
- package/src/assets/images/logo.bw.png +0 -0
- package/src/assets/images/logo.png +0 -0
- package/src/assets/lib/draco_decoder_gltf.js +0 -29
- package/src/assets/linetype/linetypes.png +0 -0
- package/src/assets/shaders/Types.glsl.js +0 -312
- package/src/assets/shaders/webgl1/Default.vs.js +0 -14
- package/src/assets/shaders/webgl1/Depth.fs.js +0 -25
- package/src/assets/shaders/webgl1/Depth.vs.js +0 -31
- package/src/assets/shaders/webgl1/Gouraud.fs.js +0 -40
- package/src/assets/shaders/webgl1/Gouraud.vs.js +0 -58
- package/src/assets/shaders/webgl1/PBR.fs.js +0 -366
- package/src/assets/shaders/webgl1/Phong.fs.js +0 -211
- package/src/assets/shaders/webgl1/Pointing.fs.js +0 -40
- package/src/assets/shaders/webgl1/Pointing.vs.js +0 -46
- package/src/assets/shaders/webgl1/Unlit.fs.js +0 -55
- package/src/assets/shaders/webgl1/include/ClipPlanes.glsl.js +0 -17
- package/src/assets/shaders/webgl1/include/Colors.glsl.js +0 -27
- package/src/assets/shaders/webgl1/include/Fog.glsl.js +0 -32
- package/src/assets/shaders/webgl1/include/Fragment.glsl.js +0 -137
- package/src/assets/shaders/webgl1/include/Hatch.glsl.js +0 -22
- package/src/assets/shaders/webgl1/include/Material.glsl.js +0 -59
- package/src/assets/shaders/webgl1/include/Normal.glsl.js +0 -48
- package/src/assets/shaders/webgl1/include/Perlin.glsl.js +0 -41
- package/src/assets/shaders/webgl1/include/Point.glsl.js +0 -47
- package/src/assets/shaders/webgl1/include/PointSize.glsl.js +0 -31
- package/src/assets/shaders/webgl1/include/Shadow.glsl.js +0 -314
- package/src/assets/shaders/webgl1/include/SpotFactor.glsl.js +0 -14
- package/src/assets/shaders/webgl1/include/Texture.glsl.js +0 -532
- package/src/assets/shaders/webgl1/include/Vertex.glsl.js +0 -154
- package/src/assets/shaders/webgl2/Compose.fs.js +0 -29
- package/src/assets/shaders/webgl2/Compose.vs.js +0 -14
- package/src/assets/shaders/webgl2/Default.vs.js +0 -16
- package/src/assets/shaders/webgl2/Depth.fs.js +0 -28
- package/src/assets/shaders/webgl2/Depth.vs.js +0 -37
- package/src/assets/shaders/webgl2/Gouraud.fs.js +0 -42
- package/src/assets/shaders/webgl2/Gouraud.vs.js +0 -60
- package/src/assets/shaders/webgl2/LineTransform.fs.js +0 -7
- package/src/assets/shaders/webgl2/LineTransform.vs.js +0 -90
- package/src/assets/shaders/webgl2/PBR.fs.js +0 -373
- package/src/assets/shaders/webgl2/Phong.fs.js +0 -225
- package/src/assets/shaders/webgl2/Pointing.fs.js +0 -49
- package/src/assets/shaders/webgl2/Pointing.vs.js +0 -68
- package/src/assets/shaders/webgl2/Unlit.fs.js +0 -60
- package/src/assets/shaders/webgl2/include/ClipPlanes.glsl.js +0 -17
- package/src/assets/shaders/webgl2/include/Colors.glsl.js +0 -27
- package/src/assets/shaders/webgl2/include/Fog.glsl.js +0 -32
- package/src/assets/shaders/webgl2/include/Fragment.glsl.js +0 -162
- package/src/assets/shaders/webgl2/include/Hatch.glsl.js +0 -22
- package/src/assets/shaders/webgl2/include/Line2.glsl.js +0 -22
- package/src/assets/shaders/webgl2/include/Material.glsl.js +0 -59
- package/src/assets/shaders/webgl2/include/Normal.glsl.js +0 -50
- package/src/assets/shaders/webgl2/include/Particle.glsl.js +0 -34
- package/src/assets/shaders/webgl2/include/Perlin.glsl.js +0 -41
- package/src/assets/shaders/webgl2/include/Point.glsl.js +0 -47
- package/src/assets/shaders/webgl2/include/PointSize.glsl.js +0 -31
- package/src/assets/shaders/webgl2/include/Shadow.glsl.js +0 -328
- package/src/assets/shaders/webgl2/include/Skin.glsl.js +0 -88
- package/src/assets/shaders/webgl2/include/SpotFactor.glsl.js +0 -14
- package/src/assets/shaders/webgl2/include/Stipple.glsl.js +0 -43
- package/src/assets/shaders/webgl2/include/Texture.glsl.js +0 -527
- package/src/assets/shaders/webgl2/include/Utils.glsl.js +0 -13
- package/src/assets/shaders/webgl2/include/Vertex.glsl.js +0 -180
- package/src/bookmarks.js +0 -297
- package/src/example.html +0 -21
- package/src/examples.js +0 -156
- package/src/lib/ammojs/AmmoClass.js +0 -50
- package/src/lib/ammojs/Makefile +0 -25
- package/src/lib/ammojs/ammo.idl +0 -1031
- package/src/lib/ammojs/ammo.js +0 -35
- package/src/lib/jquery.js +0 -66
- package/src/lib/libgif/libgif.js +0 -1004
- package/src/lib/libtess.js +0 -1
- package/src/lib/nurbs/extras/sample.js +0 -233
- package/src/lib/nurbs/nurbs.js +0 -325
- package/src/lib/nurbs/src/evaluate.js +0 -402
- package/src/lib/nurbs/src/numerical-derivative.js +0 -49
- package/src/lib/nurbs/src/support.js +0 -140
- package/src/lib/nurbs/src/transform.js +0 -70
- package/src/lib/nurbs/src/utils/accessor-preamble.js +0 -27
- package/src/lib/nurbs/src/utils/bisection-search.js +0 -22
- package/src/lib/nurbs/src/utils/cache-key.js +0 -50
- package/src/lib/nurbs/src/utils/create-accessors.js +0 -103
- package/src/lib/nurbs/src/utils/infer-type.js +0 -44
- package/src/lib/nurbs/src/utils/is-array-like.js +0 -5
- package/src/lib/nurbs/src/utils/is-ndarray-like.js +0 -13
- package/src/lib/nurbs/src/utils/is-ndarray.js +0 -16
- package/src/lib/nurbs/src/utils/ndloop.js +0 -18
- package/src/lib/nurbs/src/utils/size-getter.js +0 -16
- package/src/lib/nurbs/src/utils/variable.js +0 -26
- package/src/locale/de.po.js +0 -182
- package/src/locale/fr.po.js +0 -179
- package/src/locale/gettext.js +0 -120
- package/src/shim.js +0 -81
- package/src/standard/Geospatial/Geodetic.js +0 -257
- package/src/standard/Geospatial/ReferenceEllipsoids.js +0 -92
- package/src/standard/Geospatial/UniversalTransverseMercator.js +0 -205
- package/src/standard/Math/Algorithm.js +0 -237
- package/src/standard/Math/Algorithms/Bezier.js +0 -232
- package/src/standard/Math/Algorithms/MergeSort.js +0 -104
- package/src/standard/Math/Algorithms/PartialSort.js +0 -92
- package/src/standard/Math/Algorithms/QuickSort.js +0 -106
- package/src/standard/Math/Algorithms/SAT.js +0 -109
- package/src/standard/Math/Algorithms/eigen_decomposition.js +0 -190
- package/src/standard/Math/Geometry/Box2.js +0 -257
- package/src/standard/Math/Geometry/Box3.js +0 -665
- package/src/standard/Math/Geometry/Camera.js +0 -127
- package/src/standard/Math/Geometry/Cylinder3.js +0 -159
- package/src/standard/Math/Geometry/Line2.js +0 -155
- package/src/standard/Math/Geometry/Line3.js +0 -235
- package/src/standard/Math/Geometry/Plane3.js +0 -163
- package/src/standard/Math/Geometry/Sphere3.js +0 -191
- package/src/standard/Math/Geometry/Spheroid3.js +0 -86
- package/src/standard/Math/Geometry/Triangle2.js +0 -78
- package/src/standard/Math/Geometry/Triangle3.js +0 -140
- package/src/standard/Math/Geometry/ViewVolume.js +0 -422
- package/src/standard/Math/Numbers/Color3.js +0 -258
- package/src/standard/Math/Numbers/Color4.js +0 -188
- package/src/standard/Math/Numbers/Complex.js +0 -246
- package/src/standard/Math/Numbers/Matrix2.js +0 -274
- package/src/standard/Math/Numbers/Matrix3.js +0 -673
- package/src/standard/Math/Numbers/Matrix4.js +0 -794
- package/src/standard/Math/Numbers/Quaternion.js +0 -665
- package/src/standard/Math/Numbers/Rotation4.js +0 -478
- package/src/standard/Math/Numbers/Vector2.js +0 -238
- package/src/standard/Math/Numbers/Vector3.js +0 -292
- package/src/standard/Math/Numbers/Vector4.js +0 -307
- package/src/standard/Math/Utility/BVH.js +0 -378
- package/src/standard/Math/Utility/MatrixStack.js +0 -114
- package/src/standard/Time/StopWatch.js +0 -84
- package/src/standard/Utility/BitSet.js +0 -117
- package/src/standard/Utility/DataStorage.js +0 -132
- package/src/standard/Utility/MapUtilities.js +0 -83
- package/src/standard/Utility/ObjectCache.js +0 -72
- package/src/standard/Utility/Shuffle.js +0 -66
- package/src/tests.js +0 -399
- package/src/x_ite/Base/Events.js +0 -73
- package/src/x_ite/Base/FieldArray.js +0 -70
- package/src/x_ite/Base/FieldDefinitionArray.js +0 -70
- package/src/x_ite/Base/X3DArrayField.js +0 -138
- package/src/x_ite/Base/X3DBaseNode.js +0 -639
- package/src/x_ite/Base/X3DCast.js +0 -75
- package/src/x_ite/Base/X3DChildObject.js +0 -265
- package/src/x_ite/Base/X3DConstants.js +0 -146
- package/src/x_ite/Base/X3DField.js +0 -429
- package/src/x_ite/Base/X3DFieldDefinition.js +0 -75
- package/src/x_ite/Base/X3DInfoArray.js +0 -381
- package/src/x_ite/Base/X3DObject.js +0 -254
- package/src/x_ite/Base/X3DObjectArrayField.js +0 -541
- package/src/x_ite/Base/X3DTypedArrayField.js +0 -1018
- package/src/x_ite/Browser/Core/BrowserOptions.js +0 -388
- package/src/x_ite/Browser/Core/BrowserProperties.js +0 -84
- package/src/x_ite/Browser/Core/BrowserTimings.js +0 -300
- package/src/x_ite/Browser/Core/Context.js +0 -278
- package/src/x_ite/Browser/Core/ContextMenu.js +0 -718
- package/src/x_ite/Browser/Core/Notification.js +0 -117
- package/src/x_ite/Browser/Core/PrimitiveQuality.js +0 -57
- package/src/x_ite/Browser/Core/RenderingProperties.js +0 -104
- package/src/x_ite/Browser/Core/Shading.js +0 -59
- package/src/x_ite/Browser/Core/TextureQuality.js +0 -57
- package/src/x_ite/Browser/Core/X3DCoreContext.js +0 -758
- package/src/x_ite/Browser/DOMIntegration.js +0 -383
- package/src/x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext.js +0 -76
- package/src/x_ite/Browser/Followers/X3DArrayChaserTemplate.js +0 -78
- package/src/x_ite/Browser/Followers/X3DArrayFollowerTemplate.js +0 -176
- package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +0 -70
- package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +0 -70
- package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +0 -106
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +0 -159
- package/src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js +0 -112
- package/src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js +0 -134
- package/src/x_ite/Browser/Geometry3D/BoxOptions.js +0 -123
- package/src/x_ite/Browser/Geometry3D/ConeOptions.js +0 -71
- package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +0 -71
- package/src/x_ite/Browser/Geometry3D/IcoSphere.js +0 -404
- package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +0 -115
- package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +0 -287
- package/src/x_ite/Browser/Geometry3D/X3DGeometry3DContext.js +0 -128
- package/src/x_ite/Browser/Geospatial/Geocentric.js +0 -75
- package/src/x_ite/Browser/Geospatial/Geospatial.js +0 -205
- package/src/x_ite/Browser/Grouping/X3DGroupingContext.js +0 -84
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator.js +0 -186
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1.js +0 -87
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2.js +0 -53
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3.js +0 -53
- package/src/x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate.js +0 -107
- package/src/x_ite/Browser/Interpolation/SquatInterpolator.js +0 -112
- package/src/x_ite/Browser/KeyDeviceSensor/X3DKeyDeviceSensorContext.js +0 -97
- package/src/x_ite/Browser/Layering/X3DLayeringContext.js +0 -70
- package/src/x_ite/Browser/Layout/ScreenText.js +0 -412
- package/src/x_ite/Browser/Layout/X3DLayoutContext.js +0 -131
- package/src/x_ite/Browser/Legacy.js +0 -84
- package/src/x_ite/Browser/Lighting/X3DLightingContext.js +0 -105
- package/src/x_ite/Browser/NURBS/NURBS.js +0 -471
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +0 -866
- package/src/x_ite/Browser/Navigation/FlyViewer.js +0 -99
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +0 -519
- package/src/x_ite/Browser/Navigation/NoneViewer.js +0 -77
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +0 -243
- package/src/x_ite/Browser/Navigation/WalkViewer.js +0 -130
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +0 -727
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +0 -240
- package/src/x_ite/Browser/Navigation/X3DViewer.js +0 -204
- package/src/x_ite/Browser/Networking/URLs.js +0 -103
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +0 -227
- package/src/x_ite/Browser/ParticleSystems/BVH.glsl.js +0 -185
- package/src/x_ite/Browser/ParticleSystems/Box3.glsl.js +0 -49
- package/src/x_ite/Browser/ParticleSystems/GeometryTypes.js +0 -59
- package/src/x_ite/Browser/ParticleSystems/Line3.glsl.js +0 -57
- package/src/x_ite/Browser/ParticleSystems/Plane3.glsl.js +0 -162
- package/src/x_ite/Browser/ParticleSystems/X3DParticleSystemsContext.js +0 -72
- package/src/x_ite/Browser/Picking/IntersectionType.js +0 -56
- package/src/x_ite/Browser/Picking/MatchCriterion.js +0 -57
- package/src/x_ite/Browser/Picking/SortOrder.js +0 -58
- package/src/x_ite/Browser/Picking/VolumePicker.js +0 -177
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +0 -132
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +0 -279
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer.js +0 -85
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +0 -395
- package/src/x_ite/Browser/Rendering/GeometryContext.js +0 -83
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +0 -270
- package/src/x_ite/Browser/RigidBodyPhysics/AppliedParametersType.js +0 -63
- package/src/x_ite/Browser/Scripting/X3DScriptingContext.js +0 -67
- package/src/x_ite/Browser/Scripting/evaluate.js +0 -68
- package/src/x_ite/Browser/Shaders/ShaderCompiler.js +0 -97
- package/src/x_ite/Browser/Shaders/ShaderSource.js +0 -204
- package/src/x_ite/Browser/Shaders/Shaders.js +0 -191
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +0 -190
- package/src/x_ite/Browser/Shape/AlphaMode.js +0 -58
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +0 -209
- package/src/x_ite/Browser/Sound/X3DSoundContext.js +0 -57
- package/src/x_ite/Browser/Text/PolygonText.js +0 -360
- package/src/x_ite/Browser/Text/TextAlignment.js +0 -58
- package/src/x_ite/Browser/Text/X3DTextContext.js +0 -134
- package/src/x_ite/Browser/Text/X3DTextGeometry.js +0 -614
- package/src/x_ite/Browser/Texturing/FunctionType.js +0 -57
- package/src/x_ite/Browser/Texturing/GifMedia.js +0 -113
- package/src/x_ite/Browser/Texturing/ModeType.js +0 -74
- package/src/x_ite/Browser/Texturing/SourceType.js +0 -58
- package/src/x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType.js +0 -66
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +0 -340
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +0 -1097
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +0 -458
- package/src/x_ite/Browser/Time/X3DTimeContext.js +0 -108
- package/src/x_ite/Browser/VERSION.js +0 -48
- package/src/x_ite/Browser/VolumeRendering/VolumeMaterial.js +0 -145
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.fs.js +0 -60
- package/src/x_ite/Browser/VolumeRendering/VolumeStyle.vs.js +0 -26
- package/src/x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext.js +0 -131
- package/src/x_ite/Browser/X3DBrowser.js +0 -1060
- package/src/x_ite/Browser/X3DBrowserContext.js +0 -436
- package/src/x_ite/Components/Annotation/AnnotationLayer.js +0 -109
- package/src/x_ite/Components/Annotation/AnnotationTarget.js +0 -104
- package/src/x_ite/Components/Annotation/GroupAnnotation.js +0 -119
- package/src/x_ite/Components/Annotation/IconAnnotation.js +0 -117
- package/src/x_ite/Components/Annotation/TextAnnotation.js +0 -105
- package/src/x_ite/Components/Annotation/URLAnnotation.js +0 -104
- package/src/x_ite/Components/Annotation/X3DAnnotationNode.js +0 -80
- package/src/x_ite/Components/CADGeometry/CADAssembly.js +0 -107
- package/src/x_ite/Components/CADGeometry/CADFace.js +0 -252
- package/src/x_ite/Components/CADGeometry/CADLayer.js +0 -102
- package/src/x_ite/Components/CADGeometry/CADPart.js +0 -112
- package/src/x_ite/Components/CADGeometry/IndexedQuadSet.js +0 -132
- package/src/x_ite/Components/CADGeometry/QuadSet.js +0 -127
- package/src/x_ite/Components/CADGeometry/X3DProductStructureChildNode.js +0 -74
- package/src/x_ite/Components/Core/MetadataBoolean.js +0 -119
- package/src/x_ite/Components/Core/MetadataDouble.js +0 -119
- package/src/x_ite/Components/Core/MetadataFloat.js +0 -119
- package/src/x_ite/Components/Core/MetadataInteger.js +0 -119
- package/src/x_ite/Components/Core/MetadataSet.js +0 -119
- package/src/x_ite/Components/Core/MetadataString.js +0 -119
- package/src/x_ite/Components/Core/WorldInfo.js +0 -110
- package/src/x_ite/Components/Core/X3DBindableNode.js +0 -108
- package/src/x_ite/Components/Core/X3DChildNode.js +0 -101
- package/src/x_ite/Components/Core/X3DInfoNode.js +0 -74
- package/src/x_ite/Components/Core/X3DMetadataObject.js +0 -75
- package/src/x_ite/Components/Core/X3DNode.js +0 -1393
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +0 -1012
- package/src/x_ite/Components/Core/X3DSensorNode.js +0 -74
- package/src/x_ite/Components/Core.js +0 -85
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +0 -250
- package/src/x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture.js +0 -295
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +0 -278
- package/src/x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode.js +0 -141
- package/src/x_ite/Components/DIS/DISEntityManager.js +0 -104
- package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +0 -120
- package/src/x_ite/Components/DIS/EspduTransform.js +0 -194
- package/src/x_ite/Components/DIS/ReceiverPdu.js +0 -139
- package/src/x_ite/Components/DIS/SignalPdu.js +0 -139
- package/src/x_ite/Components/DIS/TransmitterPdu.js +0 -155
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +0 -159
- package/src/x_ite/Components/EnvironmentalEffects/Fog.js +0 -132
- package/src/x_ite/Components/EnvironmentalEffects/FogCoordinate.js +0 -153
- package/src/x_ite/Components/EnvironmentalEffects/LocalFog.js +0 -129
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +0 -133
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +0 -613
- package/src/x_ite/Components/EnvironmentalEffects/X3DFogObject.js +0 -176
- package/src/x_ite/Components/EnvironmentalEffects.js +0 -71
- package/src/x_ite/Components/EnvironmentalSensor/ProximitySensor.js +0 -280
- package/src/x_ite/Components/EnvironmentalSensor/TransformSensor.js +0 -319
- package/src/x_ite/Components/EnvironmentalSensor/VisibilitySensor.js +0 -177
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +0 -143
- package/src/x_ite/Components/EnvironmentalSensor.js +0 -65
- package/src/x_ite/Components/EventUtilities/BooleanFilter.js +0 -118
- package/src/x_ite/Components/EventUtilities/BooleanSequencer.js +0 -116
- package/src/x_ite/Components/EventUtilities/BooleanToggle.js +0 -109
- package/src/x_ite/Components/EventUtilities/BooleanTrigger.js +0 -108
- package/src/x_ite/Components/EventUtilities/IntegerSequencer.js +0 -116
- package/src/x_ite/Components/EventUtilities/IntegerTrigger.js +0 -109
- package/src/x_ite/Components/EventUtilities/TimeTrigger.js +0 -108
- package/src/x_ite/Components/EventUtilities/X3DSequencerNode.js +0 -153
- package/src/x_ite/Components/EventUtilities/X3DTriggerNode.js +0 -74
- package/src/x_ite/Components/Followers/ColorChaser.js +0 -147
- package/src/x_ite/Components/Followers/ColorDamper.js +0 -145
- package/src/x_ite/Components/Followers/CoordinateChaser.js +0 -113
- package/src/x_ite/Components/Followers/CoordinateDamper.js +0 -115
- package/src/x_ite/Components/Followers/OrientationChaser.js +0 -134
- package/src/x_ite/Components/Followers/OrientationDamper.js +0 -130
- package/src/x_ite/Components/Followers/PositionChaser.js +0 -108
- package/src/x_ite/Components/Followers/PositionChaser2D.js +0 -108
- package/src/x_ite/Components/Followers/PositionDamper.js +0 -110
- package/src/x_ite/Components/Followers/PositionDamper2D.js +0 -110
- package/src/x_ite/Components/Followers/ScalarChaser.js +0 -136
- package/src/x_ite/Components/Followers/ScalarDamper.js +0 -126
- package/src/x_ite/Components/Followers/TexCoordChaser2D.js +0 -113
- package/src/x_ite/Components/Followers/TexCoordDamper2D.js +0 -115
- package/src/x_ite/Components/Followers/X3DChaserNode.js +0 -241
- package/src/x_ite/Components/Followers/X3DDamperNode.js +0 -176
- package/src/x_ite/Components/Followers/X3DFollowerNode.js +0 -151
- package/src/x_ite/Components/Followers.js +0 -91
- package/src/x_ite/Components/Geometry2D/Arc2D.js +0 -162
- package/src/x_ite/Components/Geometry2D/ArcClose2D.js +0 -227
- package/src/x_ite/Components/Geometry2D/Circle2D.js +0 -130
- package/src/x_ite/Components/Geometry2D/Disk2D.js +0 -257
- package/src/x_ite/Components/Geometry2D/Polyline2D.js +0 -111
- package/src/x_ite/Components/Geometry2D/Polypoint2D.js +0 -110
- package/src/x_ite/Components/Geometry2D/Rectangle2D.js +0 -148
- package/src/x_ite/Components/Geometry2D/TriangleSet2D.js +0 -142
- package/src/x_ite/Components/Geometry3D/Box.js +0 -146
- package/src/x_ite/Components/Geometry3D/Cone.js +0 -248
- package/src/x_ite/Components/Geometry3D/Cylinder.js +0 -309
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +0 -439
- package/src/x_ite/Components/Geometry3D/Extrusion.js +0 -729
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +0 -473
- package/src/x_ite/Components/Geometry3D/Sphere.js +0 -146
- package/src/x_ite/Components/Geometry3D.js +0 -71
- package/src/x_ite/Components/Geospatial/GeoCoordinate.js +0 -238
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +0 -433
- package/src/x_ite/Components/Geospatial/GeoLOD.js +0 -466
- package/src/x_ite/Components/Geospatial/GeoLocation.js +0 -130
- package/src/x_ite/Components/Geospatial/GeoMetadata.js +0 -117
- package/src/x_ite/Components/Geospatial/GeoOrigin.js +0 -118
- package/src/x_ite/Components/Geospatial/GeoPositionInterpolator.js +0 -156
- package/src/x_ite/Components/Geospatial/GeoProximitySensor.js +0 -163
- package/src/x_ite/Components/Geospatial/GeoTouchSensor.js +0 -135
- package/src/x_ite/Components/Geospatial/GeoTransform.js +0 -145
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +0 -290
- package/src/x_ite/Components/Geospatial/X3DGeospatialObject.js +0 -272
- package/src/x_ite/Components/Grouping/Group.js +0 -101
- package/src/x_ite/Components/Grouping/StaticGroup.js +0 -244
- package/src/x_ite/Components/Grouping/Switch.js +0 -257
- package/src/x_ite/Components/Grouping/Transform.js +0 -106
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +0 -150
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +0 -722
- package/src/x_ite/Components/Grouping/X3DTransformMatrix3DNode.js +0 -135
- package/src/x_ite/Components/Grouping/X3DTransformNode.js +0 -95
- package/src/x_ite/Components/Grouping.js +0 -73
- package/src/x_ite/Components/HAnim/HAnimDisplacer.js +0 -101
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +0 -640
- package/src/x_ite/Components/HAnim/HAnimJoint.js +0 -198
- package/src/x_ite/Components/HAnim/HAnimMotion.js +0 -434
- package/src/x_ite/Components/HAnim/HAnimSegment.js +0 -110
- package/src/x_ite/Components/HAnim/HAnimSite.js +0 -108
- package/src/x_ite/Components/Interpolation/ColorInterpolator.js +0 -132
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator.js +0 -132
- package/src/x_ite/Components/Interpolation/CoordinateInterpolator2D.js +0 -129
- package/src/x_ite/Components/Interpolation/EaseInEaseOut.js +0 -149
- package/src/x_ite/Components/Interpolation/NormalInterpolator.js +0 -158
- package/src/x_ite/Components/Interpolation/OrientationInterpolator.js +0 -134
- package/src/x_ite/Components/Interpolation/PositionInterpolator.js +0 -125
- package/src/x_ite/Components/Interpolation/PositionInterpolator2D.js +0 -125
- package/src/x_ite/Components/Interpolation/ScalarInterpolator.js +0 -120
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator.js +0 -147
- package/src/x_ite/Components/Interpolation/SplinePositionInterpolator2D.js +0 -147
- package/src/x_ite/Components/Interpolation/SplineScalarInterpolator.js +0 -147
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +0 -137
- package/src/x_ite/Components/Interpolation/X3DInterpolatorNode.js +0 -137
- package/src/x_ite/Components/Interpolation.js +0 -85
- package/src/x_ite/Components/KeyDeviceSensor/KeySensor.js +0 -379
- package/src/x_ite/Components/KeyDeviceSensor/StringSensor.js +0 -164
- package/src/x_ite/Components/KeyDeviceSensor/X3DKeyDeviceSensorNode.js +0 -120
- package/src/x_ite/Components/Layering/Layer.js +0 -120
- package/src/x_ite/Components/Layering/LayerSet.js +0 -208
- package/src/x_ite/Components/Layering/Viewport.js +0 -180
- package/src/x_ite/Components/Layering/X3DLayerNode.js +0 -407
- package/src/x_ite/Components/Layering/X3DViewportNode.js +0 -74
- package/src/x_ite/Components/Layering.js +0 -67
- package/src/x_ite/Components/Layout/Layout.js +0 -642
- package/src/x_ite/Components/Layout/LayoutGroup.js +0 -188
- package/src/x_ite/Components/Layout/LayoutLayer.js +0 -124
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +0 -120
- package/src/x_ite/Components/Layout/ScreenGroup.js +0 -138
- package/src/x_ite/Components/Layout/X3DLayoutNode.js +0 -74
- package/src/x_ite/Components/Lighting/DirectionalLight.js +0 -291
- package/src/x_ite/Components/Lighting/EnvironmentLight.js +0 -157
- package/src/x_ite/Components/Lighting/PointLight.js +0 -341
- package/src/x_ite/Components/Lighting/SpotLight.js +0 -360
- package/src/x_ite/Components/Lighting/X3DLightNode.js +0 -222
- package/src/x_ite/Components/Lighting.js +0 -67
- package/src/x_ite/Components/NURBS/Contour2D.js +0 -170
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +0 -165
- package/src/x_ite/Components/NURBS/CoordinateDouble.js +0 -95
- package/src/x_ite/Components/NURBS/NurbsCurve.js +0 -234
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +0 -212
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +0 -229
- package/src/x_ite/Components/NURBS/NurbsPatchSurface.js +0 -108
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +0 -217
- package/src/x_ite/Components/NURBS/NurbsSet.js +0 -186
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +0 -189
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +0 -181
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +0 -181
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +0 -156
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +0 -177
- package/src/x_ite/Components/NURBS/X3DNurbsControlCurveNode.js +0 -74
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +0 -393
- package/src/x_ite/Components/NURBS/X3DParametricGeometryNode.js +0 -81
- package/src/x_ite/Components/Navigation/Billboard.js +0 -188
- package/src/x_ite/Components/Navigation/Collision.js +0 -184
- package/src/x_ite/Components/Navigation/LOD.js +0 -335
- package/src/x_ite/Components/Navigation/NavigationInfo.js +0 -344
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +0 -356
- package/src/x_ite/Components/Navigation/Viewpoint.js +0 -200
- package/src/x_ite/Components/Navigation/ViewpointGroup.js +0 -257
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +0 -594
- package/src/x_ite/Components/Navigation.js +0 -73
- package/src/x_ite/Components/Networking/Anchor.js +0 -220
- package/src/x_ite/Components/Networking/Inline.js +0 -314
- package/src/x_ite/Components/Networking/LoadSensor.js +0 -265
- package/src/x_ite/Components/Networking/X3DNetworkSensorNode.js +0 -74
- package/src/x_ite/Components/Networking/X3DUrlObject.js +0 -296
- package/src/x_ite/Components/Networking.js +0 -67
- package/src/x_ite/Components/ParticleSystems/BoundedPhysicsModel.js +0 -132
- package/src/x_ite/Components/ParticleSystems/ConeEmitter.js +0 -162
- package/src/x_ite/Components/ParticleSystems/ExplosionEmitter.js +0 -137
- package/src/x_ite/Components/ParticleSystems/ForcePhysicsModel.js +0 -120
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +0 -1081
- package/src/x_ite/Components/ParticleSystems/PointEmitter.js +0 -153
- package/src/x_ite/Components/ParticleSystems/PolylineEmitter.js +0 -244
- package/src/x_ite/Components/ParticleSystems/SurfaceEmitter.js +0 -252
- package/src/x_ite/Components/ParticleSystems/VolumeEmitter.js +0 -289
- package/src/x_ite/Components/ParticleSystems/WindPhysicsModel.js +0 -142
- package/src/x_ite/Components/ParticleSystems/X3DParticleEmitterNode.js +0 -1004
- package/src/x_ite/Components/ParticleSystems/X3DParticlePhysicsModelNode.js +0 -78
- package/src/x_ite/Components/Picking/LinePickSensor.js +0 -339
- package/src/x_ite/Components/Picking/PickableGroup.js +0 -223
- package/src/x_ite/Components/Picking/PointPickSensor.js +0 -350
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +0 -270
- package/src/x_ite/Components/Picking/VolumePickSensor.js +0 -245
- package/src/x_ite/Components/Picking/X3DPickSensorNode.js +0 -441
- package/src/x_ite/Components/Picking/X3DPickableObject.js +0 -95
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +0 -303
- package/src/x_ite/Components/PointingDeviceSensor/PlaneSensor.js +0 -300
- package/src/x_ite/Components/PointingDeviceSensor/SphereSensor.js +0 -220
- package/src/x_ite/Components/PointingDeviceSensor/TouchSensor.js +0 -104
- package/src/x_ite/Components/PointingDeviceSensor/X3DDragSensorNode.js +0 -76
- package/src/x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode.js +0 -132
- package/src/x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode.js +0 -106
- package/src/x_ite/Components/PointingDeviceSensor.js +0 -71
- package/src/x_ite/Components/Rendering/ClipPlane.js +0 -180
- package/src/x_ite/Components/Rendering/Color.js +0 -163
- package/src/x_ite/Components/Rendering/ColorRGBA.js +0 -166
- package/src/x_ite/Components/Rendering/Coordinate.js +0 -97
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +0 -307
- package/src/x_ite/Components/Rendering/IndexedTriangleFanSet.js +0 -165
- package/src/x_ite/Components/Rendering/IndexedTriangleSet.js +0 -122
- package/src/x_ite/Components/Rendering/IndexedTriangleStripSet.js +0 -173
- package/src/x_ite/Components/Rendering/LineSet.js +0 -240
- package/src/x_ite/Components/Rendering/Normal.js +0 -193
- package/src/x_ite/Components/Rendering/PointSet.js +0 -222
- package/src/x_ite/Components/Rendering/TriangleFanSet.js +0 -147
- package/src/x_ite/Components/Rendering/TriangleSet.js +0 -117
- package/src/x_ite/Components/Rendering/TriangleStripSet.js +0 -151
- package/src/x_ite/Components/Rendering/X3DColorNode.js +0 -88
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +0 -363
- package/src/x_ite/Components/Rendering/X3DCoordinateNode.js +0 -193
- package/src/x_ite/Components/Rendering/X3DGeometricPropertyNode.js +0 -74
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +0 -1189
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +0 -489
- package/src/x_ite/Components/Rendering/X3DNormalNode.js +0 -74
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +0 -182
- package/src/x_ite/Components/Rendering.js +0 -99
- package/src/x_ite/Components/RigidBodyPhysics/BallJoint.js +0 -210
- package/src/x_ite/Components/RigidBodyPhysics/CollidableOffset.js +0 -261
- package/src/x_ite/Components/RigidBodyPhysics/CollidableShape.js +0 -497
- package/src/x_ite/Components/RigidBodyPhysics/CollisionCollection.js +0 -214
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +0 -281
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSpace.js +0 -180
- package/src/x_ite/Components/RigidBodyPhysics/Contact.js +0 -118
- package/src/x_ite/Components/RigidBodyPhysics/DoubleAxisHingeJoint.js +0 -292
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +0 -132
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +0 -518
- package/src/x_ite/Components/RigidBodyPhysics/RigidBodyCollection.js +0 -389
- package/src/x_ite/Components/RigidBodyPhysics/SingleAxisHingeJoint.js +0 -251
- package/src/x_ite/Components/RigidBodyPhysics/SliderJoint.js +0 -230
- package/src/x_ite/Components/RigidBodyPhysics/UniversalJoint.js +0 -114
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +0 -167
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollisionSpaceNode.js +0 -89
- package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +0 -221
- package/src/x_ite/Components/Scripting/Script.js +0 -510
- package/src/x_ite/Components/Scripting/X3DScriptNode.js +0 -89
- package/src/x_ite/Components/Shaders/ComposedShader.js +0 -228
- package/src/x_ite/Components/Shaders/FloatVertexAttribute.js +0 -151
- package/src/x_ite/Components/Shaders/Matrix3VertexAttribute.js +0 -142
- package/src/x_ite/Components/Shaders/Matrix4VertexAttribute.js +0 -141
- package/src/x_ite/Components/Shaders/PackagedShader.js +0 -129
- package/src/x_ite/Components/Shaders/ProgramShader.js +0 -99
- package/src/x_ite/Components/Shaders/ShaderPart.js +0 -238
- package/src/x_ite/Components/Shaders/ShaderProgram.js +0 -126
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +0 -1357
- package/src/x_ite/Components/Shaders/X3DShaderNode.js +0 -105
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +0 -89
- package/src/x_ite/Components/Shaders.js +0 -79
- package/src/x_ite/Components/Shape/AcousticProperties.js +0 -100
- package/src/x_ite/Components/Shape/Appearance.js +0 -458
- package/src/x_ite/Components/Shape/FillProperties.js +0 -181
- package/src/x_ite/Components/Shape/LineProperties.js +0 -184
- package/src/x_ite/Components/Shape/Material.js +0 -412
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +0 -308
- package/src/x_ite/Components/Shape/PointProperties.js +0 -169
- package/src/x_ite/Components/Shape/Shape.js +0 -205
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +0 -292
- package/src/x_ite/Components/Shape/UnlitMaterial.js +0 -142
- package/src/x_ite/Components/Shape/X3DAppearanceChildNode.js +0 -74
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +0 -88
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +0 -350
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +0 -212
- package/src/x_ite/Components/Shape/X3DShapeNode.js +0 -211
- package/src/x_ite/Components/Shape.js +0 -87
- package/src/x_ite/Components/Sound/Analyser.js +0 -118
- package/src/x_ite/Components/Sound/AudioClip.js +0 -212
- package/src/x_ite/Components/Sound/AudioDestination.js +0 -107
- package/src/x_ite/Components/Sound/BiquadFilter.js +0 -117
- package/src/x_ite/Components/Sound/BufferAudioSource.js +0 -142
- package/src/x_ite/Components/Sound/ChannelMerger.js +0 -104
- package/src/x_ite/Components/Sound/ChannelSelector.js +0 -105
- package/src/x_ite/Components/Sound/ChannelSplitter.js +0 -105
- package/src/x_ite/Components/Sound/Convolver.js +0 -115
- package/src/x_ite/Components/Sound/Delay.js +0 -115
- package/src/x_ite/Components/Sound/DynamicsCompressor.js +0 -119
- package/src/x_ite/Components/Sound/Gain.js +0 -113
- package/src/x_ite/Components/Sound/ListenerPointSource.js +0 -116
- package/src/x_ite/Components/Sound/MicrophoneSource.js +0 -110
- package/src/x_ite/Components/Sound/OscillatorSource.js +0 -112
- package/src/x_ite/Components/Sound/PeriodicWave.js +0 -99
- package/src/x_ite/Components/Sound/Sound.js +0 -302
- package/src/x_ite/Components/Sound/SpatialSound.js +0 -116
- package/src/x_ite/Components/Sound/StreamAudioDestination.js +0 -107
- package/src/x_ite/Components/Sound/StreamAudioSource.js +0 -110
- package/src/x_ite/Components/Sound/WaveShaper.js +0 -115
- package/src/x_ite/Components/Sound/X3DSoundChannelNode.js +0 -74
- package/src/x_ite/Components/Sound/X3DSoundDestinationNode.js +0 -74
- package/src/x_ite/Components/Sound/X3DSoundNode.js +0 -74
- package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +0 -92
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +0 -227
- package/src/x_ite/Components/Sound.js +0 -109
- package/src/x_ite/Components/Text/FontStyle.js +0 -116
- package/src/x_ite/Components/Text/Text.js +0 -185
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +0 -261
- package/src/x_ite/Components/TextureProjector/TextureProjector.js +0 -213
- package/src/x_ite/Components/TextureProjector/TextureProjectorParallel.js +0 -268
- package/src/x_ite/Components/TextureProjector/X3DTextureProjectorNode.js +0 -224
- package/src/x_ite/Components/Texturing/ImageTexture.js +0 -294
- package/src/x_ite/Components/Texturing/MovieTexture.js +0 -287
- package/src/x_ite/Components/Texturing/MultiTexture.js +0 -345
- package/src/x_ite/Components/Texturing/MultiTextureCoordinate.js +0 -200
- package/src/x_ite/Components/Texturing/MultiTextureTransform.js +0 -154
- package/src/x_ite/Components/Texturing/PixelTexture.js +0 -284
- package/src/x_ite/Components/Texturing/TextureCoordinate.js +0 -179
- package/src/x_ite/Components/Texturing/TextureCoordinateGenerator.js +0 -163
- package/src/x_ite/Components/Texturing/TextureProperties.js +0 -226
- package/src/x_ite/Components/Texturing/TextureTransform.js +0 -162
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +0 -101
- package/src/x_ite/Components/Texturing/X3DSingleTextureNode.js +0 -195
- package/src/x_ite/Components/Texturing/X3DSingleTextureTransformNode.js +0 -99
- package/src/x_ite/Components/Texturing/X3DTexture2DNode.js +0 -172
- package/src/x_ite/Components/Texturing/X3DTextureCoordinateNode.js +0 -74
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +0 -88
- package/src/x_ite/Components/Texturing/X3DTextureTransformNode.js +0 -74
- package/src/x_ite/Components/Texturing.js +0 -91
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +0 -201
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +0 -183
- package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +0 -245
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +0 -221
- package/src/x_ite/Components/Texturing3D/TextureCoordinate3D.js +0 -179
- package/src/x_ite/Components/Texturing3D/TextureCoordinate4D.js +0 -179
- package/src/x_ite/Components/Texturing3D/TextureTransform3D.js +0 -151
- package/src/x_ite/Components/Texturing3D/TextureTransformMatrix3D.js +0 -114
- package/src/x_ite/Components/Texturing3D/X3DTexture3DNode.js +0 -173
- package/src/x_ite/Components/Time/TimeSensor.js +0 -223
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +0 -369
- package/src/x_ite/Components/Time.js +0 -61
- package/src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js +0 -355
- package/src/x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle.js +0 -154
- package/src/x_ite/Components/VolumeRendering/CartoonVolumeStyle.js +0 -311
- package/src/x_ite/Components/VolumeRendering/ComposedVolumeStyle.js +0 -204
- package/src/x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle.js +0 -180
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +0 -367
- package/src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js +0 -179
- package/src/x_ite/Components/VolumeRendering/ProjectionVolumeStyle.js +0 -230
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +0 -280
- package/src/x_ite/Components/VolumeRendering/ShadedVolumeStyle.js +0 -280
- package/src/x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle.js +0 -179
- package/src/x_ite/Components/VolumeRendering/ToneMappedVolumeStyle.js +0 -186
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +0 -214
- package/src/x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode.js +0 -74
- package/src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js +0 -241
- package/src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js +0 -138
- package/src/x_ite/Components/X_ITE/BlendMode.js +0 -206
- package/src/x_ite/Components.js +0 -99
- package/src/x_ite/Configuration/AbstractNodes.js +0 -50
- package/src/x_ite/Configuration/AbstractNodesArray.js +0 -78
- package/src/x_ite/Configuration/ComponentInfo.js +0 -137
- package/src/x_ite/Configuration/ComponentInfoArray.js +0 -76
- package/src/x_ite/Configuration/ConcreteNodes.js +0 -50
- package/src/x_ite/Configuration/ConcreteNodesArray.js +0 -87
- package/src/x_ite/Configuration/ProfileInfo.js +0 -92
- package/src/x_ite/Configuration/ProfileInfoArray.js +0 -77
- package/src/x_ite/Configuration/SupportedComponents.js +0 -307
- package/src/x_ite/Configuration/SupportedProfiles.js +0 -245
- package/src/x_ite/Configuration/UnitInfo.js +0 -158
- package/src/x_ite/Configuration/UnitInfoArray.js +0 -70
- package/src/x_ite/DEVELOPMENT.js +0 -50
- package/src/x_ite/Execution/BindableList.js +0 -203
- package/src/x_ite/Execution/BindableStack.js +0 -163
- package/src/x_ite/Execution/ExportedNodesArray.js +0 -70
- package/src/x_ite/Execution/ImportedNodesArray.js +0 -70
- package/src/x_ite/Execution/NamedNodesArray.js +0 -70
- package/src/x_ite/Execution/NamedNodesHandling.js +0 -84
- package/src/x_ite/Execution/X3DExecutionContext.js +0 -1022
- package/src/x_ite/Execution/X3DExportedNode.js +0 -201
- package/src/x_ite/Execution/X3DImportedNode.js +0 -565
- package/src/x_ite/Execution/X3DScene.js +0 -1112
- package/src/x_ite/Execution/X3DWorld.js +0 -160
- package/src/x_ite/Features.js +0 -59
- package/src/x_ite/Fields/ArrayFields.js +0 -492
- package/src/x_ite/Fields/SFBool.js +0 -104
- package/src/x_ite/Fields/SFColor.js +0 -231
- package/src/x_ite/Fields/SFColorRGBA.js +0 -198
- package/src/x_ite/Fields/SFDouble.js +0 -108
- package/src/x_ite/Fields/SFFloat.js +0 -108
- package/src/x_ite/Fields/SFImage.js +0 -370
- package/src/x_ite/Fields/SFInt32.js +0 -104
- package/src/x_ite/Fields/SFMatrix3.js +0 -140
- package/src/x_ite/Fields/SFMatrix4.js +0 -133
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +0 -191
- package/src/x_ite/Fields/SFNode.js +0 -435
- package/src/x_ite/Fields/SFNodeCache.js +0 -108
- package/src/x_ite/Fields/SFRotation.js +0 -275
- package/src/x_ite/Fields/SFString.js +0 -134
- package/src/x_ite/Fields/SFTime.js +0 -104
- package/src/x_ite/Fields/SFVec2.js +0 -120
- package/src/x_ite/Fields/SFVec3.js +0 -140
- package/src/x_ite/Fields/SFVec4.js +0 -148
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +0 -201
- package/src/x_ite/Fields.js +0 -87
- package/src/x_ite/InputOutput/FileLoader.js +0 -340
- package/src/x_ite/InputOutput/Generator.js +0 -592
- package/src/x_ite/Namespace.js +0 -52
- package/src/x_ite/Parser/Expressions.js +0 -85
- package/src/x_ite/Parser/GLB2Parser.js +0 -146
- package/src/x_ite/Parser/GLTF2Parser.js +0 -2800
- package/src/x_ite/Parser/GoldenGate.js +0 -163
- package/src/x_ite/Parser/HTMLSupport.js +0 -74
- package/src/x_ite/Parser/JSONParser.js +0 -414
- package/src/x_ite/Parser/OBJParser.js +0 -1091
- package/src/x_ite/Parser/PLYAParser.js +0 -615
- package/src/x_ite/Parser/PLYBParser.js +0 -222
- package/src/x_ite/Parser/STLAParser.js +0 -377
- package/src/x_ite/Parser/STLBParser.js +0 -155
- package/src/x_ite/Parser/SVGParser.js +0 -2762
- package/src/x_ite/Parser/VRMLParser.js +0 -2548
- package/src/x_ite/Parser/X3DOptimizer.js +0 -220
- package/src/x_ite/Parser/X3DParser.js +0 -152
- package/src/x_ite/Parser/XMLParser.js +0 -1189
- package/src/x_ite/Prototype/ExternProtoDeclarationArray.js +0 -70
- package/src/x_ite/Prototype/ProtoDeclarationArray.js +0 -70
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +0 -446
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +0 -571
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +0 -112
- package/src/x_ite/Rendering/DependentRenderer.js +0 -132
- package/src/x_ite/Rendering/MultiSampleFrameBuffer.js +0 -394
- package/src/x_ite/Rendering/PointingBuffer.js +0 -189
- package/src/x_ite/Rendering/TextureBuffer.js +0 -231
- package/src/x_ite/Rendering/TraverseType.js +0 -60
- package/src/x_ite/Rendering/VertexArray.js +0 -95
- package/src/x_ite/Rendering/X3DRenderObject.js +0 -1144
- package/src/x_ite/Routing/RouteArray.js +0 -70
- package/src/x_ite/Routing/X3DRoute.js +0 -316
- package/src/x_ite/Routing/X3DRoutingContext.js +0 -116
- package/src/x_ite/X3D.js +0 -250
- package/src/x_ite/X3DCanvasElement.js +0 -126
- package/src/x_ite.css +0 -587
- package/src/x_ite.html +0 -470
- package/src/x_ite.js +0 -60
- package/webpack.config.js +0 -341
- package/x_ite.min.html +0 -451
|
@@ -1,2800 +0,0 @@
|
|
|
1
|
-
/*******************************************************************************
|
|
2
|
-
*
|
|
3
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4
|
-
*
|
|
5
|
-
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022.
|
|
6
|
-
*
|
|
7
|
-
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
|
|
8
|
-
*
|
|
9
|
-
* The copyright notice above does not evidence any actual of intended
|
|
10
|
-
* publication of such source code, and is an unpublished work by create3000.
|
|
11
|
-
* This material contains CONFIDENTIAL INFORMATION that is the property of
|
|
12
|
-
* create3000.
|
|
13
|
-
*
|
|
14
|
-
* No permission is granted to copy, distribute, or create derivative works from
|
|
15
|
-
* the contents of this software, in whole or in part, without the prior written
|
|
16
|
-
* permission of create3000.
|
|
17
|
-
*
|
|
18
|
-
* NON-MILITARY USE ONLY
|
|
19
|
-
*
|
|
20
|
-
* All create3000 software are effectively free software with a non-military use
|
|
21
|
-
* restriction. It is free. Well commented source is provided. You may reuse the
|
|
22
|
-
* source in any way you please with the exception anything that uses it must be
|
|
23
|
-
* marked to indicate is contains 'non-military use only' components.
|
|
24
|
-
*
|
|
25
|
-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
26
|
-
*
|
|
27
|
-
* Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>.
|
|
28
|
-
*
|
|
29
|
-
* This file is part of the X_ITE Project.
|
|
30
|
-
*
|
|
31
|
-
* X_ITE is free software: you can redistribute it and/or modify it under the
|
|
32
|
-
* terms of the GNU General Public License version 3 only, as published by the
|
|
33
|
-
* Free Software Foundation.
|
|
34
|
-
*
|
|
35
|
-
* X_ITE is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
36
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
37
|
-
* A PARTICULAR PURPOSE. See the GNU General Public License version 3 for more
|
|
38
|
-
* details (a copy is included in the LICENSE file that accompanied this code).
|
|
39
|
-
*
|
|
40
|
-
* You should have received a copy of the GNU General Public License version 3
|
|
41
|
-
* along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a
|
|
42
|
-
* copy of the GPLv3 License.
|
|
43
|
-
*
|
|
44
|
-
* For Silvio, Joy and Adi.
|
|
45
|
-
*
|
|
46
|
-
******************************************************************************/
|
|
47
|
-
|
|
48
|
-
import X3DParser from "./X3DParser.js";
|
|
49
|
-
import X3DOptimizer from "./X3DOptimizer.js";
|
|
50
|
-
import URLs from "../Browser/Networking/URLs.js";
|
|
51
|
-
import Algorithm from "../../standard/Math/Algorithm.js";
|
|
52
|
-
import Vector2 from "../../standard/Math/Numbers/Vector2.js";
|
|
53
|
-
import Vector3 from "../../standard/Math/Numbers/Vector3.js";
|
|
54
|
-
import Quaternion from "../../standard/Math/Numbers/Quaternion.js";
|
|
55
|
-
import Rotation4 from "../../standard/Math/Numbers/Rotation4.js";
|
|
56
|
-
import Matrix4 from "../../standard/Math/Numbers/Matrix4.js";
|
|
57
|
-
import Color3 from "../../standard/Math/Numbers/Color3.js";
|
|
58
|
-
import Color4 from "../../standard/Math/Numbers/Color4.js";
|
|
59
|
-
import Box3 from "../../standard/Math/Geometry/Box3.js";
|
|
60
|
-
|
|
61
|
-
// https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html
|
|
62
|
-
// https://github.com/KhronosGroup/glTF-Sample-Models
|
|
63
|
-
|
|
64
|
-
const SAMPLES_PER_SECOND = 30; // in 1/s
|
|
65
|
-
|
|
66
|
-
function GLTF2Parser (scene)
|
|
67
|
-
{
|
|
68
|
-
X3DParser .call (this, scene);
|
|
69
|
-
X3DOptimizer .call (this);
|
|
70
|
-
|
|
71
|
-
// Optimizer
|
|
72
|
-
|
|
73
|
-
this .removeGroups = false;
|
|
74
|
-
this .removeEmptyGroups = true;
|
|
75
|
-
this .combineGroupingNodes = true;
|
|
76
|
-
|
|
77
|
-
// Globals
|
|
78
|
-
|
|
79
|
-
this .extensions = new Set ();
|
|
80
|
-
this .lights = [ ];
|
|
81
|
-
this .usedLights = 0;
|
|
82
|
-
this .buffers = [ ];
|
|
83
|
-
this .bufferViews = [ ];
|
|
84
|
-
this .accessors = [ ];
|
|
85
|
-
this .samplers = [ ];
|
|
86
|
-
this .materials = [ ];
|
|
87
|
-
this .textureTransformNodes = [ ];
|
|
88
|
-
this .meshes = [ ];
|
|
89
|
-
this .cameras = [ ];
|
|
90
|
-
this .viewpoints = 0;
|
|
91
|
-
this .nodes = [ ];
|
|
92
|
-
this .skins = [ ];
|
|
93
|
-
this .joints = new Set ();
|
|
94
|
-
this .animations = 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
Object .assign (Object .setPrototypeOf (GLTF2Parser .prototype, X3DParser .prototype),
|
|
98
|
-
X3DOptimizer .prototype,
|
|
99
|
-
{
|
|
100
|
-
getEncoding ()
|
|
101
|
-
{
|
|
102
|
-
return "JSON";
|
|
103
|
-
},
|
|
104
|
-
setInput (json)
|
|
105
|
-
{
|
|
106
|
-
try
|
|
107
|
-
{
|
|
108
|
-
if (typeof json === "string")
|
|
109
|
-
json = JSON .parse (json);
|
|
110
|
-
|
|
111
|
-
this .input = json;
|
|
112
|
-
}
|
|
113
|
-
catch
|
|
114
|
-
{
|
|
115
|
-
this .input = undefined;
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
isValid: (() =>
|
|
119
|
-
{
|
|
120
|
-
const keys = new Set ([
|
|
121
|
-
"asset",
|
|
122
|
-
"extra",
|
|
123
|
-
"extensions",
|
|
124
|
-
"extensionsRequired",
|
|
125
|
-
"extensionsUsed",
|
|
126
|
-
"buffers",
|
|
127
|
-
"bufferViews",
|
|
128
|
-
"accessors",
|
|
129
|
-
"samplers",
|
|
130
|
-
"images",
|
|
131
|
-
"textures",
|
|
132
|
-
"materials",
|
|
133
|
-
"meshes",
|
|
134
|
-
"cameras",
|
|
135
|
-
"skins",
|
|
136
|
-
"nodes",
|
|
137
|
-
"scenes",
|
|
138
|
-
"scene",
|
|
139
|
-
"animations",
|
|
140
|
-
]);
|
|
141
|
-
|
|
142
|
-
return function ()
|
|
143
|
-
{
|
|
144
|
-
if (!(this .input instanceof Object))
|
|
145
|
-
return false;
|
|
146
|
-
|
|
147
|
-
if (!Object .keys (this .input) .every (key => keys .has (key)))
|
|
148
|
-
return false;
|
|
149
|
-
|
|
150
|
-
const asset = this .input .asset;
|
|
151
|
-
|
|
152
|
-
if (!(asset instanceof Object && asset .version === "2.0"))
|
|
153
|
-
return false;
|
|
154
|
-
|
|
155
|
-
return true;
|
|
156
|
-
};
|
|
157
|
-
})(),
|
|
158
|
-
setBuffers (buffers)
|
|
159
|
-
{
|
|
160
|
-
this .buffers = buffers;
|
|
161
|
-
},
|
|
162
|
-
parseIntoScene (resolve, reject)
|
|
163
|
-
{
|
|
164
|
-
this .rootObject (this .input)
|
|
165
|
-
.then (resolve)
|
|
166
|
-
.catch (reject);
|
|
167
|
-
},
|
|
168
|
-
rootObject: async function (glTF)
|
|
169
|
-
{
|
|
170
|
-
if (!(glTF instanceof Object))
|
|
171
|
-
return;
|
|
172
|
-
|
|
173
|
-
// Set profile and components.
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
browser = this .getBrowser (),
|
|
177
|
-
scene = this .getScene ();
|
|
178
|
-
|
|
179
|
-
scene .setEncoding ("GLTF");
|
|
180
|
-
scene .setProfile (browser .getProfile ("Interchange"));
|
|
181
|
-
|
|
182
|
-
if (glTF .skins)
|
|
183
|
-
scene .addComponent (browser .getComponent ("HAnim"));
|
|
184
|
-
|
|
185
|
-
// Parse root objects.
|
|
186
|
-
|
|
187
|
-
this .assetObject (glTF .asset);
|
|
188
|
-
this .extensionsArray (glTF .extensionsUsed, this .extensions);
|
|
189
|
-
this .extensionsArray (glTF .extensionsRequired, this .extensions);
|
|
190
|
-
this .extensionsObject (glTF .extensions);
|
|
191
|
-
|
|
192
|
-
await this .loadComponents ();
|
|
193
|
-
await this .buffersArray (glTF .buffers);
|
|
194
|
-
|
|
195
|
-
if (this .extensions .has ("KHR_draco_mesh_compression"))
|
|
196
|
-
this .draco = await this .createDraco ();
|
|
197
|
-
|
|
198
|
-
this .bufferViewsArray (glTF .bufferViews);
|
|
199
|
-
this .accessorsArray (glTF .accessors);
|
|
200
|
-
this .samplersArray (glTF .samplers);
|
|
201
|
-
|
|
202
|
-
await this .imagesArray (glTF .images);
|
|
203
|
-
|
|
204
|
-
this .texturesArray (glTF .textures);
|
|
205
|
-
this .materialsArray (glTF .materials);
|
|
206
|
-
this .meshesArray (glTF .meshes);
|
|
207
|
-
this .camerasArray (glTF .cameras);
|
|
208
|
-
this .skinsArray (glTF .skins);
|
|
209
|
-
this .nodesArray (glTF .nodes);
|
|
210
|
-
this .scenesArray (glTF .scenes, glTF .scene);
|
|
211
|
-
this .animationsArray (glTF .animations);
|
|
212
|
-
|
|
213
|
-
try
|
|
214
|
-
{
|
|
215
|
-
this .optimizeSceneGraph (this .getExecutionContext () .getRootNodes ());
|
|
216
|
-
}
|
|
217
|
-
catch (error)
|
|
218
|
-
{
|
|
219
|
-
console .error (error)
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return this .getScene ();
|
|
223
|
-
},
|
|
224
|
-
assetObject (asset)
|
|
225
|
-
{
|
|
226
|
-
if (!(asset instanceof Object))
|
|
227
|
-
return;
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
scene = this .getExecutionContext (),
|
|
231
|
-
worldURL = scene .getWorldURL (),
|
|
232
|
-
worldInfoNode = scene .createNode ("WorldInfo", false);
|
|
233
|
-
|
|
234
|
-
for (const [key, value] of Object .entries (asset))
|
|
235
|
-
{
|
|
236
|
-
if (typeof value !== "string")
|
|
237
|
-
continue;
|
|
238
|
-
|
|
239
|
-
worldInfoNode ._info .push (`${key}: ${value}`);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (asset .extras instanceof Object)
|
|
243
|
-
{
|
|
244
|
-
for (const [key, value] of Object .entries (asset .extras))
|
|
245
|
-
{
|
|
246
|
-
if (typeof value !== "string")
|
|
247
|
-
continue;
|
|
248
|
-
|
|
249
|
-
if (key === "title")
|
|
250
|
-
worldInfoNode ._title = value;
|
|
251
|
-
else
|
|
252
|
-
worldInfoNode ._info .push (`${key}: ${value}`);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
worldInfoNode ._info .sort ();
|
|
257
|
-
|
|
258
|
-
if (!worldInfoNode ._title .getValue ())
|
|
259
|
-
worldInfoNode ._title = decodeURI (new URL (worldURL) .pathname .split ("/") .at (-1) || worldURL);
|
|
260
|
-
|
|
261
|
-
worldInfoNode .setup ();
|
|
262
|
-
|
|
263
|
-
scene .getRootNodes () .push (worldInfoNode);
|
|
264
|
-
},
|
|
265
|
-
extensionsArray (extensions, set)
|
|
266
|
-
{
|
|
267
|
-
if (!(extensions instanceof Array))
|
|
268
|
-
return;
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
browser = this .getBrowser (),
|
|
272
|
-
scene = this .getExecutionContext ();
|
|
273
|
-
|
|
274
|
-
for (const extension of extensions)
|
|
275
|
-
{
|
|
276
|
-
set .add (extension);
|
|
277
|
-
|
|
278
|
-
switch (extension)
|
|
279
|
-
{
|
|
280
|
-
case "KHR_texture_transform":
|
|
281
|
-
scene .addComponent (browser .getComponent ("Texturing3D", 2));
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
extensionsObject (extensions)
|
|
287
|
-
{
|
|
288
|
-
if (!(extensions instanceof Object))
|
|
289
|
-
return;
|
|
290
|
-
|
|
291
|
-
for (const [key, value] of Object .entries (extensions))
|
|
292
|
-
{
|
|
293
|
-
switch (key)
|
|
294
|
-
{
|
|
295
|
-
case "KHR_lights_punctual":
|
|
296
|
-
return this .khrLightsPunctualObject (value);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
khrLightsPunctualObject (khrLightsPunctual)
|
|
301
|
-
{
|
|
302
|
-
if (!(khrLightsPunctual instanceof Object))
|
|
303
|
-
return;
|
|
304
|
-
|
|
305
|
-
this .lightsArray (khrLightsPunctual .lights);
|
|
306
|
-
},
|
|
307
|
-
lightsArray (lights)
|
|
308
|
-
{
|
|
309
|
-
if (!(lights instanceof Array))
|
|
310
|
-
return;
|
|
311
|
-
|
|
312
|
-
this .lights = lights;
|
|
313
|
-
},
|
|
314
|
-
lightObject (light)
|
|
315
|
-
{
|
|
316
|
-
if (!(light instanceof Object))
|
|
317
|
-
return null;
|
|
318
|
-
|
|
319
|
-
const lightNode = this .lightType (light);
|
|
320
|
-
|
|
321
|
-
if (!lightNode)
|
|
322
|
-
return null;
|
|
323
|
-
|
|
324
|
-
const
|
|
325
|
-
scene = this .getExecutionContext (),
|
|
326
|
-
name = this .sanitizeName (light .name);
|
|
327
|
-
|
|
328
|
-
const color = new Color3 (1, 1, 1);
|
|
329
|
-
|
|
330
|
-
if (this .vectorValue (light .color, color))
|
|
331
|
-
lightNode ._color = color;
|
|
332
|
-
|
|
333
|
-
lightNode ._global = true;
|
|
334
|
-
lightNode ._intensity = this .numberValue (light .intensity, 1);
|
|
335
|
-
|
|
336
|
-
lightNode .setup ();
|
|
337
|
-
|
|
338
|
-
if (name)
|
|
339
|
-
{
|
|
340
|
-
scene .addNamedNode (scene .getUniqueName (name), lightNode);
|
|
341
|
-
scene .addExportedNode (scene .getUniqueExportName (name), lightNode);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return lightNode;
|
|
345
|
-
},
|
|
346
|
-
lightType (light)
|
|
347
|
-
{
|
|
348
|
-
switch (light .type)
|
|
349
|
-
{
|
|
350
|
-
case "directional":
|
|
351
|
-
return this .directionalLight (light);
|
|
352
|
-
case "spot":
|
|
353
|
-
return this .spotLight (light);
|
|
354
|
-
case "point":
|
|
355
|
-
return this .pointLight (light);
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
directionalLight (light)
|
|
359
|
-
{
|
|
360
|
-
const
|
|
361
|
-
scene = this .getExecutionContext (),
|
|
362
|
-
lightNode = scene .createNode ("DirectionalLight", false);
|
|
363
|
-
|
|
364
|
-
return lightNode;
|
|
365
|
-
},
|
|
366
|
-
spotLight (light)
|
|
367
|
-
{
|
|
368
|
-
const
|
|
369
|
-
scene = this .getExecutionContext (),
|
|
370
|
-
lightNode = scene .createNode ("SpotLight", false);
|
|
371
|
-
|
|
372
|
-
lightNode ._radius = this .numberValue (light .range, 0) || 1_000_000_000;
|
|
373
|
-
lightNode ._cutOffAngle = this .numberValue (light .outerConeAngle, Math .PI / 4);
|
|
374
|
-
lightNode ._beamWidth = this .numberValue (light .innerConeAngle, 0);
|
|
375
|
-
lightNode ._attenuation = new Vector3 (0, 0, 1);
|
|
376
|
-
|
|
377
|
-
return lightNode;
|
|
378
|
-
},
|
|
379
|
-
pointLight (light)
|
|
380
|
-
{
|
|
381
|
-
const
|
|
382
|
-
scene = this .getExecutionContext (),
|
|
383
|
-
lightNode = scene .createNode ("PointLight", false);
|
|
384
|
-
|
|
385
|
-
lightNode ._radius = this .numberValue (light .range, 0) || 1_000_000_000;
|
|
386
|
-
lightNode ._attenuation = new Vector3 (0, 0, 1);
|
|
387
|
-
|
|
388
|
-
return lightNode;
|
|
389
|
-
},
|
|
390
|
-
buffersArray: async function (buffers)
|
|
391
|
-
{
|
|
392
|
-
if (!(buffers instanceof Array))
|
|
393
|
-
return;
|
|
394
|
-
|
|
395
|
-
this .buffers = await Promise .all (buffers .map ((buffer, i) => this .bufferObject (buffer, i)));
|
|
396
|
-
},
|
|
397
|
-
bufferObject: async function (buffer, i)
|
|
398
|
-
{
|
|
399
|
-
if (!(buffer instanceof Object))
|
|
400
|
-
return;
|
|
401
|
-
|
|
402
|
-
if (!buffer .uri)
|
|
403
|
-
return this .buffers [i];
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
url = new URL (buffer .uri, this .getExecutionContext () .getWorldURL ()),
|
|
407
|
-
response = await fetch (url),
|
|
408
|
-
blob = await response .blob (),
|
|
409
|
-
arrayBuffer = await blob .arrayBuffer ();
|
|
410
|
-
|
|
411
|
-
return $.ungzip (arrayBuffer);
|
|
412
|
-
},
|
|
413
|
-
bufferViewsArray (bufferViews)
|
|
414
|
-
{
|
|
415
|
-
if (!(bufferViews instanceof Array))
|
|
416
|
-
return;
|
|
417
|
-
|
|
418
|
-
this .bufferViews = bufferViews;
|
|
419
|
-
|
|
420
|
-
for (const bufferView of bufferViews)
|
|
421
|
-
bufferView .buffer = this .bufferViewObject (bufferView);
|
|
422
|
-
},
|
|
423
|
-
bufferViewObject (bufferView)
|
|
424
|
-
{
|
|
425
|
-
if (!(bufferView instanceof Object))
|
|
426
|
-
return;
|
|
427
|
-
|
|
428
|
-
const buffer = this .buffers [bufferView .buffer];
|
|
429
|
-
|
|
430
|
-
if (!buffer)
|
|
431
|
-
return;
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
byteOffset = bufferView .byteOffset || 0,
|
|
435
|
-
byteLength = bufferView .byteLength;
|
|
436
|
-
|
|
437
|
-
return buffer .slice (byteOffset, byteOffset + byteLength);
|
|
438
|
-
},
|
|
439
|
-
accessorsArray (accessors)
|
|
440
|
-
{
|
|
441
|
-
if (!(accessors instanceof Array))
|
|
442
|
-
return;
|
|
443
|
-
|
|
444
|
-
this .accessors = accessors;
|
|
445
|
-
|
|
446
|
-
for (const accessor of accessors)
|
|
447
|
-
this .accessorObject (accessor);
|
|
448
|
-
},
|
|
449
|
-
accessorObject: (() =>
|
|
450
|
-
{
|
|
451
|
-
const TypedArrays = new Map ([
|
|
452
|
-
[5120, Int8Array],
|
|
453
|
-
[5121, Uint8Array],
|
|
454
|
-
[5122, Int16Array],
|
|
455
|
-
[5123, Uint16Array],
|
|
456
|
-
[5124, Int32Array],
|
|
457
|
-
[5125, Uint32Array],
|
|
458
|
-
[5126, Float32Array],
|
|
459
|
-
]);
|
|
460
|
-
|
|
461
|
-
const Components = new Map ([
|
|
462
|
-
["SCALAR", 1],
|
|
463
|
-
["VEC2", 2],
|
|
464
|
-
["VEC3", 3],
|
|
465
|
-
["VEC4", 4],
|
|
466
|
-
["MAT2", 4],
|
|
467
|
-
["MAT3", 9],
|
|
468
|
-
["MAT4", 16],
|
|
469
|
-
]);
|
|
470
|
-
|
|
471
|
-
return function (accessor)
|
|
472
|
-
{
|
|
473
|
-
if (!(accessor instanceof Object))
|
|
474
|
-
return;
|
|
475
|
-
|
|
476
|
-
Object .defineProperty (accessor, "array",
|
|
477
|
-
{
|
|
478
|
-
get: () =>
|
|
479
|
-
{
|
|
480
|
-
const
|
|
481
|
-
TypedArray = TypedArrays .get (accessor .componentType),
|
|
482
|
-
bufferView = this .bufferViews [accessor .bufferView || 0],
|
|
483
|
-
byteOffset = accessor .byteOffset || 0,
|
|
484
|
-
byteStride = bufferView .byteStride || 0,
|
|
485
|
-
components = Components .get (accessor .type),
|
|
486
|
-
count = accessor .count || 0,
|
|
487
|
-
stride = byteStride ? byteStride / TypedArray .BYTES_PER_ELEMENT : components,
|
|
488
|
-
length = Math .min (stride * count, (bufferView .byteLength - byteOffset) / TypedArray .BYTES_PER_ELEMENT),
|
|
489
|
-
array = new TypedArray (bufferView .buffer, byteOffset, length);
|
|
490
|
-
|
|
491
|
-
if (stride === components)
|
|
492
|
-
{
|
|
493
|
-
const value = this .sparseObject (accessor .sparse, array, components);
|
|
494
|
-
|
|
495
|
-
Object .defineProperty (accessor, "array", { value: value });
|
|
496
|
-
|
|
497
|
-
return value;
|
|
498
|
-
}
|
|
499
|
-
else
|
|
500
|
-
{
|
|
501
|
-
const
|
|
502
|
-
length = count * components,
|
|
503
|
-
dense = new TypedArray (length);
|
|
504
|
-
|
|
505
|
-
for (let i = 0, j = 0; i < length; j += stride)
|
|
506
|
-
{
|
|
507
|
-
for (let c = 0; c < components; ++ c, ++ i)
|
|
508
|
-
dense [i] = array [j + c];
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
const value = this .sparseObject (accessor .sparse, dense, components);
|
|
512
|
-
|
|
513
|
-
Object .defineProperty (accessor, "array", { value: value });
|
|
514
|
-
|
|
515
|
-
return value;
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
configurable: true,
|
|
519
|
-
});
|
|
520
|
-
};
|
|
521
|
-
})(),
|
|
522
|
-
sparseObject: (() =>
|
|
523
|
-
{
|
|
524
|
-
const TypedArrays = new Map ([
|
|
525
|
-
[5121, Uint8Array],
|
|
526
|
-
[5123, Uint16Array],
|
|
527
|
-
[5125, Uint32Array],
|
|
528
|
-
]);
|
|
529
|
-
|
|
530
|
-
return function (sparse, array, components)
|
|
531
|
-
{
|
|
532
|
-
if (!(sparse instanceof Object))
|
|
533
|
-
return array;
|
|
534
|
-
|
|
535
|
-
if (!(sparse .indices instanceof Object))
|
|
536
|
-
return array;
|
|
537
|
-
|
|
538
|
-
if (!(sparse .values instanceof Object))
|
|
539
|
-
return array;
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
IndicesTypedArray = TypedArrays .get (sparse .indices .componentType),
|
|
543
|
-
indicesBufferView = this .bufferViews [sparse .indices .bufferView],
|
|
544
|
-
indicesByteOffset = sparse .indices .byteOffset,
|
|
545
|
-
indices = new IndicesTypedArray (indicesBufferView .buffer, indicesByteOffset, sparse .count);
|
|
546
|
-
|
|
547
|
-
const
|
|
548
|
-
ValuesTypedArray = array .constructor,
|
|
549
|
-
valuesBufferView = this .bufferViews [sparse .values .bufferView],
|
|
550
|
-
valuesByteOffset = sparse .values .byteOffset,
|
|
551
|
-
values = new ValuesTypedArray (valuesBufferView .buffer, valuesByteOffset, sparse .count * components);
|
|
552
|
-
|
|
553
|
-
array = array .slice ();
|
|
554
|
-
|
|
555
|
-
let v = 0;
|
|
556
|
-
|
|
557
|
-
for (const i of indices)
|
|
558
|
-
{
|
|
559
|
-
for (let c = 0; c < components; ++ c, ++ v)
|
|
560
|
-
array [i * components + c] = values [v];
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
return array;
|
|
564
|
-
};
|
|
565
|
-
})(),
|
|
566
|
-
samplersArray (samplers)
|
|
567
|
-
{
|
|
568
|
-
if (!(samplers instanceof Array))
|
|
569
|
-
return;
|
|
570
|
-
|
|
571
|
-
this .samplers = samplers;
|
|
572
|
-
|
|
573
|
-
for (const sampler of samplers)
|
|
574
|
-
this .samplerObject (sampler);
|
|
575
|
-
},
|
|
576
|
-
samplerObject: (() =>
|
|
577
|
-
{
|
|
578
|
-
const MinificationFilters = new Map ([
|
|
579
|
-
[9728, ["NEAREST_PIXEL", false]],
|
|
580
|
-
[9729, ["AVG_PIXEL", false]],
|
|
581
|
-
[9984, ["NEAREST_PIXEL_NEAREST_MIPMAP", true]],
|
|
582
|
-
[9985, ["AVG_PIXEL_NEAREST_MIPMAP", true]],
|
|
583
|
-
[9986, ["NEAREST_PIXEL_AVG_MIPMAP", true]],
|
|
584
|
-
[9987, ["AVG_PIXEL_AVG_MIPMAP", true]],
|
|
585
|
-
]);
|
|
586
|
-
|
|
587
|
-
const MagnificationFilters = new Map ([
|
|
588
|
-
[9728, "NEAREST_PIXEL"],
|
|
589
|
-
[9729, "AVG_PIXEL"],
|
|
590
|
-
]);
|
|
591
|
-
|
|
592
|
-
const BoundaryModes = new Map ([
|
|
593
|
-
[33071, "CLAMP_TO_EDGE"],
|
|
594
|
-
[33648, "MIRRORED_REPEAT"],
|
|
595
|
-
[10497, "REPEAT"],
|
|
596
|
-
]);
|
|
597
|
-
|
|
598
|
-
return function (sampler)
|
|
599
|
-
{
|
|
600
|
-
if (!(sampler instanceof Object))
|
|
601
|
-
return;
|
|
602
|
-
|
|
603
|
-
Object .defineProperty (sampler, "texturePropertiesNode",
|
|
604
|
-
{
|
|
605
|
-
get: () =>
|
|
606
|
-
{
|
|
607
|
-
const
|
|
608
|
-
scene = this .getExecutionContext (),
|
|
609
|
-
texturePropertiesNode = scene .createNode ("TextureProperties", false),
|
|
610
|
-
name = this .sanitizeName (sampler .name);
|
|
611
|
-
|
|
612
|
-
if (name)
|
|
613
|
-
{
|
|
614
|
-
scene .addNamedNode (scene .getUniqueName (name), texturePropertiesNode);
|
|
615
|
-
scene .addExportedNode (scene .getUniqueExportName (name), texturePropertiesNode);
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
// minFilter
|
|
619
|
-
|
|
620
|
-
const minificationFilter = MinificationFilters .get (sampler .minFilter) ?? ["AVG_PIXEL", false];
|
|
621
|
-
|
|
622
|
-
texturePropertiesNode ._minificationFilter = minificationFilter [0];
|
|
623
|
-
texturePropertiesNode ._generateMipMaps = minificationFilter [1];
|
|
624
|
-
|
|
625
|
-
// magFilter
|
|
626
|
-
|
|
627
|
-
texturePropertiesNode ._magnificationFilter = MagnificationFilters .get (sampler .magFilter) ?? "AVG_PIXEL";
|
|
628
|
-
|
|
629
|
-
// boundaryMode
|
|
630
|
-
|
|
631
|
-
texturePropertiesNode ._boundaryModeS = BoundaryModes .get (sampler .wrapS) ?? "REPEAT";
|
|
632
|
-
texturePropertiesNode ._boundaryModeT = BoundaryModes .get (sampler .wrapT) ?? "REPEAT";
|
|
633
|
-
|
|
634
|
-
// setup
|
|
635
|
-
|
|
636
|
-
texturePropertiesNode .setup ();
|
|
637
|
-
|
|
638
|
-
Object .defineProperty (sampler, "texturePropertiesNode", { value: texturePropertiesNode });
|
|
639
|
-
|
|
640
|
-
return texturePropertiesNode;
|
|
641
|
-
},
|
|
642
|
-
configurable: true,
|
|
643
|
-
});
|
|
644
|
-
};
|
|
645
|
-
})(),
|
|
646
|
-
imagesArray: async function (images)
|
|
647
|
-
{
|
|
648
|
-
if (!(images instanceof Array))
|
|
649
|
-
return;
|
|
650
|
-
|
|
651
|
-
this .images = await Promise .all (images .map (image => this .imageObject (image)));
|
|
652
|
-
},
|
|
653
|
-
imageObject: async function (image)
|
|
654
|
-
{
|
|
655
|
-
if (!(image instanceof Object))
|
|
656
|
-
return;
|
|
657
|
-
|
|
658
|
-
if (image .uri)
|
|
659
|
-
return image;
|
|
660
|
-
|
|
661
|
-
const bufferView = this .bufferViews [image .bufferView];
|
|
662
|
-
|
|
663
|
-
if (!bufferView)
|
|
664
|
-
return image;
|
|
665
|
-
|
|
666
|
-
const
|
|
667
|
-
buffer = bufferView .buffer,
|
|
668
|
-
blob = new Blob ([new Uint8Array (buffer)], { type: image .mimeType }),
|
|
669
|
-
uri = await this .blobToDataUrl (blob);
|
|
670
|
-
|
|
671
|
-
image .uri = uri;
|
|
672
|
-
|
|
673
|
-
return image;
|
|
674
|
-
},
|
|
675
|
-
blobToDataUrl (blob)
|
|
676
|
-
{
|
|
677
|
-
return new Promise ((resolve, reject) =>
|
|
678
|
-
{
|
|
679
|
-
const fileReader = new FileReader ();
|
|
680
|
-
|
|
681
|
-
fileReader .onload = resolve;
|
|
682
|
-
fileReader .onerror = reject;
|
|
683
|
-
|
|
684
|
-
fileReader .readAsDataURL (blob);
|
|
685
|
-
})
|
|
686
|
-
.then (event => event .target .result);
|
|
687
|
-
},
|
|
688
|
-
texturesArray (textures)
|
|
689
|
-
{
|
|
690
|
-
if (!(textures instanceof Array))
|
|
691
|
-
return;
|
|
692
|
-
|
|
693
|
-
this .textures = textures;
|
|
694
|
-
},
|
|
695
|
-
textureObject (texture)
|
|
696
|
-
{
|
|
697
|
-
if (!(texture instanceof Object))
|
|
698
|
-
return;
|
|
699
|
-
|
|
700
|
-
const image = this .images [texture .source];
|
|
701
|
-
|
|
702
|
-
if (!image)
|
|
703
|
-
return null;
|
|
704
|
-
|
|
705
|
-
if (texture .textureNode)
|
|
706
|
-
return texture .textureNode;
|
|
707
|
-
|
|
708
|
-
const
|
|
709
|
-
scene = this .getExecutionContext (),
|
|
710
|
-
textureNode = scene .createNode ("ImageTexture", false),
|
|
711
|
-
name = this .sanitizeName (texture .name || image .name);
|
|
712
|
-
|
|
713
|
-
if (name)
|
|
714
|
-
{
|
|
715
|
-
scene .addNamedNode (scene .getUniqueName (name), textureNode);
|
|
716
|
-
scene .addExportedNode (scene .getUniqueExportName (name), textureNode);
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
textureNode ._url = [image .uri];
|
|
720
|
-
|
|
721
|
-
const sampler = this .samplers [texture .sampler];
|
|
722
|
-
|
|
723
|
-
if (sampler instanceof Object)
|
|
724
|
-
textureNode ._textureProperties = sampler .texturePropertiesNode;
|
|
725
|
-
|
|
726
|
-
textureNode .setup ();
|
|
727
|
-
|
|
728
|
-
return texture .textureNode = textureNode;
|
|
729
|
-
},
|
|
730
|
-
materialsArray (materials)
|
|
731
|
-
{
|
|
732
|
-
if (!(materials instanceof Array))
|
|
733
|
-
return;
|
|
734
|
-
|
|
735
|
-
this .materials = materials;
|
|
736
|
-
},
|
|
737
|
-
materialObject (material)
|
|
738
|
-
{
|
|
739
|
-
if (!(material instanceof Object))
|
|
740
|
-
return this .getDefaultAppearance ();
|
|
741
|
-
|
|
742
|
-
if (material .appearanceNode)
|
|
743
|
-
return material .appearanceNode;
|
|
744
|
-
|
|
745
|
-
const texCoordIndices = this .texCoordIndices ("", material);
|
|
746
|
-
|
|
747
|
-
this .texCoordIndex = [... texCoordIndices] .reduce (Math .max, -1);
|
|
748
|
-
this .textureTransformNodes = [ ];
|
|
749
|
-
this .texCoordMappings = new Map ();
|
|
750
|
-
material .texCoordMappings = this .texCoordMappings;
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
scene = this .getExecutionContext (),
|
|
754
|
-
appearanceNode = scene .createNode ("Appearance", false),
|
|
755
|
-
materialNode = this .createMaterial (material),
|
|
756
|
-
name = this .sanitizeName (material .name);
|
|
757
|
-
|
|
758
|
-
const emissiveFactor = new Color3 (0, 0, 0);
|
|
759
|
-
|
|
760
|
-
if (this .vectorValue (material .emissiveFactor, emissiveFactor))
|
|
761
|
-
materialNode ._emissiveColor = emissiveFactor;
|
|
762
|
-
|
|
763
|
-
materialNode ._emissiveTexture = this .textureInfo (material .emissiveTexture);
|
|
764
|
-
materialNode ._emissiveTextureMapping = this .textureMapping (material .emissiveTexture);
|
|
765
|
-
|
|
766
|
-
this .occlusionTextureInfo (material .occlusionTexture, materialNode);
|
|
767
|
-
this .normalTextureInfo (material .normalTexture, materialNode);
|
|
768
|
-
this .materialExtensions (material .extensions, materialNode);
|
|
769
|
-
|
|
770
|
-
materialNode .setup ();
|
|
771
|
-
|
|
772
|
-
for (const i of texCoordIndices)
|
|
773
|
-
{
|
|
774
|
-
const mapping = `TEXCOORD_${i}`;
|
|
775
|
-
|
|
776
|
-
if (this .textureTransformNodes .length)
|
|
777
|
-
{
|
|
778
|
-
const textureTransformNode = scene .createNode ("TextureTransform", false);
|
|
779
|
-
|
|
780
|
-
textureTransformNode ._mapping = mapping;
|
|
781
|
-
textureTransformNode ._translation .y = -1;
|
|
782
|
-
textureTransformNode ._scale .y = -1;
|
|
783
|
-
|
|
784
|
-
textureTransformNode .setup ();
|
|
785
|
-
|
|
786
|
-
this .textureTransformNodes .push (textureTransformNode);
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
this .texCoordMappings .set (mapping, i);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
if (name)
|
|
793
|
-
{
|
|
794
|
-
scene .addNamedNode (scene .getUniqueName (name), appearanceNode);
|
|
795
|
-
scene .addExportedNode (scene .getUniqueExportName (name), appearanceNode);
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
appearanceNode ._alphaMode = this .stringValue (material .alphaMode, "OPAQUE");
|
|
799
|
-
appearanceNode ._alphaCutoff = this .numberValue (material .alphaCutoff, 0.5);
|
|
800
|
-
appearanceNode ._material = materialNode;
|
|
801
|
-
appearanceNode ._textureTransform = this .createMultiTextureTransform (materialNode);
|
|
802
|
-
|
|
803
|
-
appearanceNode .setup ();
|
|
804
|
-
|
|
805
|
-
return material .appearanceNode = appearanceNode;
|
|
806
|
-
},
|
|
807
|
-
texCoordIndices (key, object, indices = new Set ())
|
|
808
|
-
{
|
|
809
|
-
if (!(object instanceof Object))
|
|
810
|
-
return indices;
|
|
811
|
-
|
|
812
|
-
if (key .endsWith ("Texture") && !object ?.extensions ?.KHR_texture_transform)
|
|
813
|
-
indices .add (object .texCoord || 0);
|
|
814
|
-
|
|
815
|
-
for (const [key, value] of Object .entries (object))
|
|
816
|
-
this .texCoordIndices (key, value, indices);
|
|
817
|
-
|
|
818
|
-
return indices;
|
|
819
|
-
},
|
|
820
|
-
createMaterial (material)
|
|
821
|
-
{
|
|
822
|
-
const materials = [
|
|
823
|
-
this .pbrMetallicRoughnessObject .bind (this, material .pbrMetallicRoughness),
|
|
824
|
-
this .pbrSpecularGlossinessObject .bind (this, material .extensions ?.KHR_materials_pbrSpecularGlossiness),
|
|
825
|
-
this .pbrMetallicRoughnessObject .bind (this, { }),
|
|
826
|
-
];
|
|
827
|
-
|
|
828
|
-
for (const material of materials)
|
|
829
|
-
{
|
|
830
|
-
const materialNode = material ();
|
|
831
|
-
|
|
832
|
-
if (materialNode)
|
|
833
|
-
return materialNode;
|
|
834
|
-
}
|
|
835
|
-
},
|
|
836
|
-
pbrMetallicRoughnessObject (pbrMetallicRoughness)
|
|
837
|
-
{
|
|
838
|
-
if (!(pbrMetallicRoughness instanceof Object))
|
|
839
|
-
return null;
|
|
840
|
-
|
|
841
|
-
const
|
|
842
|
-
scene = this .getExecutionContext (),
|
|
843
|
-
materialNode = scene .createNode ("PhysicalMaterial", false);
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
baseColorFactor = new Color4 (0, 0, 0, 0),
|
|
847
|
-
baseColor = new Color3 (0, 0, 0);
|
|
848
|
-
|
|
849
|
-
if (this .vectorValue (pbrMetallicRoughness .baseColorFactor, baseColorFactor))
|
|
850
|
-
{
|
|
851
|
-
materialNode ._baseColor = baseColor .set (... baseColorFactor);
|
|
852
|
-
materialNode ._transparency = 1 - baseColorFactor .a;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
materialNode ._metallic = this .numberValue (pbrMetallicRoughness .metallicFactor, 1);
|
|
856
|
-
materialNode ._roughness = this .numberValue (pbrMetallicRoughness .roughnessFactor, 1);
|
|
857
|
-
|
|
858
|
-
materialNode ._baseTexture = this .textureInfo (pbrMetallicRoughness .baseColorTexture);
|
|
859
|
-
materialNode ._baseTextureMapping = this .textureMapping (pbrMetallicRoughness .baseColorTexture);
|
|
860
|
-
materialNode ._metallicRoughnessTexture = this .textureInfo (pbrMetallicRoughness .metallicRoughnessTexture);
|
|
861
|
-
materialNode ._metallicRoughnessTextureMapping = this .textureMapping (pbrMetallicRoughness .metallicRoughnessTexture);
|
|
862
|
-
|
|
863
|
-
return materialNode;
|
|
864
|
-
},
|
|
865
|
-
pbrSpecularGlossinessObject (pbrSpecularGlossiness)
|
|
866
|
-
{
|
|
867
|
-
if (!(pbrSpecularGlossiness instanceof Object))
|
|
868
|
-
return null;
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
scene = this .getExecutionContext (),
|
|
872
|
-
materialNode = scene .createNode ("Material", false);
|
|
873
|
-
|
|
874
|
-
const
|
|
875
|
-
diffuseFactor = new Color4 (0, 0, 0, 0),
|
|
876
|
-
diffuseColor = new Color3 (0, 0, 0),
|
|
877
|
-
specularFactor = new Color3 (0, 0, 0);
|
|
878
|
-
|
|
879
|
-
if (this .vectorValue (pbrSpecularGlossiness .diffuseFactor, diffuseFactor))
|
|
880
|
-
{
|
|
881
|
-
materialNode ._diffuseColor = diffuseColor .set (... diffuseFactor);
|
|
882
|
-
materialNode ._transparency = 1 - diffuseFactor .a;
|
|
883
|
-
}
|
|
884
|
-
else
|
|
885
|
-
{
|
|
886
|
-
materialNode ._diffuseColor = Color3 .White;
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
if (this .vectorValue (pbrSpecularGlossiness .specularFactor, specularFactor))
|
|
890
|
-
materialNode ._specularColor = specularFactor;
|
|
891
|
-
else
|
|
892
|
-
materialNode ._specularColor = Color3 .White;
|
|
893
|
-
|
|
894
|
-
materialNode ._shininess = this .numberValue (pbrSpecularGlossiness .glossinessFactor, 1);
|
|
895
|
-
|
|
896
|
-
materialNode ._diffuseTexture = this .textureInfo (pbrSpecularGlossiness .diffuseTexture);
|
|
897
|
-
materialNode ._diffuseTextureMapping = this .textureMapping (pbrSpecularGlossiness .diffuseTexture);
|
|
898
|
-
materialNode ._specularTexture = this .textureInfo (pbrSpecularGlossiness .specularGlossinessTexture);
|
|
899
|
-
materialNode ._specularTextureMapping = this .textureMapping (pbrSpecularGlossiness .specularGlossinessTexture);
|
|
900
|
-
materialNode ._shininessTexture = this .textureInfo (pbrSpecularGlossiness .specularGlossinessTexture);
|
|
901
|
-
materialNode ._shininessTextureMapping = this .textureMapping (pbrSpecularGlossiness .specularGlossinessTexture);
|
|
902
|
-
|
|
903
|
-
return materialNode;
|
|
904
|
-
},
|
|
905
|
-
occlusionTextureInfo (occlusionTexture, materialNode)
|
|
906
|
-
{
|
|
907
|
-
if (!(occlusionTexture instanceof Object))
|
|
908
|
-
return null;
|
|
909
|
-
|
|
910
|
-
materialNode ._occlusionStrength = this .numberValue (occlusionTexture .strength, 1);
|
|
911
|
-
materialNode ._occlusionTexture = this .textureInfo (occlusionTexture);
|
|
912
|
-
materialNode ._occlusionTextureMapping = this .textureMapping (occlusionTexture);
|
|
913
|
-
},
|
|
914
|
-
normalTextureInfo (normalTexture, materialNode)
|
|
915
|
-
{
|
|
916
|
-
if (!(normalTexture instanceof Object))
|
|
917
|
-
return null;
|
|
918
|
-
|
|
919
|
-
materialNode ._normalScale = this .numberValue (normalTexture .scale, 1);
|
|
920
|
-
materialNode ._normalTexture = this .textureInfo (normalTexture);
|
|
921
|
-
materialNode ._normalTextureMapping = this .textureMapping (normalTexture);
|
|
922
|
-
},
|
|
923
|
-
textureInfo (texture)
|
|
924
|
-
{
|
|
925
|
-
if (!(texture instanceof Object))
|
|
926
|
-
return null;
|
|
927
|
-
|
|
928
|
-
if (texture .extensions instanceof Object)
|
|
929
|
-
texture .mapping = this .textureTransformObject (texture .extensions .KHR_texture_transform, texture .texCoord || 0);
|
|
930
|
-
else
|
|
931
|
-
texture .mapping = `TEXCOORD_${texture .texCoord || 0}`;
|
|
932
|
-
|
|
933
|
-
return this .textureObject (this .textures [texture .index]);
|
|
934
|
-
},
|
|
935
|
-
textureMapping (texture)
|
|
936
|
-
{
|
|
937
|
-
if (!(texture instanceof Object))
|
|
938
|
-
return "";
|
|
939
|
-
|
|
940
|
-
return texture .mapping;
|
|
941
|
-
},
|
|
942
|
-
materialExtensions (extensions, materialNode)
|
|
943
|
-
{
|
|
944
|
-
if (!(extensions instanceof Object))
|
|
945
|
-
return;
|
|
946
|
-
|
|
947
|
-
for (const [key, value] of Object .entries (extensions))
|
|
948
|
-
{
|
|
949
|
-
switch (key)
|
|
950
|
-
{
|
|
951
|
-
case "KHR_materials_unlit":
|
|
952
|
-
this .khrMaterialsUnlitObject (materialNode);
|
|
953
|
-
break;
|
|
954
|
-
case "KHR_materials_emissive_strength":
|
|
955
|
-
this .khrMaterialsEmissiveStrengthObject (value, materialNode);
|
|
956
|
-
break;
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
},
|
|
960
|
-
khrMaterialsUnlitObject (materialNode)
|
|
961
|
-
{
|
|
962
|
-
switch (materialNode .getTypeName ())
|
|
963
|
-
{
|
|
964
|
-
case "PhysicalMaterial":
|
|
965
|
-
{
|
|
966
|
-
materialNode ._emissiveColor = materialNode ._baseColor;
|
|
967
|
-
materialNode ._emissiveTextureMapping = materialNode ._baseTextureMapping;
|
|
968
|
-
materialNode ._emissiveTexture = materialNode ._baseTexture;
|
|
969
|
-
materialNode ._baseColor = Color3 .Black;
|
|
970
|
-
materialNode ._baseTextureMapping = "";
|
|
971
|
-
materialNode ._baseTexture = null;
|
|
972
|
-
break;
|
|
973
|
-
}
|
|
974
|
-
case "Material":
|
|
975
|
-
{
|
|
976
|
-
materialNode ._emissiveColor = materialNode ._diffuseColor;
|
|
977
|
-
materialNode ._emissiveTextureMapping = materialNode ._diffuseTextureMapping;
|
|
978
|
-
materialNode ._emissiveTexture = materialNode ._diffuseTexture;
|
|
979
|
-
materialNode ._diffuseColor = Color3 .Black;
|
|
980
|
-
materialNode ._diffuseTextureMapping = "";
|
|
981
|
-
materialNode ._diffuseTexture = null;
|
|
982
|
-
break;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
},
|
|
986
|
-
khrMaterialsEmissiveStrengthObject (KHR_materials_emissive_strength, materialNode)
|
|
987
|
-
{
|
|
988
|
-
if (!(KHR_materials_emissive_strength instanceof Object))
|
|
989
|
-
return;
|
|
990
|
-
|
|
991
|
-
const emissiveStrength = this .numberValue (KHR_materials_emissive_strength .emissiveStrength, 1);
|
|
992
|
-
|
|
993
|
-
materialNode ._emissiveColor .r *= emissiveStrength;
|
|
994
|
-
materialNode ._emissiveColor .g *= emissiveStrength;
|
|
995
|
-
materialNode ._emissiveColor .b *= emissiveStrength;
|
|
996
|
-
},
|
|
997
|
-
textureTransformObject (KHR_texture_transform, texCoord)
|
|
998
|
-
{
|
|
999
|
-
if (!(KHR_texture_transform instanceof Object))
|
|
1000
|
-
return;
|
|
1001
|
-
|
|
1002
|
-
if (!this .extensions .has ("KHR_texture_transform"))
|
|
1003
|
-
return;
|
|
1004
|
-
|
|
1005
|
-
const
|
|
1006
|
-
scene = this .getExecutionContext (),
|
|
1007
|
-
textureTransformNode = scene .createNode ("TextureTransformMatrix3D", false),
|
|
1008
|
-
mapping = `TEXCOORD_${this .texCoordIndex + this .textureTransformNodes .length + 1}`;
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
translation = new Vector2 (0, 0),
|
|
1012
|
-
scale = new Vector2 (1, 1),
|
|
1013
|
-
matrix = new Matrix4 ();
|
|
1014
|
-
|
|
1015
|
-
matrix .scale (new Vector3 (1, -1, 1));
|
|
1016
|
-
matrix .translate (new Vector3 (0, -1, 0));
|
|
1017
|
-
|
|
1018
|
-
if (this .vectorValue (KHR_texture_transform .offset, translation))
|
|
1019
|
-
matrix .translate (new Vector3 (... translation, 0));
|
|
1020
|
-
|
|
1021
|
-
matrix .rotate (new Rotation4 (0, 0, -1, this .numberValue (KHR_texture_transform .rotation, 0)));
|
|
1022
|
-
|
|
1023
|
-
if (this .vectorValue (KHR_texture_transform .scale, scale))
|
|
1024
|
-
matrix .scale (new Vector3 (... scale, 1));
|
|
1025
|
-
|
|
1026
|
-
textureTransformNode ._mapping = mapping;
|
|
1027
|
-
textureTransformNode ._matrix = matrix;
|
|
1028
|
-
|
|
1029
|
-
textureTransformNode .setup ();
|
|
1030
|
-
|
|
1031
|
-
this .textureTransformNodes .push (textureTransformNode);
|
|
1032
|
-
this .texCoordMappings .set (mapping, KHR_texture_transform .texCoord ?? texCoord);
|
|
1033
|
-
|
|
1034
|
-
return mapping;
|
|
1035
|
-
},
|
|
1036
|
-
meshesArray (meshes)
|
|
1037
|
-
{
|
|
1038
|
-
if (!(meshes instanceof Array))
|
|
1039
|
-
return;
|
|
1040
|
-
|
|
1041
|
-
this .meshes = meshes;
|
|
1042
|
-
},
|
|
1043
|
-
meshObject (mesh, skin)
|
|
1044
|
-
{
|
|
1045
|
-
if (!(mesh instanceof Object))
|
|
1046
|
-
return;
|
|
1047
|
-
|
|
1048
|
-
if (mesh .shapeNodes)
|
|
1049
|
-
{
|
|
1050
|
-
const primitives = mesh .primitives;
|
|
1051
|
-
|
|
1052
|
-
if (!(primitives instanceof Array))
|
|
1053
|
-
return mesh .shapeNodes;
|
|
1054
|
-
|
|
1055
|
-
for (const primitive of primitives)
|
|
1056
|
-
this .attributesJointsArray (skin, primitive .attributes ?.JOINTS, primitive .attributes ?.WEIGHTS);
|
|
1057
|
-
|
|
1058
|
-
return mesh .shapeNodes;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
const shapeNodes = this .primitivesArray (mesh .primitives, skin);
|
|
1062
|
-
|
|
1063
|
-
// Name Shape nodes.
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
scene = this .getExecutionContext (),
|
|
1067
|
-
name = this .sanitizeName (mesh .name);
|
|
1068
|
-
|
|
1069
|
-
if (name)
|
|
1070
|
-
{
|
|
1071
|
-
for (const shapeNode of shapeNodes)
|
|
1072
|
-
{
|
|
1073
|
-
scene .addNamedNode (scene .getUniqueName (name), shapeNode);
|
|
1074
|
-
scene .addExportedNode (scene .getUniqueExportName (name), shapeNode);
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
return mesh .shapeNodes = shapeNodes;
|
|
1079
|
-
},
|
|
1080
|
-
primitivesArray (primitives, skin)
|
|
1081
|
-
{
|
|
1082
|
-
if (!(primitives instanceof Array))
|
|
1083
|
-
return [ ];
|
|
1084
|
-
|
|
1085
|
-
const shapeNodes = [ ];
|
|
1086
|
-
|
|
1087
|
-
for (const primitive of primitives)
|
|
1088
|
-
this .primitiveObject (primitive, skin, shapeNodes);
|
|
1089
|
-
|
|
1090
|
-
return shapeNodes;
|
|
1091
|
-
},
|
|
1092
|
-
primitiveObject (primitive, skin, shapeNodes)
|
|
1093
|
-
{
|
|
1094
|
-
if (!(primitive instanceof Object))
|
|
1095
|
-
return;
|
|
1096
|
-
|
|
1097
|
-
this .attributesObject (primitive .attributes);
|
|
1098
|
-
this .targetsArray (primitive .targets);
|
|
1099
|
-
|
|
1100
|
-
primitive .indices = this .accessors [primitive .indices];
|
|
1101
|
-
primitive .material = this .materials [primitive .material];
|
|
1102
|
-
|
|
1103
|
-
this .primitiveExtensionsObject (primitive .extensions, primitive)
|
|
1104
|
-
|
|
1105
|
-
shapeNodes .push (this .createShape (primitive, skin));
|
|
1106
|
-
},
|
|
1107
|
-
attributesObject (attributes)
|
|
1108
|
-
{
|
|
1109
|
-
if (!(attributes instanceof Object))
|
|
1110
|
-
return;
|
|
1111
|
-
|
|
1112
|
-
for (const key in attributes)
|
|
1113
|
-
attributes [key] = this .accessors [attributes [key]];
|
|
1114
|
-
|
|
1115
|
-
attributes .TEXCOORD = [ ];
|
|
1116
|
-
attributes .COLOR = [ ];
|
|
1117
|
-
attributes .JOINTS = [ ];
|
|
1118
|
-
attributes .WEIGHTS = [ ];
|
|
1119
|
-
|
|
1120
|
-
for (let i = 0; attributes ["TEXCOORD_" + i]; ++ i)
|
|
1121
|
-
attributes .TEXCOORD .push (attributes ["TEXCOORD_" + i]);
|
|
1122
|
-
|
|
1123
|
-
for (let i = 0; attributes ["COLOR_" + i]; ++ i)
|
|
1124
|
-
attributes .COLOR .push (attributes ["COLOR_" + i]);
|
|
1125
|
-
|
|
1126
|
-
for (let i = 0; attributes ["JOINTS_" + i]; ++ i)
|
|
1127
|
-
attributes .JOINTS .push (attributes ["JOINTS_" + i]);
|
|
1128
|
-
|
|
1129
|
-
for (let i = 0; attributes ["WEIGHTS_" + i]; ++ i)
|
|
1130
|
-
attributes .WEIGHTS .push (attributes ["WEIGHTS_" + i]);
|
|
1131
|
-
},
|
|
1132
|
-
targetsArray (targets)
|
|
1133
|
-
{
|
|
1134
|
-
if (!(targets instanceof Array))
|
|
1135
|
-
return;
|
|
1136
|
-
},
|
|
1137
|
-
primitiveExtensionsObject (extensions, primitive)
|
|
1138
|
-
{
|
|
1139
|
-
if (!(extensions instanceof Object))
|
|
1140
|
-
return;
|
|
1141
|
-
|
|
1142
|
-
for (const [key, value] of Object .entries (extensions))
|
|
1143
|
-
{
|
|
1144
|
-
switch (key)
|
|
1145
|
-
{
|
|
1146
|
-
case "KHR_draco_mesh_compression":
|
|
1147
|
-
return this .khrDracoMeshCompressionObject (value, primitive);
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
},
|
|
1151
|
-
khrDracoMeshCompressionObject (draco, primitive)
|
|
1152
|
-
{
|
|
1153
|
-
if (!(draco instanceof Object))
|
|
1154
|
-
return;
|
|
1155
|
-
|
|
1156
|
-
if (!this .draco)
|
|
1157
|
-
return;
|
|
1158
|
-
|
|
1159
|
-
function indicesCallback (array)
|
|
1160
|
-
{
|
|
1161
|
-
Object .defineProperty (primitive .indices, "array", { value: array });
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
function attributeCallback (key, array)
|
|
1165
|
-
{
|
|
1166
|
-
if (attributes [key])
|
|
1167
|
-
Object .defineProperty (attributes [key], "array", { value: array });
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
const
|
|
1171
|
-
attributes = primitive .attributes,
|
|
1172
|
-
dataView = new Uint8Array (this .bufferViews [draco .bufferView] .buffer);
|
|
1173
|
-
|
|
1174
|
-
this .dracoDecodeMesh (this .draco, dataView, draco .attributes, indicesCallback, attributeCallback);
|
|
1175
|
-
},
|
|
1176
|
-
dracoDecodeMesh (draco, dataView, attributes, indicesCallback, attributeCallback)
|
|
1177
|
-
{
|
|
1178
|
-
const
|
|
1179
|
-
buffer = new draco .DecoderBuffer (),
|
|
1180
|
-
decoder = new draco .Decoder ();
|
|
1181
|
-
|
|
1182
|
-
buffer .Init (dataView, dataView .byteLength);
|
|
1183
|
-
|
|
1184
|
-
let geometry, status;
|
|
1185
|
-
|
|
1186
|
-
try
|
|
1187
|
-
{
|
|
1188
|
-
const type = decoder .GetEncodedGeometryType (buffer);
|
|
1189
|
-
|
|
1190
|
-
switch (type)
|
|
1191
|
-
{
|
|
1192
|
-
case draco .TRIANGULAR_MESH:
|
|
1193
|
-
geometry = new draco .Mesh ();
|
|
1194
|
-
status = decoder .DecodeBufferToMesh (buffer, geometry);
|
|
1195
|
-
break;
|
|
1196
|
-
case draco .POINT_CLOUD:
|
|
1197
|
-
geometry = new draco .PointCloud ();
|
|
1198
|
-
status = decoder .DecodeBufferToPointCloud (buffer, geometry);
|
|
1199
|
-
break;
|
|
1200
|
-
default:
|
|
1201
|
-
throw new Error (`Invalid geometry type ${type}.`);
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
if (!status .ok () || !geometry .ptr)
|
|
1205
|
-
throw new Error (status .error_msg ());
|
|
1206
|
-
|
|
1207
|
-
if (type === draco .TRIANGULAR_MESH)
|
|
1208
|
-
{
|
|
1209
|
-
const
|
|
1210
|
-
numFaces = geometry .num_faces (),
|
|
1211
|
-
numIndices = numFaces * 3,
|
|
1212
|
-
byteLength = numIndices * 4,
|
|
1213
|
-
ptr = draco ._malloc (byteLength);
|
|
1214
|
-
|
|
1215
|
-
try
|
|
1216
|
-
{
|
|
1217
|
-
const indices = new Uint32Array (numIndices);
|
|
1218
|
-
|
|
1219
|
-
decoder .GetTrianglesUInt32Array (geometry, byteLength, ptr);
|
|
1220
|
-
|
|
1221
|
-
indices .set (new Uint32Array (draco .HEAPF32 .buffer, ptr, numIndices));
|
|
1222
|
-
|
|
1223
|
-
indicesCallback (indices);
|
|
1224
|
-
}
|
|
1225
|
-
finally
|
|
1226
|
-
{
|
|
1227
|
-
draco ._free (ptr);
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
for (const [key, id] of Object .entries (attributes))
|
|
1232
|
-
{
|
|
1233
|
-
const
|
|
1234
|
-
attribute = decoder .GetAttributeByUniqueId (geometry, id),
|
|
1235
|
-
numComponents = attribute .num_components (),
|
|
1236
|
-
numPoints = geometry .num_points (),
|
|
1237
|
-
numValues = numPoints * numComponents,
|
|
1238
|
-
byteLength = numValues * Float32Array .BYTES_PER_ELEMENT,
|
|
1239
|
-
ptr = draco ._malloc (byteLength);
|
|
1240
|
-
|
|
1241
|
-
try
|
|
1242
|
-
{
|
|
1243
|
-
const array = new Float32Array (numValues);
|
|
1244
|
-
|
|
1245
|
-
decoder .GetAttributeDataArrayForAllPoints (geometry, attribute, draco .DT_FLOAT32, byteLength, ptr);
|
|
1246
|
-
|
|
1247
|
-
array .set (new Float32Array (draco .HEAPF32 .buffer, ptr, numValues));
|
|
1248
|
-
|
|
1249
|
-
attributeCallback (key, array);
|
|
1250
|
-
}
|
|
1251
|
-
finally
|
|
1252
|
-
{
|
|
1253
|
-
draco ._free (ptr);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
finally
|
|
1258
|
-
{
|
|
1259
|
-
if (geometry)
|
|
1260
|
-
draco .destroy (geometry);
|
|
1261
|
-
|
|
1262
|
-
draco .destroy (decoder);
|
|
1263
|
-
draco .destroy (buffer);
|
|
1264
|
-
}
|
|
1265
|
-
},
|
|
1266
|
-
createDraco: async function ()
|
|
1267
|
-
{
|
|
1268
|
-
if (this .constructor .draco)
|
|
1269
|
-
{
|
|
1270
|
-
return this .constructor .draco;
|
|
1271
|
-
}
|
|
1272
|
-
else
|
|
1273
|
-
{
|
|
1274
|
-
const
|
|
1275
|
-
response = await fetch (URLs .getLibUrl ("draco_decoder_gltf.js")),
|
|
1276
|
-
text = await response .text (),
|
|
1277
|
-
draco = await new Function (text) () ();
|
|
1278
|
-
|
|
1279
|
-
return this .constructor .draco = draco;
|
|
1280
|
-
}
|
|
1281
|
-
},
|
|
1282
|
-
camerasArray (cameras)
|
|
1283
|
-
{
|
|
1284
|
-
if (!(cameras instanceof Array))
|
|
1285
|
-
return;
|
|
1286
|
-
|
|
1287
|
-
this .cameras = cameras;
|
|
1288
|
-
},
|
|
1289
|
-
cameraObject (camera)
|
|
1290
|
-
{
|
|
1291
|
-
if (!(camera instanceof Object))
|
|
1292
|
-
return null;
|
|
1293
|
-
|
|
1294
|
-
if (camera .viewpointNode !== undefined)
|
|
1295
|
-
return camera .viewpointNode;
|
|
1296
|
-
|
|
1297
|
-
const viewpointNode = this .cameraType (camera);
|
|
1298
|
-
|
|
1299
|
-
if (!viewpointNode)
|
|
1300
|
-
return camera .viewpointNode = null;
|
|
1301
|
-
|
|
1302
|
-
const
|
|
1303
|
-
scene = this .getExecutionContext (),
|
|
1304
|
-
name = this .sanitizeName (camera .name);
|
|
1305
|
-
|
|
1306
|
-
// Name
|
|
1307
|
-
|
|
1308
|
-
if (name)
|
|
1309
|
-
{
|
|
1310
|
-
scene .addNamedNode (scene .getUniqueName (name), viewpointNode);
|
|
1311
|
-
scene .addExportedNode (scene .getUniqueExportName (name), viewpointNode);
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
viewpointNode ._description = camera .name ? this .description (camera .name) : `Viewpoint ${++ this .viewpoints}`;
|
|
1315
|
-
viewpointNode ._position = Vector3 .Zero;
|
|
1316
|
-
viewpointNode ._centerOfRotation = new Vector3 (0, 0, -10);
|
|
1317
|
-
|
|
1318
|
-
return camera .viewpointNode = viewpointNode;
|
|
1319
|
-
},
|
|
1320
|
-
cameraType (camera)
|
|
1321
|
-
{
|
|
1322
|
-
switch (camera .type)
|
|
1323
|
-
{
|
|
1324
|
-
case "orthographic":
|
|
1325
|
-
return this .orthographicCamera (camera .orthographic);
|
|
1326
|
-
case "perspective":
|
|
1327
|
-
return this .perspectiveCamera (camera .perspective);
|
|
1328
|
-
default:
|
|
1329
|
-
return null;
|
|
1330
|
-
}
|
|
1331
|
-
},
|
|
1332
|
-
orthographicCamera (camera)
|
|
1333
|
-
{
|
|
1334
|
-
const
|
|
1335
|
-
scene = this .getExecutionContext (),
|
|
1336
|
-
viewpointNode = scene .createNode ("OrthoViewpoint", false);
|
|
1337
|
-
|
|
1338
|
-
if (typeof camera .xmag === "number")
|
|
1339
|
-
{
|
|
1340
|
-
viewpointNode ._fieldOfView [0] = -camera .xmag / 2;
|
|
1341
|
-
viewpointNode ._fieldOfView [2] = +camera .xmag / 2;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
if (typeof camera .ymag === "number")
|
|
1345
|
-
{
|
|
1346
|
-
viewpointNode ._fieldOfView [1] = -camera .ymag / 2;
|
|
1347
|
-
viewpointNode ._fieldOfView [3] = +camera .ymag / 2;
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
if (typeof camera .znear === "number")
|
|
1351
|
-
viewpointNode ._nearDistance = camera .znear;
|
|
1352
|
-
|
|
1353
|
-
if (typeof camera .zfar === "number")
|
|
1354
|
-
viewpointNode ._farDistance = camera .zfar;
|
|
1355
|
-
|
|
1356
|
-
viewpointNode .setup ();
|
|
1357
|
-
|
|
1358
|
-
return viewpointNode;
|
|
1359
|
-
},
|
|
1360
|
-
perspectiveCamera (camera)
|
|
1361
|
-
{
|
|
1362
|
-
const
|
|
1363
|
-
scene = this .getExecutionContext (),
|
|
1364
|
-
viewpointNode = scene .createNode ("Viewpoint", false);
|
|
1365
|
-
|
|
1366
|
-
if (typeof camera .yfov === "number")
|
|
1367
|
-
viewpointNode ._fieldOfView = camera .yfov
|
|
1368
|
-
|
|
1369
|
-
if (typeof camera .znear === "number")
|
|
1370
|
-
viewpointNode ._nearDistance = camera .znear;
|
|
1371
|
-
|
|
1372
|
-
if (typeof camera .zfar === "number")
|
|
1373
|
-
viewpointNode ._farDistance = camera .zfar;
|
|
1374
|
-
|
|
1375
|
-
viewpointNode .setup ();
|
|
1376
|
-
|
|
1377
|
-
return viewpointNode;
|
|
1378
|
-
},
|
|
1379
|
-
nodesArray (nodes)
|
|
1380
|
-
{
|
|
1381
|
-
if (!(nodes instanceof Array))
|
|
1382
|
-
return;
|
|
1383
|
-
|
|
1384
|
-
this .nodes = nodes .map ((node, index) => this .nodeObject (node, index));
|
|
1385
|
-
|
|
1386
|
-
// 1. Replace skeleton nodes with humanoid.
|
|
1387
|
-
// 2. Add children.
|
|
1388
|
-
|
|
1389
|
-
this .nodes .forEach (node => this .nodeSkeleton (node));
|
|
1390
|
-
this .nodes .forEach (node => this .nodeChildren (node));
|
|
1391
|
-
},
|
|
1392
|
-
nodeObject (node, index)
|
|
1393
|
-
{
|
|
1394
|
-
if (!(node instanceof Object))
|
|
1395
|
-
return { };
|
|
1396
|
-
|
|
1397
|
-
if (node .transformNode)
|
|
1398
|
-
return node;
|
|
1399
|
-
|
|
1400
|
-
// Create Transform or HAnimJoint.
|
|
1401
|
-
|
|
1402
|
-
const
|
|
1403
|
-
scene = this .getExecutionContext (),
|
|
1404
|
-
typeName = this .joints .has (index) ? "HAnimJoint" : "Transform",
|
|
1405
|
-
transformNode = scene .createNode (typeName, false);
|
|
1406
|
-
|
|
1407
|
-
node .transformNode = transformNode;
|
|
1408
|
-
|
|
1409
|
-
// Create humanoid.
|
|
1410
|
-
|
|
1411
|
-
const skin = this .skins [node .skin];
|
|
1412
|
-
|
|
1413
|
-
if (skin)
|
|
1414
|
-
{
|
|
1415
|
-
// Skins can be cloned.
|
|
1416
|
-
|
|
1417
|
-
if (!skin .humanoidNode)
|
|
1418
|
-
skin .humanoidNode = scene .createNode ("HAnimHumanoid", false);
|
|
1419
|
-
|
|
1420
|
-
node .humanoidNode = skin .humanoidNode;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
node .childNode = node .humanoidNode ?? node .transformNode;
|
|
1424
|
-
|
|
1425
|
-
return node;
|
|
1426
|
-
},
|
|
1427
|
-
nodeSkeleton (node)
|
|
1428
|
-
{
|
|
1429
|
-
const skin = this .skins [node .skin];
|
|
1430
|
-
|
|
1431
|
-
if (!skin)
|
|
1432
|
-
return;
|
|
1433
|
-
|
|
1434
|
-
const
|
|
1435
|
-
skeleton = this .nodes [skin .skeleton],
|
|
1436
|
-
humanoidNode = skin .humanoidNode;
|
|
1437
|
-
|
|
1438
|
-
if (!skeleton)
|
|
1439
|
-
return;
|
|
1440
|
-
|
|
1441
|
-
skeleton .humanoidNode = humanoidNode;
|
|
1442
|
-
skeleton .childNode = humanoidNode;
|
|
1443
|
-
},
|
|
1444
|
-
nodeChildren (node)
|
|
1445
|
-
{
|
|
1446
|
-
const
|
|
1447
|
-
scene = this .getExecutionContext (),
|
|
1448
|
-
transformNode = node .transformNode,
|
|
1449
|
-
name = this .sanitizeName (node .name);
|
|
1450
|
-
|
|
1451
|
-
// Name
|
|
1452
|
-
|
|
1453
|
-
if (name)
|
|
1454
|
-
{
|
|
1455
|
-
scene .addNamedNode (scene .getUniqueName (name), transformNode);
|
|
1456
|
-
scene .addExportedNode (scene .getUniqueExportName (name), transformNode);
|
|
1457
|
-
|
|
1458
|
-
if (transformNode .getTypeName () === "HAnimJoint")
|
|
1459
|
-
transformNode ._name = node .name;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
// Set transformation matrix.
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
translation = new Vector3 (0, 0, 0),
|
|
1466
|
-
rotation = new Rotation4 (),
|
|
1467
|
-
scale = new Vector3 (1, 1, 1),
|
|
1468
|
-
scaleOrientation = new Rotation4 (),
|
|
1469
|
-
quaternion = new Quaternion (0, 0, 0, 1),
|
|
1470
|
-
matrix = new Matrix4 ();
|
|
1471
|
-
|
|
1472
|
-
if (this .vectorValue (node .matrix, matrix))
|
|
1473
|
-
{
|
|
1474
|
-
matrix .get (translation, rotation, scale, scaleOrientation);
|
|
1475
|
-
|
|
1476
|
-
transformNode ._translation = translation;
|
|
1477
|
-
transformNode ._rotation = rotation;
|
|
1478
|
-
transformNode ._scale = scale;
|
|
1479
|
-
transformNode ._scaleOrientation = scaleOrientation;
|
|
1480
|
-
}
|
|
1481
|
-
else
|
|
1482
|
-
{
|
|
1483
|
-
if (this .vectorValue (node .translation, translation))
|
|
1484
|
-
transformNode ._translation = translation;
|
|
1485
|
-
|
|
1486
|
-
if (this .vectorValue (node .rotation, quaternion))
|
|
1487
|
-
transformNode ._rotation = new Rotation4 (quaternion);
|
|
1488
|
-
|
|
1489
|
-
if (this .vectorValue (node .scale, scale))
|
|
1490
|
-
transformNode ._scale = scale;
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
// Add mesh.
|
|
1494
|
-
|
|
1495
|
-
const
|
|
1496
|
-
skin = this .skins [node .skin],
|
|
1497
|
-
shapeNodes = this .meshObject (this .meshes [node .mesh], skin);
|
|
1498
|
-
|
|
1499
|
-
// Add camera.
|
|
1500
|
-
|
|
1501
|
-
const viewpointNode = this .cameraObject (this .cameras [node .camera]);
|
|
1502
|
-
|
|
1503
|
-
if (viewpointNode)
|
|
1504
|
-
transformNode ._children .push (viewpointNode);
|
|
1505
|
-
|
|
1506
|
-
// Add light.
|
|
1507
|
-
|
|
1508
|
-
this .nodeExtensions (node .extensions, transformNode);
|
|
1509
|
-
|
|
1510
|
-
// Add children.
|
|
1511
|
-
|
|
1512
|
-
transformNode ._children .push (... this .nodeChildrenArray (node .children));
|
|
1513
|
-
|
|
1514
|
-
// Add Shape nodes.
|
|
1515
|
-
|
|
1516
|
-
if (shapeNodes)
|
|
1517
|
-
transformNode ._children .push (... shapeNodes);
|
|
1518
|
-
|
|
1519
|
-
transformNode .setup ();
|
|
1520
|
-
|
|
1521
|
-
// Skin
|
|
1522
|
-
|
|
1523
|
-
if (!skin)
|
|
1524
|
-
return;
|
|
1525
|
-
|
|
1526
|
-
const humanoidNode = skin .humanoidNode;
|
|
1527
|
-
|
|
1528
|
-
if (!humanoidNode .isInitialized ())
|
|
1529
|
-
{
|
|
1530
|
-
const name = this .sanitizeName (skin .name) || transformNode .getName ();
|
|
1531
|
-
|
|
1532
|
-
if (name)
|
|
1533
|
-
{
|
|
1534
|
-
scene .addNamedNode (scene .getUniqueName (name), humanoidNode);
|
|
1535
|
-
scene .addExportedNode (scene .getUniqueExportName (name), humanoidNode);
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
humanoidNode ._name = skin .name ?? node .name ?? "";
|
|
1539
|
-
humanoidNode ._version = "2.0";
|
|
1540
|
-
humanoidNode ._skeletalConfiguration = "GLTF";
|
|
1541
|
-
|
|
1542
|
-
const skeletonNode = this .nodes [skin .skeleton] ?.transformNode;
|
|
1543
|
-
|
|
1544
|
-
if (skeletonNode)
|
|
1545
|
-
humanoidNode ._skeleton .push (skeletonNode);
|
|
1546
|
-
|
|
1547
|
-
for (const [i, joint] of skin .joints .entries ())
|
|
1548
|
-
{
|
|
1549
|
-
const
|
|
1550
|
-
jointNode = this .nodes [joint] ?.transformNode,
|
|
1551
|
-
inverseBindMatrix = skin .inverseBindMatrices [i] ?? Matrix4 .Identity;
|
|
1552
|
-
|
|
1553
|
-
if (!jointNode)
|
|
1554
|
-
continue;
|
|
1555
|
-
|
|
1556
|
-
inverseBindMatrix .get (translation, rotation, scale);
|
|
1557
|
-
|
|
1558
|
-
humanoidNode ._joints .push (jointNode);
|
|
1559
|
-
humanoidNode ._jointBindingPositions .push (translation);
|
|
1560
|
-
humanoidNode ._jointBindingRotations .push (rotation);
|
|
1561
|
-
humanoidNode ._jointBindingScales .push (scale);
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
humanoidNode .setup ();
|
|
1565
|
-
}
|
|
1566
|
-
|
|
1567
|
-
if (shapeNodes ?.length)
|
|
1568
|
-
{
|
|
1569
|
-
humanoidNode ._skinNormal = shapeNodes [0] ._geometry .normal;
|
|
1570
|
-
humanoidNode ._skinCoord = shapeNodes [0] ._geometry .coord;
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
humanoidNode ._skin .push (transformNode);
|
|
1574
|
-
},
|
|
1575
|
-
nodeExtensions (extensions, transformNode)
|
|
1576
|
-
{
|
|
1577
|
-
if (!(extensions instanceof Object))
|
|
1578
|
-
return;
|
|
1579
|
-
|
|
1580
|
-
this .nodeLight (extensions .KHR_lights_punctual, transformNode);
|
|
1581
|
-
},
|
|
1582
|
-
nodeLight (khrLightsPunctual, transformNode)
|
|
1583
|
-
{
|
|
1584
|
-
if (!(khrLightsPunctual instanceof Object))
|
|
1585
|
-
return;
|
|
1586
|
-
|
|
1587
|
-
const lightNode = this .lightObject (this .lights [khrLightsPunctual .light]);
|
|
1588
|
-
|
|
1589
|
-
if (!lightNode)
|
|
1590
|
-
return;
|
|
1591
|
-
|
|
1592
|
-
++ this .usedLights;
|
|
1593
|
-
|
|
1594
|
-
transformNode ._children .push (lightNode);
|
|
1595
|
-
},
|
|
1596
|
-
nodeChildrenArray (children)
|
|
1597
|
-
{
|
|
1598
|
-
if (!(children instanceof Array))
|
|
1599
|
-
return [ ];
|
|
1600
|
-
|
|
1601
|
-
const nodes = [... new Set (children
|
|
1602
|
-
.map (index => this .nodes [index] ?.childNode)
|
|
1603
|
-
.filter (node => node)
|
|
1604
|
-
.filter (node => node .getTypeName () !== "HAnimHumanoid" || !node .getCloneCount ())
|
|
1605
|
-
)];
|
|
1606
|
-
|
|
1607
|
-
return nodes;
|
|
1608
|
-
},
|
|
1609
|
-
skinsArray (skins)
|
|
1610
|
-
{
|
|
1611
|
-
if (!(skins instanceof Array))
|
|
1612
|
-
return;
|
|
1613
|
-
|
|
1614
|
-
this .skins = skins;
|
|
1615
|
-
|
|
1616
|
-
for (const skin of skins)
|
|
1617
|
-
this .skinObject (skin);
|
|
1618
|
-
},
|
|
1619
|
-
skinObject: function (skin)
|
|
1620
|
-
{
|
|
1621
|
-
if (!(skin instanceof Object))
|
|
1622
|
-
return;
|
|
1623
|
-
|
|
1624
|
-
const scene = this .getScene ();
|
|
1625
|
-
|
|
1626
|
-
skin .joints = this .jointsArray (skin .joints);
|
|
1627
|
-
skin .skeleton = skin .skeleton ?? this .skeleton (skin .joints);
|
|
1628
|
-
skin .inverseBindMatrices = this .inverseBindMatricesAccessors (this .accessors [skin .inverseBindMatrices]);
|
|
1629
|
-
|
|
1630
|
-
skin .textureCoordinateNode = scene .createNode ("TextureCoordinate", false);
|
|
1631
|
-
skin .normalNode = scene .createNode ("Normal", false);
|
|
1632
|
-
skin .coordinateNode = scene .createNode ("Coordinate", false);
|
|
1633
|
-
|
|
1634
|
-
skin .textureCoordinateNode .setup ();
|
|
1635
|
-
skin .normalNode .setup ();
|
|
1636
|
-
skin .coordinateNode .setup ();
|
|
1637
|
-
},
|
|
1638
|
-
jointsArray: function (joints)
|
|
1639
|
-
{
|
|
1640
|
-
if (!(joints instanceof Array))
|
|
1641
|
-
return [ ];
|
|
1642
|
-
|
|
1643
|
-
joints .forEach (index => this .joints .add (index));
|
|
1644
|
-
|
|
1645
|
-
return joints;
|
|
1646
|
-
},
|
|
1647
|
-
skeleton: function (joints)
|
|
1648
|
-
{
|
|
1649
|
-
const children = new Set (joints
|
|
1650
|
-
.map (index => this .nodes [index])
|
|
1651
|
-
.filter (node => node instanceof Object)
|
|
1652
|
-
.filter (node => node .children instanceof Array)
|
|
1653
|
-
.flatMap (node => node .children));
|
|
1654
|
-
|
|
1655
|
-
return joints .filter (index => !children .has (index)) [0];
|
|
1656
|
-
},
|
|
1657
|
-
inverseBindMatricesAccessors: function (inverseBindMatrices)
|
|
1658
|
-
{
|
|
1659
|
-
if (!inverseBindMatrices)
|
|
1660
|
-
return [ ];
|
|
1661
|
-
|
|
1662
|
-
const
|
|
1663
|
-
array = inverseBindMatrices .array,
|
|
1664
|
-
length = array .length,
|
|
1665
|
-
matrices = [ ];
|
|
1666
|
-
|
|
1667
|
-
for (let i = 0; i < length; i += 16)
|
|
1668
|
-
matrices .push (new Matrix4 (... array .subarray (i, i + 16)));
|
|
1669
|
-
|
|
1670
|
-
return matrices;
|
|
1671
|
-
},
|
|
1672
|
-
scenesArray (scenes, sceneNumber = 0)
|
|
1673
|
-
{
|
|
1674
|
-
if (!(scenes instanceof Array))
|
|
1675
|
-
return;
|
|
1676
|
-
|
|
1677
|
-
const
|
|
1678
|
-
scene = this .getExecutionContext (),
|
|
1679
|
-
children = scenes .map (scene => this .sceneObject (scene)) .filter (node => node);
|
|
1680
|
-
|
|
1681
|
-
switch (children .length)
|
|
1682
|
-
{
|
|
1683
|
-
case 0:
|
|
1684
|
-
{
|
|
1685
|
-
return;
|
|
1686
|
-
}
|
|
1687
|
-
case 1:
|
|
1688
|
-
{
|
|
1689
|
-
if (sceneNumber === 0)
|
|
1690
|
-
{
|
|
1691
|
-
if (this .usedLights)
|
|
1692
|
-
scene .getRootNodes () .push (this .createNavigationInfo ());
|
|
1693
|
-
|
|
1694
|
-
scene .getRootNodes () .push (children [0]);
|
|
1695
|
-
return;
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
// Proceed with next case:
|
|
1699
|
-
}
|
|
1700
|
-
default:
|
|
1701
|
-
{
|
|
1702
|
-
// Root
|
|
1703
|
-
|
|
1704
|
-
if (this .usedLights)
|
|
1705
|
-
scene .getRootNodes () .push (this .createNavigationInfo ());
|
|
1706
|
-
|
|
1707
|
-
const switchNode = scene .createNode ("Switch", false);
|
|
1708
|
-
|
|
1709
|
-
scene .addNamedNode (scene .getUniqueName ("Scenes"), switchNode);
|
|
1710
|
-
scene .addExportedNode (scene .getUniqueExportName ("Scenes"), switchNode);
|
|
1711
|
-
|
|
1712
|
-
// Scenes.
|
|
1713
|
-
|
|
1714
|
-
switchNode ._whichChoice = sceneNumber;
|
|
1715
|
-
switchNode ._children = children;
|
|
1716
|
-
|
|
1717
|
-
switchNode .setup ();
|
|
1718
|
-
|
|
1719
|
-
scene .getRootNodes () .push (switchNode);
|
|
1720
|
-
return;
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
},
|
|
1724
|
-
sceneObject (scene)
|
|
1725
|
-
{
|
|
1726
|
-
if (!(scene instanceof Object))
|
|
1727
|
-
return null;
|
|
1728
|
-
|
|
1729
|
-
const nodes = this .sceneNodesArray (scene .nodes);
|
|
1730
|
-
|
|
1731
|
-
switch (nodes .length)
|
|
1732
|
-
{
|
|
1733
|
-
case 0:
|
|
1734
|
-
{
|
|
1735
|
-
return null;
|
|
1736
|
-
}
|
|
1737
|
-
case 1:
|
|
1738
|
-
{
|
|
1739
|
-
return nodes [0];
|
|
1740
|
-
}
|
|
1741
|
-
default:
|
|
1742
|
-
{
|
|
1743
|
-
const
|
|
1744
|
-
scene = this .getExecutionContext (),
|
|
1745
|
-
groupNode = scene .createNode ("Group", false),
|
|
1746
|
-
name = this .sanitizeName (scene .name);
|
|
1747
|
-
|
|
1748
|
-
if (name)
|
|
1749
|
-
{
|
|
1750
|
-
scene .addNamedNode (scene .getUniqueName (name), groupNode);
|
|
1751
|
-
scene .addExportedNode (scene .getUniqueExportName (name), groupNode);
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
groupNode ._children = nodes;
|
|
1755
|
-
|
|
1756
|
-
groupNode .setup ();
|
|
1757
|
-
|
|
1758
|
-
return groupNode;
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
},
|
|
1762
|
-
sceneNodesArray (nodes)
|
|
1763
|
-
{
|
|
1764
|
-
return this .nodeChildrenArray (nodes);
|
|
1765
|
-
},
|
|
1766
|
-
animationsArray (animations)
|
|
1767
|
-
{
|
|
1768
|
-
if (!(animations instanceof Array))
|
|
1769
|
-
return;
|
|
1770
|
-
|
|
1771
|
-
const animationNodes = animations
|
|
1772
|
-
.map (animation => this .animationObject (animation))
|
|
1773
|
-
.filter (node => node);
|
|
1774
|
-
|
|
1775
|
-
if (!animationNodes .length)
|
|
1776
|
-
return;
|
|
1777
|
-
|
|
1778
|
-
const
|
|
1779
|
-
scene = this .getExecutionContext (),
|
|
1780
|
-
groupNode = scene .createNode ("Group", false);
|
|
1781
|
-
|
|
1782
|
-
scene .addNamedNode (scene .getUniqueName ("Animations"), groupNode);
|
|
1783
|
-
scene .addExportedNode (scene .getUniqueExportName ("Animations"), groupNode);
|
|
1784
|
-
|
|
1785
|
-
groupNode ._children = animationNodes;
|
|
1786
|
-
|
|
1787
|
-
groupNode .setup ();
|
|
1788
|
-
|
|
1789
|
-
scene .getRootNodes () .push (groupNode);
|
|
1790
|
-
},
|
|
1791
|
-
animationObject (animation)
|
|
1792
|
-
{
|
|
1793
|
-
if (!(animation instanceof Object))
|
|
1794
|
-
return null;
|
|
1795
|
-
|
|
1796
|
-
const
|
|
1797
|
-
scene = this .getExecutionContext (),
|
|
1798
|
-
timeSensorNode = scene .createNode ("TimeSensor", false),
|
|
1799
|
-
channelNodes = this .animationChannelsArray (animation .channels, animation .samplers, timeSensorNode);
|
|
1800
|
-
|
|
1801
|
-
if (!channelNodes .length)
|
|
1802
|
-
return null;
|
|
1803
|
-
|
|
1804
|
-
const
|
|
1805
|
-
groupNode = scene .createNode ("Group", false),
|
|
1806
|
-
name = this .sanitizeName (animation .name);
|
|
1807
|
-
|
|
1808
|
-
++ this .animations;
|
|
1809
|
-
|
|
1810
|
-
scene .addNamedNode (scene .getUniqueName (name || `Animation${this .animations}`), groupNode);
|
|
1811
|
-
scene .addNamedNode (scene .getUniqueName (`Timer${this .animations}`), timeSensorNode);
|
|
1812
|
-
scene .addExportedNode (scene .getUniqueExportName (name || `Animation${this .animations}`), groupNode);
|
|
1813
|
-
scene .addExportedNode (scene .getUniqueExportName (`Timer${this .animations}`), timeSensorNode);
|
|
1814
|
-
|
|
1815
|
-
timeSensorNode ._description = this .description (animation .name) || `Animation ${this .animations}`;
|
|
1816
|
-
groupNode ._children .push (timeSensorNode, ... channelNodes);
|
|
1817
|
-
|
|
1818
|
-
timeSensorNode .setup ();
|
|
1819
|
-
groupNode .setup ();
|
|
1820
|
-
|
|
1821
|
-
return groupNode;
|
|
1822
|
-
},
|
|
1823
|
-
animationChannelsArray (channels, samplers, timeSensorNode)
|
|
1824
|
-
{
|
|
1825
|
-
if (!(channels instanceof Array))
|
|
1826
|
-
return [ ];
|
|
1827
|
-
|
|
1828
|
-
if (!(samplers instanceof Array))
|
|
1829
|
-
return [ ];
|
|
1830
|
-
|
|
1831
|
-
const cycleInterval = samplers
|
|
1832
|
-
.map (sampler => this .accessors [sampler .input])
|
|
1833
|
-
.filter (input => input ?.array .length)
|
|
1834
|
-
.reduce ((value, input) => Math .max (value, input .array .at (-1)), 0);
|
|
1835
|
-
|
|
1836
|
-
timeSensorNode ._cycleInterval = cycleInterval;
|
|
1837
|
-
|
|
1838
|
-
return channels
|
|
1839
|
-
.map (channel => this .animationChannelObject (channel, samplers, timeSensorNode))
|
|
1840
|
-
.filter (node => node);
|
|
1841
|
-
},
|
|
1842
|
-
animationChannelObject (channel, samplers, timeSensorNode)
|
|
1843
|
-
{
|
|
1844
|
-
if (!(channel instanceof Object))
|
|
1845
|
-
return null;
|
|
1846
|
-
|
|
1847
|
-
const target = channel .target;
|
|
1848
|
-
|
|
1849
|
-
if (!(target instanceof Object))
|
|
1850
|
-
return null;
|
|
1851
|
-
|
|
1852
|
-
const node = this .nodes [target .node] ?.transformNode;
|
|
1853
|
-
|
|
1854
|
-
if (!node)
|
|
1855
|
-
return null;
|
|
1856
|
-
|
|
1857
|
-
const sampler = samplers [channel .sampler];
|
|
1858
|
-
|
|
1859
|
-
if (!sampler)
|
|
1860
|
-
return null;
|
|
1861
|
-
|
|
1862
|
-
const input = this .accessors [sampler .input];
|
|
1863
|
-
|
|
1864
|
-
if (!input)
|
|
1865
|
-
return null;
|
|
1866
|
-
|
|
1867
|
-
if (!input .array .length)
|
|
1868
|
-
return null;
|
|
1869
|
-
|
|
1870
|
-
const output = this .accessors [sampler .output];
|
|
1871
|
-
|
|
1872
|
-
if (!output)
|
|
1873
|
-
return null;
|
|
1874
|
-
|
|
1875
|
-
if (!output .array .length)
|
|
1876
|
-
return null;
|
|
1877
|
-
|
|
1878
|
-
const
|
|
1879
|
-
scene = this .getExecutionContext (),
|
|
1880
|
-
interpolatorNode = this .createInterpolator (target .path, sampler .interpolation, input .array, output .array, timeSensorNode ._cycleInterval .getValue ());
|
|
1881
|
-
|
|
1882
|
-
if (!interpolatorNode)
|
|
1883
|
-
return null;
|
|
1884
|
-
|
|
1885
|
-
scene .addRoute (timeSensorNode, "fraction_changed", interpolatorNode, "set_fraction");
|
|
1886
|
-
scene .addRoute (interpolatorNode, "value_changed", node, target .path);
|
|
1887
|
-
|
|
1888
|
-
return interpolatorNode;
|
|
1889
|
-
},
|
|
1890
|
-
createNavigationInfo ()
|
|
1891
|
-
{
|
|
1892
|
-
const
|
|
1893
|
-
scene = this .getExecutionContext (),
|
|
1894
|
-
navigationInfoNode = scene .createNode ("NavigationInfo", false);
|
|
1895
|
-
|
|
1896
|
-
navigationInfoNode ._headlight = false;
|
|
1897
|
-
|
|
1898
|
-
navigationInfoNode .setup ();
|
|
1899
|
-
|
|
1900
|
-
return navigationInfoNode;
|
|
1901
|
-
},
|
|
1902
|
-
createShape (primitive, skin)
|
|
1903
|
-
{
|
|
1904
|
-
const
|
|
1905
|
-
scene = this .getExecutionContext (),
|
|
1906
|
-
shapeNode = scene .createNode ("Shape", false),
|
|
1907
|
-
appearanceNode = this .materialObject (primitive .material),
|
|
1908
|
-
geometryNode = this .createGeometry (primitive, skin);
|
|
1909
|
-
|
|
1910
|
-
shapeNode ._appearance = appearanceNode;
|
|
1911
|
-
shapeNode ._geometry = geometryNode;
|
|
1912
|
-
|
|
1913
|
-
shapeNode .setup ();
|
|
1914
|
-
|
|
1915
|
-
return shapeNode;
|
|
1916
|
-
},
|
|
1917
|
-
getDefaultAppearance ()
|
|
1918
|
-
{
|
|
1919
|
-
if (this .defaultAppearance)
|
|
1920
|
-
return this .defaultAppearance;
|
|
1921
|
-
|
|
1922
|
-
const
|
|
1923
|
-
scene = this .getExecutionContext (),
|
|
1924
|
-
appearanceNode = scene .createNode ("Appearance", false),
|
|
1925
|
-
materialNode = scene .createNode ("PhysicalMaterial", false);
|
|
1926
|
-
|
|
1927
|
-
appearanceNode ._alphaMode = "OPAQUE";
|
|
1928
|
-
appearanceNode ._material = materialNode;
|
|
1929
|
-
|
|
1930
|
-
materialNode .setup ();
|
|
1931
|
-
appearanceNode .setup ();
|
|
1932
|
-
|
|
1933
|
-
return this .defaultAppearance = appearanceNode;
|
|
1934
|
-
},
|
|
1935
|
-
createMultiTextureTransform (materialNode)
|
|
1936
|
-
{
|
|
1937
|
-
if (!+materialNode .getTextureBits ())
|
|
1938
|
-
return null;
|
|
1939
|
-
|
|
1940
|
-
const textureTransformNodes = this .textureTransformNodes
|
|
1941
|
-
.sort ((a, b) => Algorithm .cmp (a ._mapping .getValue (), b ._mapping .getValue ()));
|
|
1942
|
-
|
|
1943
|
-
switch (textureTransformNodes .length)
|
|
1944
|
-
{
|
|
1945
|
-
case 0:
|
|
1946
|
-
{
|
|
1947
|
-
if (this .textureTransformNode)
|
|
1948
|
-
return this .textureTransformNode;
|
|
1949
|
-
|
|
1950
|
-
const
|
|
1951
|
-
scene = this .getExecutionContext (),
|
|
1952
|
-
textureTransformNode = scene .createNode ("TextureTransform", false);
|
|
1953
|
-
|
|
1954
|
-
textureTransformNode ._translation .y = -1;
|
|
1955
|
-
textureTransformNode ._scale .y = -1;
|
|
1956
|
-
|
|
1957
|
-
textureTransformNode .setup ();
|
|
1958
|
-
|
|
1959
|
-
return this .textureTransformNode = textureTransformNode;
|
|
1960
|
-
}
|
|
1961
|
-
case 1:
|
|
1962
|
-
{
|
|
1963
|
-
return textureTransformNodes [0];
|
|
1964
|
-
}
|
|
1965
|
-
default:
|
|
1966
|
-
{
|
|
1967
|
-
const
|
|
1968
|
-
scene = this .getExecutionContext (),
|
|
1969
|
-
textureTransformNode = scene .createNode ("MultiTextureTransform", false);
|
|
1970
|
-
|
|
1971
|
-
textureTransformNode ._textureTransform = textureTransformNodes;
|
|
1972
|
-
|
|
1973
|
-
textureTransformNode .setup ();
|
|
1974
|
-
|
|
1975
|
-
return textureTransformNode;
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
},
|
|
1979
|
-
createGeometry (primitive, skin)
|
|
1980
|
-
{
|
|
1981
|
-
switch (primitive .mode)
|
|
1982
|
-
{
|
|
1983
|
-
case 0: // POINTS
|
|
1984
|
-
{
|
|
1985
|
-
return this .createPointSet (primitive, skin);
|
|
1986
|
-
}
|
|
1987
|
-
case 1: // LINES
|
|
1988
|
-
{
|
|
1989
|
-
if (primitive .indices)
|
|
1990
|
-
return this .createIndexedLineSet (primitive, skin, 1);
|
|
1991
|
-
|
|
1992
|
-
return this .createLineSet (primitive, skin);
|
|
1993
|
-
}
|
|
1994
|
-
case 2: // LINE_LOOP
|
|
1995
|
-
{
|
|
1996
|
-
return this .createIndexedLineSet (primitive, skin, 2);
|
|
1997
|
-
}
|
|
1998
|
-
case 3: // LINE_STRIP
|
|
1999
|
-
{
|
|
2000
|
-
return this .createIndexedLineSet (primitive, skin, 3);
|
|
2001
|
-
}
|
|
2002
|
-
default:
|
|
2003
|
-
case 4: // TRIANGLES
|
|
2004
|
-
{
|
|
2005
|
-
if (primitive .indices)
|
|
2006
|
-
return this .createIndexedTriangleSet (primitive, skin);
|
|
2007
|
-
|
|
2008
|
-
return this .createTriangleSet (primitive, skin);
|
|
2009
|
-
}
|
|
2010
|
-
case 5: // TRIANGLE_STRIP
|
|
2011
|
-
{
|
|
2012
|
-
if (primitive .indices)
|
|
2013
|
-
return this .createIndexedTriangleStripSet (primitive, skin);
|
|
2014
|
-
|
|
2015
|
-
return this .createTriangleStripSet (primitive, skin);
|
|
2016
|
-
}
|
|
2017
|
-
case 6: // TRIANGLE_FAN
|
|
2018
|
-
{
|
|
2019
|
-
if (primitive .indices)
|
|
2020
|
-
return this .createIndexedTriangleFanSet (primitive, skin);
|
|
2021
|
-
|
|
2022
|
-
return this .createTriangleFanSet (primitive, skin);
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
},
|
|
2026
|
-
createPointSet ({ attributes, material }, skin)
|
|
2027
|
-
{
|
|
2028
|
-
const
|
|
2029
|
-
scene = this .getExecutionContext (),
|
|
2030
|
-
geometryNode = scene .createNode ("PointSet", false);
|
|
2031
|
-
|
|
2032
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2033
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2034
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2035
|
-
|
|
2036
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2037
|
-
this .skinGeometry (skin, geometryNode);
|
|
2038
|
-
|
|
2039
|
-
geometryNode .setup ();
|
|
2040
|
-
|
|
2041
|
-
return geometryNode;
|
|
2042
|
-
},
|
|
2043
|
-
createIndexedLineSet ({ attributes, indices, material }, skin, mode)
|
|
2044
|
-
{
|
|
2045
|
-
const
|
|
2046
|
-
scene = this .getExecutionContext (),
|
|
2047
|
-
geometryNode = scene .createNode ("IndexedLineSet", false);
|
|
2048
|
-
|
|
2049
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2050
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2051
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2052
|
-
|
|
2053
|
-
switch (mode)
|
|
2054
|
-
{
|
|
2055
|
-
case 1: // LINES
|
|
2056
|
-
{
|
|
2057
|
-
const
|
|
2058
|
-
coordIndex = geometryNode ._coordIndex,
|
|
2059
|
-
array = indices .array,
|
|
2060
|
-
length = array .length;
|
|
2061
|
-
|
|
2062
|
-
for (let i = 0; i < length; i += 2)
|
|
2063
|
-
coordIndex .push (array [i], array [i + 1], -1);
|
|
2064
|
-
|
|
2065
|
-
break;
|
|
2066
|
-
}
|
|
2067
|
-
case 2: // LINE_LOOP
|
|
2068
|
-
{
|
|
2069
|
-
const coordIndex = geometryNode ._coordIndex;
|
|
2070
|
-
|
|
2071
|
-
if (indices)
|
|
2072
|
-
{
|
|
2073
|
-
for (const i of indices .array)
|
|
2074
|
-
coordIndex .push (i);
|
|
2075
|
-
|
|
2076
|
-
if (coordIndex .length)
|
|
2077
|
-
coordIndex .push (coordIndex [0], -1);
|
|
2078
|
-
}
|
|
2079
|
-
else
|
|
2080
|
-
{
|
|
2081
|
-
const coord = geometryNode ._coord;
|
|
2082
|
-
|
|
2083
|
-
if (coord ?.point .length)
|
|
2084
|
-
{
|
|
2085
|
-
for (const i of coord .point .keys ())
|
|
2086
|
-
coordIndex .push (i);
|
|
2087
|
-
|
|
2088
|
-
coordIndex .push (0, -1);
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
break;
|
|
2093
|
-
}
|
|
2094
|
-
case 3: // LINE_STRIP
|
|
2095
|
-
{
|
|
2096
|
-
const coordIndex = geometryNode ._coordIndex;
|
|
2097
|
-
|
|
2098
|
-
if (indices)
|
|
2099
|
-
{
|
|
2100
|
-
for (const i of indices .array)
|
|
2101
|
-
coordIndex .push (i);
|
|
2102
|
-
|
|
2103
|
-
if (coordIndex .length)
|
|
2104
|
-
coordIndex .push (-1);
|
|
2105
|
-
}
|
|
2106
|
-
else
|
|
2107
|
-
{
|
|
2108
|
-
const coord = geometryNode ._coord;
|
|
2109
|
-
|
|
2110
|
-
if (coord ?.point .length)
|
|
2111
|
-
{
|
|
2112
|
-
for (const i of coord .point .keys ())
|
|
2113
|
-
coordIndex .push (i);
|
|
2114
|
-
|
|
2115
|
-
coordIndex .push (-1);
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
|
|
2119
|
-
break;
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2124
|
-
this .skinGeometry (skin, geometryNode);
|
|
2125
|
-
|
|
2126
|
-
geometryNode .setup ();
|
|
2127
|
-
|
|
2128
|
-
return geometryNode;
|
|
2129
|
-
},
|
|
2130
|
-
createLineSet ({ attributes, material }, skin)
|
|
2131
|
-
{
|
|
2132
|
-
const
|
|
2133
|
-
scene = this .getExecutionContext (),
|
|
2134
|
-
geometryNode = scene .createNode ("LineSet", false);
|
|
2135
|
-
|
|
2136
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2137
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2138
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2139
|
-
|
|
2140
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2141
|
-
this .skinGeometry (skin, geometryNode);
|
|
2142
|
-
|
|
2143
|
-
geometryNode .setup ();
|
|
2144
|
-
|
|
2145
|
-
return geometryNode;
|
|
2146
|
-
},
|
|
2147
|
-
createIndexedTriangleSet ({ attributes, indices, material }, skin)
|
|
2148
|
-
{
|
|
2149
|
-
const
|
|
2150
|
-
scene = this .getExecutionContext (),
|
|
2151
|
-
geometryNode = scene .createNode ("IndexedTriangleSet", false);
|
|
2152
|
-
|
|
2153
|
-
geometryNode ._solid = !material ?.doubleSided;
|
|
2154
|
-
geometryNode ._index = indices .array;
|
|
2155
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2156
|
-
geometryNode ._texCoord = this .createMultiTextureCoordinate (attributes .TEXCOORD, material);
|
|
2157
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2158
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2159
|
-
geometryNode ._normalPerVertex = !! geometryNode ._normal .getValue ();
|
|
2160
|
-
|
|
2161
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2162
|
-
this .skinGeometry (skin, geometryNode);
|
|
2163
|
-
|
|
2164
|
-
geometryNode .setup ();
|
|
2165
|
-
|
|
2166
|
-
return geometryNode;
|
|
2167
|
-
},
|
|
2168
|
-
createTriangleSet ({ attributes, material }, skin)
|
|
2169
|
-
{
|
|
2170
|
-
const
|
|
2171
|
-
scene = this .getExecutionContext (),
|
|
2172
|
-
geometryNode = scene .createNode ("TriangleSet", false);
|
|
2173
|
-
|
|
2174
|
-
geometryNode ._solid = !material ?.doubleSided;
|
|
2175
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2176
|
-
geometryNode ._texCoord = this .createMultiTextureCoordinate (attributes .TEXCOORD, material);
|
|
2177
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2178
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2179
|
-
geometryNode ._normalPerVertex = !! geometryNode ._normal .getValue ();
|
|
2180
|
-
|
|
2181
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2182
|
-
this .skinGeometry (skin, geometryNode);
|
|
2183
|
-
|
|
2184
|
-
geometryNode .setup ();
|
|
2185
|
-
|
|
2186
|
-
return geometryNode;
|
|
2187
|
-
},
|
|
2188
|
-
createIndexedTriangleStripSet ({ attributes, indices, material }, skin)
|
|
2189
|
-
{
|
|
2190
|
-
const
|
|
2191
|
-
scene = this .getExecutionContext (),
|
|
2192
|
-
geometryNode = scene .createNode ("IndexedTriangleStripSet", false);
|
|
2193
|
-
|
|
2194
|
-
geometryNode ._solid = !material ?.doubleSided;
|
|
2195
|
-
geometryNode ._index = indices .array;
|
|
2196
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2197
|
-
geometryNode ._texCoord = this .createMultiTextureCoordinate (attributes .TEXCOORD, material);
|
|
2198
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2199
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2200
|
-
geometryNode ._normalPerVertex = !! geometryNode ._normal .getValue ();
|
|
2201
|
-
|
|
2202
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2203
|
-
this .skinGeometry (skin, geometryNode);
|
|
2204
|
-
|
|
2205
|
-
geometryNode .setup ();
|
|
2206
|
-
|
|
2207
|
-
return geometryNode;
|
|
2208
|
-
},
|
|
2209
|
-
createTriangleStripSet ({ attributes, material }, skin)
|
|
2210
|
-
{
|
|
2211
|
-
const
|
|
2212
|
-
scene = this .getExecutionContext (),
|
|
2213
|
-
geometryNode = scene .createNode ("TriangleStripSet", false);
|
|
2214
|
-
|
|
2215
|
-
geometryNode ._solid = !material ?.doubleSided;
|
|
2216
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2217
|
-
geometryNode ._texCoord = this .createMultiTextureCoordinate (attributes .TEXCOORD, material);
|
|
2218
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2219
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2220
|
-
geometryNode ._normalPerVertex = !! geometryNode ._normal .getValue ();
|
|
2221
|
-
|
|
2222
|
-
const coord = geometryNode ._coord;
|
|
2223
|
-
|
|
2224
|
-
if (coord)
|
|
2225
|
-
{
|
|
2226
|
-
if (coord .point .length)
|
|
2227
|
-
geometryNode ._stripCount = [coord .point .length];
|
|
2228
|
-
}
|
|
2229
|
-
|
|
2230
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2231
|
-
this .skinGeometry (skin, geometryNode);
|
|
2232
|
-
|
|
2233
|
-
geometryNode .setup ();
|
|
2234
|
-
|
|
2235
|
-
return geometryNode;
|
|
2236
|
-
},
|
|
2237
|
-
createIndexedTriangleFanSet ({ attributes, indices, material }, skin)
|
|
2238
|
-
{
|
|
2239
|
-
const
|
|
2240
|
-
scene = this .getExecutionContext (),
|
|
2241
|
-
geometryNode = scene .createNode ("IndexedTriangleFanSet", false);
|
|
2242
|
-
|
|
2243
|
-
geometryNode ._solid = !material ?.doubleSided;
|
|
2244
|
-
geometryNode ._index = indices .array;
|
|
2245
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2246
|
-
geometryNode ._texCoord = this .createMultiTextureCoordinate (attributes .TEXCOORD, material);
|
|
2247
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2248
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2249
|
-
geometryNode ._normalPerVertex = !! geometryNode ._normal .getValue ();
|
|
2250
|
-
|
|
2251
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2252
|
-
this .skinGeometry (skin, geometryNode);
|
|
2253
|
-
|
|
2254
|
-
geometryNode .setup ();
|
|
2255
|
-
|
|
2256
|
-
return geometryNode;
|
|
2257
|
-
},
|
|
2258
|
-
createTriangleFanSet ({ attributes, material }, skin)
|
|
2259
|
-
{
|
|
2260
|
-
const
|
|
2261
|
-
scene = this .getExecutionContext (),
|
|
2262
|
-
geometryNode = scene .createNode ("TriangleFanSet", false);
|
|
2263
|
-
|
|
2264
|
-
geometryNode ._solid = !material ?.doubleSided;
|
|
2265
|
-
geometryNode ._color = this .createColor (attributes .COLOR [0], material);
|
|
2266
|
-
geometryNode ._texCoord = this .createMultiTextureCoordinate (attributes .TEXCOORD, material);
|
|
2267
|
-
geometryNode ._normal = this .createNormal (attributes .NORMAL);
|
|
2268
|
-
geometryNode ._coord = this .createCoordinate (attributes .POSITION);
|
|
2269
|
-
geometryNode ._normalPerVertex = !! geometryNode ._normal .getValue ();
|
|
2270
|
-
|
|
2271
|
-
const coord = geometryNode ._coord;
|
|
2272
|
-
|
|
2273
|
-
if (coord)
|
|
2274
|
-
{
|
|
2275
|
-
if (coord .point .length)
|
|
2276
|
-
geometryNode ._fanCount = [coord .point .length];
|
|
2277
|
-
}
|
|
2278
|
-
|
|
2279
|
-
this .attributesJointsArray (skin, attributes .JOINTS, attributes .WEIGHTS);
|
|
2280
|
-
this .skinGeometry (skin, geometryNode);
|
|
2281
|
-
|
|
2282
|
-
geometryNode .setup ();
|
|
2283
|
-
|
|
2284
|
-
return geometryNode;
|
|
2285
|
-
},
|
|
2286
|
-
createColor: (() =>
|
|
2287
|
-
{
|
|
2288
|
-
const TypeNames = new Map ([
|
|
2289
|
-
["VEC3", "Color"],
|
|
2290
|
-
["VEC4", "ColorRGBA"],
|
|
2291
|
-
]);
|
|
2292
|
-
|
|
2293
|
-
return function (color, material)
|
|
2294
|
-
{
|
|
2295
|
-
if (!(color instanceof Object))
|
|
2296
|
-
return null;
|
|
2297
|
-
|
|
2298
|
-
const typeName = TypeNames .get (color .type);
|
|
2299
|
-
|
|
2300
|
-
if (!typeName)
|
|
2301
|
-
return null;
|
|
2302
|
-
|
|
2303
|
-
if (color .colorNode)
|
|
2304
|
-
return color .colorNode;
|
|
2305
|
-
|
|
2306
|
-
const
|
|
2307
|
-
scene = this .getExecutionContext (),
|
|
2308
|
-
appearanceNode = this .materialObject (material),
|
|
2309
|
-
opaque = appearanceNode ._alphaMode .getValue () === "OPAQUE",
|
|
2310
|
-
colorNode = scene .createNode (opaque ? "Color" : typeName, false);
|
|
2311
|
-
|
|
2312
|
-
const array = opaque && typeName !== "Color"
|
|
2313
|
-
? color .array .filter ((_, i) => (i + 1) % 4)
|
|
2314
|
-
: color .array;
|
|
2315
|
-
|
|
2316
|
-
switch (color .componentType)
|
|
2317
|
-
{
|
|
2318
|
-
case 5120: // Int8Array
|
|
2319
|
-
case 5122: // Int16Array
|
|
2320
|
-
case 5124: // Int32Array
|
|
2321
|
-
break;
|
|
2322
|
-
case 5121: // Uint8Array
|
|
2323
|
-
colorNode ._color = array .map (v => v / 0xff);
|
|
2324
|
-
break;
|
|
2325
|
-
case 5123: // Uint16Array
|
|
2326
|
-
colorNode ._color = array .map (v => v / 0xffff);
|
|
2327
|
-
break;
|
|
2328
|
-
case 5125: // Uint32Array
|
|
2329
|
-
colorNode ._color = array .map (v => v / 0xffffffff);
|
|
2330
|
-
break;
|
|
2331
|
-
case 5126: // Float32Array
|
|
2332
|
-
colorNode ._color = array;
|
|
2333
|
-
break;
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
|
-
colorNode .setup ();
|
|
2337
|
-
|
|
2338
|
-
return color .colorNode = colorNode;
|
|
2339
|
-
};
|
|
2340
|
-
})(),
|
|
2341
|
-
createMultiTextureCoordinate (texCoords, material)
|
|
2342
|
-
{
|
|
2343
|
-
const appearanceNode = this .materialObject (material);
|
|
2344
|
-
|
|
2345
|
-
if (!+appearanceNode ._material .getValue () .getTextureBits ())
|
|
2346
|
-
return null;
|
|
2347
|
-
|
|
2348
|
-
if (texCoords .textureCoordinateNode)
|
|
2349
|
-
return texCoords .textureCoordinateNode;
|
|
2350
|
-
|
|
2351
|
-
switch (material .texCoordMappings .size)
|
|
2352
|
-
{
|
|
2353
|
-
case 0:
|
|
2354
|
-
{
|
|
2355
|
-
return null;
|
|
2356
|
-
}
|
|
2357
|
-
case 1:
|
|
2358
|
-
{
|
|
2359
|
-
return texCoords .textureCoordinateNode = [... material .texCoordMappings .entries ()]
|
|
2360
|
-
.map (([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping)) [0];
|
|
2361
|
-
}
|
|
2362
|
-
default:
|
|
2363
|
-
{
|
|
2364
|
-
const textureCoordinateNodes = [... material .texCoordMappings .entries ()]
|
|
2365
|
-
.map (([mapping, i]) => this .createTextureCoordinate (texCoords [i], mapping))
|
|
2366
|
-
.filter (node => node)
|
|
2367
|
-
.sort ((a, b) => Algorithm .cmp (a ._mapping .getValue (), b ._mapping .getValue ()));
|
|
2368
|
-
|
|
2369
|
-
if (!textureCoordinateNodes .length)
|
|
2370
|
-
return null;
|
|
2371
|
-
|
|
2372
|
-
const
|
|
2373
|
-
scene = this .getExecutionContext (),
|
|
2374
|
-
textureCoordinateNode = scene .createNode ("MultiTextureCoordinate", false);
|
|
2375
|
-
|
|
2376
|
-
textureCoordinateNode ._texCoord = textureCoordinateNodes;
|
|
2377
|
-
|
|
2378
|
-
textureCoordinateNode .setup ();
|
|
2379
|
-
|
|
2380
|
-
return texCoords .textureCoordinateNode = textureCoordinateNode;
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
},
|
|
2384
|
-
createTextureCoordinate (texCoord, mapping)
|
|
2385
|
-
{
|
|
2386
|
-
if (!(texCoord instanceof Object))
|
|
2387
|
-
return null;
|
|
2388
|
-
|
|
2389
|
-
if (texCoord .type !== "VEC2")
|
|
2390
|
-
return null;
|
|
2391
|
-
|
|
2392
|
-
if (texCoord [mapping])
|
|
2393
|
-
return texCoord [mapping];
|
|
2394
|
-
|
|
2395
|
-
const
|
|
2396
|
-
scene = this .getExecutionContext (),
|
|
2397
|
-
textureCoordinateNode = scene .createNode ("TextureCoordinate", false);
|
|
2398
|
-
|
|
2399
|
-
textureCoordinateNode ._mapping = mapping;
|
|
2400
|
-
textureCoordinateNode ._point = texCoord .array;
|
|
2401
|
-
|
|
2402
|
-
textureCoordinateNode .setup ();
|
|
2403
|
-
|
|
2404
|
-
return texCoord [mapping] = textureCoordinateNode;
|
|
2405
|
-
},
|
|
2406
|
-
createNormal (normal)
|
|
2407
|
-
{
|
|
2408
|
-
if (!(normal instanceof Object))
|
|
2409
|
-
return null;
|
|
2410
|
-
|
|
2411
|
-
if (normal .type !== "VEC3")
|
|
2412
|
-
return null;
|
|
2413
|
-
|
|
2414
|
-
if (normal .normalNode)
|
|
2415
|
-
return normal .normalNode;
|
|
2416
|
-
|
|
2417
|
-
const
|
|
2418
|
-
scene = this .getExecutionContext (),
|
|
2419
|
-
normalNode = scene .createNode ("Normal", false);
|
|
2420
|
-
|
|
2421
|
-
normalNode ._vector = normal .array;
|
|
2422
|
-
|
|
2423
|
-
normalNode .setup ();
|
|
2424
|
-
|
|
2425
|
-
return normal .normalNode = normalNode;
|
|
2426
|
-
},
|
|
2427
|
-
createCoordinate (position)
|
|
2428
|
-
{
|
|
2429
|
-
if (!(position instanceof Object))
|
|
2430
|
-
return null;
|
|
2431
|
-
|
|
2432
|
-
if (position .type !== "VEC3")
|
|
2433
|
-
return null;
|
|
2434
|
-
|
|
2435
|
-
if (position .coordinateNode)
|
|
2436
|
-
return position .coordinateNode;
|
|
2437
|
-
|
|
2438
|
-
const
|
|
2439
|
-
scene = this .getExecutionContext (),
|
|
2440
|
-
coordinateNode = scene .createNode ("Coordinate", false);
|
|
2441
|
-
|
|
2442
|
-
coordinateNode ._point = position .array;
|
|
2443
|
-
|
|
2444
|
-
coordinateNode .setup ();
|
|
2445
|
-
|
|
2446
|
-
return position .coordinateNode = coordinateNode;
|
|
2447
|
-
},
|
|
2448
|
-
attributesJointsArray: function (skin, joints, weights)
|
|
2449
|
-
{
|
|
2450
|
-
if (!(skin instanceof Object))
|
|
2451
|
-
return;
|
|
2452
|
-
|
|
2453
|
-
if (!(joints instanceof Array))
|
|
2454
|
-
return;
|
|
2455
|
-
|
|
2456
|
-
if (!(weights instanceof Array))
|
|
2457
|
-
return;
|
|
2458
|
-
|
|
2459
|
-
for (let i = 0, length = joints .length; i < length; ++ i)
|
|
2460
|
-
this .attributesJointsObject (skin, joints [i], weights [i]);
|
|
2461
|
-
},
|
|
2462
|
-
attributesJointsObject: function (skin, joints, weights)
|
|
2463
|
-
{
|
|
2464
|
-
if (!(joints instanceof Object))
|
|
2465
|
-
return;
|
|
2466
|
-
|
|
2467
|
-
if (!(weights instanceof Object))
|
|
2468
|
-
return;
|
|
2469
|
-
|
|
2470
|
-
if (joints .type !== "VEC4")
|
|
2471
|
-
return;
|
|
2472
|
-
|
|
2473
|
-
if (weights .type !== "VEC4")
|
|
2474
|
-
return;
|
|
2475
|
-
|
|
2476
|
-
const
|
|
2477
|
-
start = skin .coordinateNode ._point .length,
|
|
2478
|
-
jointsArray = joints .array,
|
|
2479
|
-
weightsArray = weights .array,
|
|
2480
|
-
numVertices = jointsArray .length / 4;
|
|
2481
|
-
|
|
2482
|
-
for (let v = 0; v < numVertices; ++ v)
|
|
2483
|
-
{
|
|
2484
|
-
for (let i = 0; i < 4; ++ i)
|
|
2485
|
-
{
|
|
2486
|
-
const w = weightsArray [v * 4 + i];
|
|
2487
|
-
|
|
2488
|
-
if (w === 0)
|
|
2489
|
-
continue;
|
|
2490
|
-
|
|
2491
|
-
const
|
|
2492
|
-
index = skin .joints [jointsArray [v * 4 + i]],
|
|
2493
|
-
jointNode = this .nodes [index] ?.transformNode;
|
|
2494
|
-
|
|
2495
|
-
if (!jointNode)
|
|
2496
|
-
continue;
|
|
2497
|
-
|
|
2498
|
-
jointNode ._skinCoordIndex .push (v + start);
|
|
2499
|
-
jointNode ._skinCoordWeight .push (w);
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
},
|
|
2503
|
-
skinGeometry: function (skin, geometryNode)
|
|
2504
|
-
{
|
|
2505
|
-
if (!(skin instanceof Object))
|
|
2506
|
-
return;
|
|
2507
|
-
|
|
2508
|
-
const
|
|
2509
|
-
skinTextureCoordinateNode = skin .textureCoordinateNode,
|
|
2510
|
-
skinNormalNode = skin .normalNode,
|
|
2511
|
-
skinCoordinateNode = skin .coordinateNode,
|
|
2512
|
-
start = skinCoordinateNode ._point .length,
|
|
2513
|
-
textureCoordinateNode = geometryNode ._texCoord ?.getValue (),
|
|
2514
|
-
normalNode = geometryNode ._normal ?.getValue (),
|
|
2515
|
-
coordinateNode = geometryNode ._coord ?.getValue ();
|
|
2516
|
-
|
|
2517
|
-
if (geometryNode ._coordIndex)
|
|
2518
|
-
geometryNode ._coordIndex = geometryNode ._coordIndex .map (index => index < 0 ? -1 : index + start);
|
|
2519
|
-
|
|
2520
|
-
if (geometryNode ._index)
|
|
2521
|
-
geometryNode ._index = geometryNode ._index .map (index => index < 0 ? -1 : index + start);
|
|
2522
|
-
|
|
2523
|
-
if (textureCoordinateNode)
|
|
2524
|
-
{
|
|
2525
|
-
const point = skinTextureCoordinateNode ._point;
|
|
2526
|
-
textureCoordinateNode ._point .forEach ((p, i) => point [i + start] = p);
|
|
2527
|
-
geometryNode ._texCoord = skinTextureCoordinateNode;
|
|
2528
|
-
}
|
|
2529
|
-
|
|
2530
|
-
if (normalNode)
|
|
2531
|
-
{
|
|
2532
|
-
const vector = skinNormalNode ._vector;
|
|
2533
|
-
normalNode ._vector .forEach ((v, i) => vector [i + start] = v);
|
|
2534
|
-
geometryNode ._normal = skinNormalNode;
|
|
2535
|
-
}
|
|
2536
|
-
|
|
2537
|
-
if (coordinateNode)
|
|
2538
|
-
{
|
|
2539
|
-
const point = skinCoordinateNode ._point;
|
|
2540
|
-
coordinateNode ._point .forEach ((p, i) => point [i + start] = p);
|
|
2541
|
-
geometryNode ._coord = skinCoordinateNode;
|
|
2542
|
-
}
|
|
2543
|
-
},
|
|
2544
|
-
createInterpolator (path, interpolation, times, keyValues, cycleInterval)
|
|
2545
|
-
{
|
|
2546
|
-
const scene = this .getExecutionContext ();
|
|
2547
|
-
|
|
2548
|
-
switch (path)
|
|
2549
|
-
{
|
|
2550
|
-
case "translation":
|
|
2551
|
-
{
|
|
2552
|
-
const interpolatorNode = this .createPositionInterpolator (interpolation, times, keyValues, cycleInterval);
|
|
2553
|
-
|
|
2554
|
-
scene .addNamedNode (scene .getUniqueName ("TranslationInterpolator"), interpolatorNode);
|
|
2555
|
-
|
|
2556
|
-
return interpolatorNode;
|
|
2557
|
-
}
|
|
2558
|
-
case "rotation":
|
|
2559
|
-
{
|
|
2560
|
-
const interpolatorNode = this .createOrientationInterpolator (interpolation, times, keyValues, cycleInterval);
|
|
2561
|
-
|
|
2562
|
-
scene .addNamedNode (scene .getUniqueName ("RotationInterpolator"), interpolatorNode);
|
|
2563
|
-
|
|
2564
|
-
return interpolatorNode;
|
|
2565
|
-
}
|
|
2566
|
-
case "scale":
|
|
2567
|
-
{
|
|
2568
|
-
const interpolatorNode = this .createPositionInterpolator (interpolation, times, keyValues, cycleInterval);
|
|
2569
|
-
|
|
2570
|
-
scene .addNamedNode (scene .getUniqueName ("ScaleInterpolator"), interpolatorNode);
|
|
2571
|
-
|
|
2572
|
-
return interpolatorNode;
|
|
2573
|
-
}
|
|
2574
|
-
case "weights":
|
|
2575
|
-
default:
|
|
2576
|
-
{
|
|
2577
|
-
return null;
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
},
|
|
2581
|
-
createPositionInterpolator (interpolation, times, keyValues, cycleInterval)
|
|
2582
|
-
{
|
|
2583
|
-
const scene = this .getExecutionContext ();
|
|
2584
|
-
|
|
2585
|
-
switch (interpolation)
|
|
2586
|
-
{
|
|
2587
|
-
case "STEP":
|
|
2588
|
-
{
|
|
2589
|
-
const interpolatorNode = scene .createNode ("PositionInterpolator", false);
|
|
2590
|
-
|
|
2591
|
-
// Key
|
|
2592
|
-
|
|
2593
|
-
interpolatorNode ._key .push (times [0] / cycleInterval);
|
|
2594
|
-
|
|
2595
|
-
for (let i = 1, length = times .length; i < length; ++ i)
|
|
2596
|
-
interpolatorNode ._key .push (times [i] / cycleInterval, times [i] / cycleInterval);
|
|
2597
|
-
|
|
2598
|
-
// KeyValue
|
|
2599
|
-
|
|
2600
|
-
interpolatorNode ._keyValue .push (new Vector3 (keyValues [0], keyValues [1], keyValues [2]));
|
|
2601
|
-
|
|
2602
|
-
for (let i = 0, length = keyValues .length - 3; i < length; i += 3)
|
|
2603
|
-
{
|
|
2604
|
-
interpolatorNode ._keyValue .push (new Vector3 (keyValues [i + 0], keyValues [i + 1], keyValues [i + 2]),
|
|
2605
|
-
new Vector3 (keyValues [i + 3], keyValues [i + 4], keyValues [i + 5]));
|
|
2606
|
-
}
|
|
2607
|
-
|
|
2608
|
-
// Finish
|
|
2609
|
-
|
|
2610
|
-
interpolatorNode .setup ();
|
|
2611
|
-
|
|
2612
|
-
return interpolatorNode;
|
|
2613
|
-
}
|
|
2614
|
-
default:
|
|
2615
|
-
case "LINEAR":
|
|
2616
|
-
{
|
|
2617
|
-
const interpolatorNode = scene .createNode ("PositionInterpolator", false);
|
|
2618
|
-
|
|
2619
|
-
interpolatorNode ._key = times .map (t => t / cycleInterval);
|
|
2620
|
-
interpolatorNode ._keyValue = keyValues;
|
|
2621
|
-
|
|
2622
|
-
interpolatorNode .setup ();
|
|
2623
|
-
|
|
2624
|
-
return interpolatorNode;
|
|
2625
|
-
}
|
|
2626
|
-
case "CUBICSPLINE":
|
|
2627
|
-
{
|
|
2628
|
-
const
|
|
2629
|
-
interpolatorNode = scene .createNode ("PositionInterpolator", false),
|
|
2630
|
-
vectors = [ ];
|
|
2631
|
-
|
|
2632
|
-
for (let i = 0, length = keyValues .length; i < length; i += 3)
|
|
2633
|
-
{
|
|
2634
|
-
vectors .push (new Vector3 (keyValues [i + 0],
|
|
2635
|
-
keyValues [i + 1],
|
|
2636
|
-
keyValues [i + 2]));
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
const samples = [... Array (Math .floor (times .at (-1) * SAMPLES_PER_SECOND)) .keys ()]
|
|
2640
|
-
.map ((_, i, array) => i / (array .length - 1) * times .at (-1));
|
|
2641
|
-
|
|
2642
|
-
for (const t of samples)
|
|
2643
|
-
{
|
|
2644
|
-
interpolatorNode ._key .push (t / cycleInterval);
|
|
2645
|
-
interpolatorNode ._keyValue .push (this .cubicSpline (t, times, vectors));
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
interpolatorNode .setup ();
|
|
2649
|
-
|
|
2650
|
-
return interpolatorNode;
|
|
2651
|
-
}
|
|
2652
|
-
|
|
2653
|
-
}
|
|
2654
|
-
},
|
|
2655
|
-
createOrientationInterpolator (interpolation, times, keyValues, cycleInterval)
|
|
2656
|
-
{
|
|
2657
|
-
const scene = this .getExecutionContext ();
|
|
2658
|
-
|
|
2659
|
-
switch (interpolation)
|
|
2660
|
-
{
|
|
2661
|
-
case "STEP":
|
|
2662
|
-
{
|
|
2663
|
-
const interpolatorNode = scene .createNode ("OrientationInterpolator", false);
|
|
2664
|
-
|
|
2665
|
-
// Key
|
|
2666
|
-
|
|
2667
|
-
interpolatorNode ._key .push (times [0] / cycleInterval);
|
|
2668
|
-
|
|
2669
|
-
for (let i = 1, length = times .length; i < length; ++ i)
|
|
2670
|
-
interpolatorNode ._key .push (times [i] / cycleInterval, times [i] / cycleInterval);
|
|
2671
|
-
|
|
2672
|
-
// KeyValue
|
|
2673
|
-
|
|
2674
|
-
interpolatorNode ._keyValue .push (new Rotation4 (new Quaternion (keyValues [0],
|
|
2675
|
-
keyValues [1],
|
|
2676
|
-
keyValues [2],
|
|
2677
|
-
keyValues [3])));
|
|
2678
|
-
|
|
2679
|
-
for (let i = 0, length = keyValues .length - 4; i < length; i += 4)
|
|
2680
|
-
{
|
|
2681
|
-
interpolatorNode ._keyValue .push (new Rotation4 (new Quaternion (keyValues [i + 0],
|
|
2682
|
-
keyValues [i + 1],
|
|
2683
|
-
keyValues [i + 2],
|
|
2684
|
-
keyValues [i + 3])),
|
|
2685
|
-
new Rotation4 (new Quaternion (keyValues [i + 4],
|
|
2686
|
-
keyValues [i + 5],
|
|
2687
|
-
keyValues [i + 6],
|
|
2688
|
-
keyValues [i + 7])));
|
|
2689
|
-
}
|
|
2690
|
-
|
|
2691
|
-
// Finish
|
|
2692
|
-
|
|
2693
|
-
interpolatorNode .setup ();
|
|
2694
|
-
|
|
2695
|
-
return interpolatorNode;
|
|
2696
|
-
}
|
|
2697
|
-
default:
|
|
2698
|
-
case "LINEAR":
|
|
2699
|
-
{
|
|
2700
|
-
const interpolatorNode = scene .createNode ("OrientationInterpolator", false);
|
|
2701
|
-
|
|
2702
|
-
interpolatorNode ._key = times .map (t => t / cycleInterval);
|
|
2703
|
-
|
|
2704
|
-
for (let i = 0, length = keyValues .length; i < length; i += 4)
|
|
2705
|
-
{
|
|
2706
|
-
interpolatorNode ._keyValue .push (new Rotation4 (new Quaternion (keyValues [i + 0],
|
|
2707
|
-
keyValues [i + 1],
|
|
2708
|
-
keyValues [i + 2],
|
|
2709
|
-
keyValues [i + 3])));
|
|
2710
|
-
}
|
|
2711
|
-
|
|
2712
|
-
interpolatorNode .setup ();
|
|
2713
|
-
|
|
2714
|
-
return interpolatorNode;
|
|
2715
|
-
}
|
|
2716
|
-
case "CUBICSPLINE":
|
|
2717
|
-
{
|
|
2718
|
-
const
|
|
2719
|
-
interpolatorNode = scene .createNode ("OrientationInterpolator", false),
|
|
2720
|
-
quaternions = [ ];
|
|
2721
|
-
|
|
2722
|
-
for (let i = 0, length = keyValues .length; i < length; i += 4)
|
|
2723
|
-
{
|
|
2724
|
-
quaternions .push (new Quaternion (keyValues [i + 0],
|
|
2725
|
-
keyValues [i + 1],
|
|
2726
|
-
keyValues [i + 2],
|
|
2727
|
-
keyValues [i + 3]));
|
|
2728
|
-
}
|
|
2729
|
-
|
|
2730
|
-
const samples = [... Array (Math .floor (times .at (-1) * SAMPLES_PER_SECOND)) .keys ()]
|
|
2731
|
-
.map ((_, i, array) => i / (array .length - 1) * times .at (-1));
|
|
2732
|
-
|
|
2733
|
-
for (const t of samples)
|
|
2734
|
-
{
|
|
2735
|
-
const q = this .cubicSpline (t, times, quaternions) .normalize ();
|
|
2736
|
-
|
|
2737
|
-
interpolatorNode ._key .push (t / cycleInterval);
|
|
2738
|
-
interpolatorNode ._keyValue .push (new Rotation4 (q));
|
|
2739
|
-
}
|
|
2740
|
-
|
|
2741
|
-
interpolatorNode .setup ();
|
|
2742
|
-
|
|
2743
|
-
return interpolatorNode;
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
},
|
|
2747
|
-
cubicSpline (time, times, values)
|
|
2748
|
-
{
|
|
2749
|
-
const
|
|
2750
|
-
index1 = Algorithm .clamp (Algorithm .upperBound (times, 0, times .length, time), 1, times .length - 1),
|
|
2751
|
-
index0 = index1 - 1,
|
|
2752
|
-
td = times [index1] - times [index0],
|
|
2753
|
-
t1 = (time - times [index0]) / td,
|
|
2754
|
-
t2 = t1 * t1,
|
|
2755
|
-
t3 = t2 * t1,
|
|
2756
|
-
v0 = values [index0 * 3 + 1] .copy (),
|
|
2757
|
-
b0 = values [index0 * 3 + 2] .copy (),
|
|
2758
|
-
v1 = values [index1 * 3 + 1] .copy (),
|
|
2759
|
-
a1 = values [index1 * 3 + 0] .copy ();
|
|
2760
|
-
|
|
2761
|
-
v0 .multiply (2 * t3 - 3 * t2 + 1);
|
|
2762
|
-
b0 .multiply (td * (t3 - 2 * t2 + t1));
|
|
2763
|
-
v1 .multiply (-2 * t3 + 3 * t2);
|
|
2764
|
-
a1 .multiply (td * (t3 - t2));
|
|
2765
|
-
|
|
2766
|
-
return v0 .add (b0) .add (v1) .add (a1);
|
|
2767
|
-
},
|
|
2768
|
-
vectorValue (array, vector)
|
|
2769
|
-
{
|
|
2770
|
-
if (!(array instanceof Array))
|
|
2771
|
-
return false;
|
|
2772
|
-
|
|
2773
|
-
if (array .length !== vector .length)
|
|
2774
|
-
return false;
|
|
2775
|
-
|
|
2776
|
-
vector .set (... array);
|
|
2777
|
-
|
|
2778
|
-
return true;
|
|
2779
|
-
},
|
|
2780
|
-
numberValue (value, defaultValue)
|
|
2781
|
-
{
|
|
2782
|
-
if (typeof value !== "number")
|
|
2783
|
-
return defaultValue;
|
|
2784
|
-
|
|
2785
|
-
return value;
|
|
2786
|
-
},
|
|
2787
|
-
stringValue (value, defaultValue)
|
|
2788
|
-
{
|
|
2789
|
-
if (typeof value !== "string")
|
|
2790
|
-
return defaultValue;
|
|
2791
|
-
|
|
2792
|
-
return value;
|
|
2793
|
-
},
|
|
2794
|
-
description (string)
|
|
2795
|
-
{
|
|
2796
|
-
return string ?.replace (/_+/g, " ") .trim () ?? "";
|
|
2797
|
-
},
|
|
2798
|
-
});
|
|
2799
|
-
|
|
2800
|
-
export default GLTF2Parser;
|