x_ite 8.8.7 → 8.9.0
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/Makefile +6 -0
- package/build/docs/nodes.pl +434 -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 +26 -26
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +14 -14
- 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 +18 -18
- 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 +27 -27
- 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 +24 -24
- 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 +18 -18
- 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 +965 -96
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +2 -2
- package/docs/_posts/components/CADGeometry/CADAssembly.md +45 -19
- package/docs/_posts/components/CADGeometry/CADFace.md +44 -18
- package/docs/_posts/components/CADGeometry/CADLayer.md +48 -19
- package/docs/_posts/components/CADGeometry/CADPart.md +54 -24
- package/docs/_posts/components/CADGeometry/IndexedQuadSet.md +55 -26
- package/docs/_posts/components/CADGeometry/QuadSet.md +52 -20
- package/docs/_posts/components/Core/MetadataBoolean.md +29 -18
- package/docs/_posts/components/Core/MetadataDouble.md +31 -16
- package/docs/_posts/components/Core/MetadataFloat.md +31 -16
- package/docs/_posts/components/Core/MetadataInteger.md +31 -16
- package/docs/_posts/components/Core/MetadataSet.md +30 -15
- package/docs/_posts/components/Core/MetadataString.md +31 -16
- package/docs/_posts/components/Core/WorldInfo.md +21 -10
- package/docs/_posts/components/CubeMapTexturing/ComposedCubeMapTexture.md +30 -25
- package/docs/_posts/components/CubeMapTexturing/GeneratedCubeMapTexture.md +19 -10
- package/docs/_posts/components/CubeMapTexturing/ImageCubeMapTexture.md +22 -18
- package/docs/_posts/components/DIS/DISEntityManager.md +40 -15
- package/docs/_posts/components/DIS/DISEntityTypeMapping.md +34 -25
- package/docs/_posts/components/DIS/EspduTransform.md +174 -41
- package/docs/_posts/components/DIS/ReceiverPdu.md +77 -27
- package/docs/_posts/components/DIS/SignalPdu.md +82 -28
- package/docs/_posts/components/DIS/TransmitterPdu.md +86 -36
- package/docs/_posts/components/EnvironmentalEffects/Background.md +80 -39
- package/docs/_posts/components/EnvironmentalEffects/Fog.md +39 -18
- package/docs/_posts/components/EnvironmentalEffects/FogCoordinate.md +10 -6
- package/docs/_posts/components/EnvironmentalEffects/LocalFog.md +21 -14
- package/docs/_posts/components/EnvironmentalEffects/TextureBackground.md +83 -31
- package/docs/_posts/components/EnvironmentalSensor/ProximitySensor.md +36 -8
- package/docs/_posts/components/EnvironmentalSensor/TransformSensor.md +31 -7
- package/docs/_posts/components/EnvironmentalSensor/VisibilitySensor.md +23 -7
- package/docs/_posts/components/EventUtilities/BooleanFilter.md +23 -10
- package/docs/_posts/components/EventUtilities/BooleanSequencer.md +46 -17
- package/docs/_posts/components/EventUtilities/BooleanToggle.md +29 -8
- package/docs/_posts/components/EventUtilities/BooleanTrigger.md +24 -7
- package/docs/_posts/components/EventUtilities/IntegerSequencer.md +46 -17
- package/docs/_posts/components/EventUtilities/IntegerTrigger.md +34 -9
- package/docs/_posts/components/EventUtilities/TimeTrigger.md +30 -9
- package/docs/_posts/components/Followers/ColorChaser.md +35 -11
- package/docs/_posts/components/Followers/ColorDamper.md +32 -12
- package/docs/_posts/components/Followers/CoordinateChaser.md +33 -9
- package/docs/_posts/components/Followers/CoordinateDamper.md +30 -10
- package/docs/_posts/components/Followers/OrientationChaser.md +34 -10
- package/docs/_posts/components/Followers/OrientationDamper.md +31 -11
- package/docs/_posts/components/Followers/PositionChaser.md +33 -9
- package/docs/_posts/components/Followers/PositionChaser2D.md +33 -9
- package/docs/_posts/components/Followers/PositionDamper.md +30 -10
- package/docs/_posts/components/Followers/PositionDamper2D.md +30 -10
- package/docs/_posts/components/Followers/ScalarChaser.md +33 -9
- package/docs/_posts/components/Followers/ScalarDamper.md +30 -10
- package/docs/_posts/components/Followers/TexCoordChaser2D.md +33 -9
- package/docs/_posts/components/Followers/TexCoordDamper2D.md +30 -10
- package/docs/_posts/components/Geometry2D/Arc2D.md +39 -14
- package/docs/_posts/components/Geometry2D/ArcClose2D.md +43 -19
- package/docs/_posts/components/Geometry2D/Circle2D.md +21 -10
- package/docs/_posts/components/Geometry2D/Disk2D.md +32 -14
- package/docs/_posts/components/Geometry2D/Polyline2D.md +24 -9
- package/docs/_posts/components/Geometry2D/Polypoint2D.md +16 -8
- package/docs/_posts/components/Geometry2D/Rectangle2D.md +23 -12
- package/docs/_posts/components/Geometry2D/TriangleSet2D.md +23 -12
- package/docs/_posts/components/Geometry3D/Box.md +26 -13
- package/docs/_posts/components/Geometry3D/Cone.md +30 -22
- package/docs/_posts/components/Geometry3D/Cylinder.md +30 -26
- package/docs/_posts/components/Geometry3D/ElevationGrid.md +73 -29
- package/docs/_posts/components/Geometry3D/Extrusion.md +100 -48
- package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +92 -38
- package/docs/_posts/components/Geometry3D/Sphere.md +25 -13
- package/docs/_posts/components/Geospatial/GeoCoordinate.md +30 -14
- package/docs/_posts/components/Geospatial/GeoElevationGrid.md +82 -37
- package/docs/_posts/components/Geospatial/GeoLOD.md +66 -27
- package/docs/_posts/components/Geospatial/GeoLocation.md +64 -26
- package/docs/_posts/components/Geospatial/GeoMetadata.md +28 -22
- package/docs/_posts/components/Geospatial/GeoOrigin.md +34 -19
- package/docs/_posts/components/Geospatial/GeoPositionInterpolator.md +64 -18
- package/docs/_posts/components/Geospatial/GeoProximitySensor.md +67 -18
- package/docs/_posts/components/Geospatial/GeoTouchSensor.md +63 -18
- package/docs/_posts/components/Geospatial/GeoTransform.md +72 -28
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +79 -40
- package/docs/_posts/components/Grouping/Group.md +32 -16
- package/docs/_posts/components/Grouping/StaticGroup.md +37 -16
- package/docs/_posts/components/Grouping/Switch.md +39 -20
- package/docs/_posts/components/Grouping/Transform.md +45 -28
- package/docs/_posts/components/HAnim/HAnimDisplacer.md +38 -27
- package/docs/_posts/components/HAnim/HAnimHumanoid.md +197 -38
- package/docs/_posts/components/HAnim/HAnimJoint.md +104 -38
- package/docs/_posts/components/HAnim/HAnimMotion.md +117 -7
- package/docs/_posts/components/HAnim/HAnimSegment.md +72 -32
- package/docs/_posts/components/HAnim/HAnimSite.md +75 -32
- package/docs/_posts/components/Interpolation/ColorInterpolator.md +41 -11
- package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +39 -13
- package/docs/_posts/components/Interpolation/CoordinateInterpolator2D.md +43 -14
- package/docs/_posts/components/Interpolation/EaseInEaseOut.md +36 -12
- package/docs/_posts/components/Interpolation/NormalInterpolator.md +40 -10
- package/docs/_posts/components/Interpolation/OrientationInterpolator.md +40 -10
- package/docs/_posts/components/Interpolation/PositionInterpolator.md +40 -10
- package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +43 -14
- package/docs/_posts/components/Interpolation/ScalarInterpolator.md +39 -13
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator.md +41 -16
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator2D.md +41 -16
- package/docs/_posts/components/Interpolation/SplineScalarInterpolator.md +40 -24
- package/docs/_posts/components/Interpolation/SquadOrientationInterpolator.md +35 -11
- package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +51 -9
- package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +31 -9
- package/docs/_posts/components/Layering/Layer.md +27 -14
- package/docs/_posts/components/Layering/LayerSet.md +19 -13
- package/docs/_posts/components/Layering/Viewport.md +31 -15
- package/docs/_posts/components/Layout/Layout.md +27 -16
- package/docs/_posts/components/Layout/LayoutGroup.md +34 -18
- package/docs/_posts/components/Layout/LayoutLayer.md +28 -15
- package/docs/_posts/components/Layout/ScreenFontStyle.md +72 -45
- package/docs/_posts/components/Layout/ScreenGroup.md +32 -16
- package/docs/_posts/components/Lighting/DirectionalLight.md +19 -11
- package/docs/_posts/components/Lighting/EnvironmentLight.md +2 -6
- package/docs/_posts/components/Lighting/PointLight.md +23 -11
- package/docs/_posts/components/Lighting/SpotLight.md +32 -19
- package/docs/_posts/components/NURBS/Contour2D.md +17 -9
- package/docs/_posts/components/NURBS/ContourPolyline2D.md +10 -6
- package/docs/_posts/components/NURBS/CoordinateDouble.md +13 -9
- package/docs/_posts/components/NURBS/NurbsCurve.md +15 -11
- package/docs/_posts/components/NURBS/NurbsCurve2D.md +14 -10
- package/docs/_posts/components/NURBS/NurbsOrientationInterpolator.md +28 -12
- package/docs/_posts/components/NURBS/NurbsPatchSurface.md +19 -13
- package/docs/_posts/components/NURBS/NurbsPositionInterpolator.md +27 -11
- package/docs/_posts/components/NURBS/NurbsSet.md +48 -14
- package/docs/_posts/components/NURBS/NurbsSurfaceInterpolator.md +31 -11
- package/docs/_posts/components/NURBS/NurbsSweptSurface.md +31 -14
- package/docs/_posts/components/NURBS/NurbsSwungSurface.md +25 -14
- package/docs/_posts/components/NURBS/NurbsTextureCoordinate.md +11 -7
- package/docs/_posts/components/NURBS/NurbsTrimmedSurface.md +26 -16
- package/docs/_posts/components/Navigation/Billboard.md +33 -17
- package/docs/_posts/components/Navigation/Collision.md +59 -22
- package/docs/_posts/components/Navigation/LOD.md +53 -23
- package/docs/_posts/components/Navigation/NavigationInfo.md +68 -25
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +80 -37
- package/docs/_posts/components/Navigation/Viewpoint.md +86 -39
- package/docs/_posts/components/Navigation/ViewpointGroup.md +28 -17
- package/docs/_posts/components/Networking/Anchor.md +54 -56
- package/docs/_posts/components/Networking/Inline.md +42 -29
- package/docs/_posts/components/Networking/LoadSensor.md +41 -9
- package/docs/_posts/components/ParticleSystems/BoundedPhysicsModel.md +16 -8
- package/docs/_posts/components/ParticleSystems/ConeEmitter.md +25 -10
- package/docs/_posts/components/ParticleSystems/ExplosionEmitter.md +18 -11
- package/docs/_posts/components/ParticleSystems/ForcePhysicsModel.md +15 -8
- package/docs/_posts/components/ParticleSystems/ParticleSystem.md +92 -46
- package/docs/_posts/components/ParticleSystems/PointEmitter.md +19 -12
- package/docs/_posts/components/ParticleSystems/PolylineEmitter.md +23 -15
- package/docs/_posts/components/ParticleSystems/SurfaceEmitter.md +21 -14
- package/docs/_posts/components/ParticleSystems/VolumeEmitter.md +25 -18
- package/docs/_posts/components/ParticleSystems/WindPhysicsModel.md +11 -7
- package/docs/_posts/components/Picking/LinePickSensor.md +37 -15
- package/docs/_posts/components/Picking/PickableGroup.md +40 -22
- package/docs/_posts/components/Picking/PointPickSensor.md +29 -12
- package/docs/_posts/components/Picking/PrimitivePickSensor.md +25 -17
- package/docs/_posts/components/Picking/VolumePickSensor.md +25 -12
- package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +43 -18
- package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +40 -17
- package/docs/_posts/components/PointingDeviceSensor/SphereSensor.md +35 -13
- package/docs/_posts/components/PointingDeviceSensor/TouchSensor.md +48 -14
- package/docs/_posts/components/Rendering/ClipPlane.md +20 -15
- package/docs/_posts/components/Rendering/Color.md +14 -14
- package/docs/_posts/components/Rendering/ColorRGBA.md +13 -9
- package/docs/_posts/components/Rendering/Coordinate.md +11 -7
- package/docs/_posts/components/Rendering/IndexedLineSet.md +58 -24
- package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +44 -23
- package/docs/_posts/components/Rendering/IndexedTriangleSet.md +45 -24
- package/docs/_posts/components/Rendering/IndexedTriangleStripSet.md +45 -20
- package/docs/_posts/components/Rendering/LineSet.md +26 -14
- package/docs/_posts/components/Rendering/Normal.md +28 -6
- package/docs/_posts/components/Rendering/PointSet.md +24 -11
- package/docs/_posts/components/Rendering/TriangleFanSet.md +44 -19
- package/docs/_posts/components/Rendering/TriangleSet.md +44 -19
- package/docs/_posts/components/Rendering/TriangleStripSet.md +45 -20
- package/docs/_posts/components/RigidBodyPhysics/BallJoint.md +22 -10
- package/docs/_posts/components/RigidBodyPhysics/CollidableOffset.md +37 -14
- package/docs/_posts/components/RigidBodyPhysics/CollidableShape.md +34 -16
- package/docs/_posts/components/RigidBodyPhysics/CollisionCollection.md +17 -12
- package/docs/_posts/components/RigidBodyPhysics/CollisionSensor.md +21 -12
- package/docs/_posts/components/RigidBodyPhysics/CollisionSpace.md +31 -12
- package/docs/_posts/components/RigidBodyPhysics/Contact.md +19 -15
- package/docs/_posts/components/RigidBodyPhysics/DoubleAxisHingeJoint.md +33 -27
- package/docs/_posts/components/RigidBodyPhysics/MotorJoint.md +63 -11
- package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +22 -12
- package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +30 -14
- package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +26 -14
- package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +24 -12
- package/docs/_posts/components/RigidBodyPhysics/UniversalJoint.md +23 -15
- package/docs/_posts/components/Scripting/Script.md +43 -27
- package/docs/_posts/components/Shaders/ComposedShader.md +30 -17
- package/docs/_posts/components/Shaders/FloatVertexAttribute.md +18 -9
- package/docs/_posts/components/Shaders/Matrix3VertexAttribute.md +17 -8
- package/docs/_posts/components/Shaders/Matrix4VertexAttribute.md +17 -8
- package/docs/_posts/components/Shaders/PackagedShader.md +36 -30
- package/docs/_posts/components/Shaders/ProgramShader.md +35 -15
- package/docs/_posts/components/Shaders/ShaderPart.md +27 -18
- package/docs/_posts/components/Shaders/ShaderProgram.md +28 -17
- package/docs/_posts/components/Shape/AcousticProperties.md +34 -6
- package/docs/_posts/components/Shape/Appearance.md +29 -22
- package/docs/_posts/components/Shape/FillProperties.md +19 -12
- package/docs/_posts/components/Shape/LineProperties.md +18 -10
- package/docs/_posts/components/Shape/Material.md +64 -38
- package/docs/_posts/components/Shape/PhysicalMaterial.md +49 -25
- package/docs/_posts/components/Shape/PointProperties.md +21 -14
- package/docs/_posts/components/Shape/Shape.md +35 -17
- package/docs/_posts/components/Shape/TwoSidedMaterial.md +35 -36
- package/docs/_posts/components/Shape/UnlitMaterial.md +29 -17
- package/docs/_posts/components/Sound/Analyser.md +133 -4
- package/docs/_posts/components/Sound/AudioClip.md +64 -30
- package/docs/_posts/components/Sound/AudioDestination.md +76 -4
- package/docs/_posts/components/Sound/BiquadFilter.md +143 -4
- package/docs/_posts/components/Sound/BufferAudioSource.md +165 -13
- package/docs/_posts/components/Sound/ChannelMerger.md +62 -4
- package/docs/_posts/components/Sound/ChannelSelector.md +64 -4
- package/docs/_posts/components/Sound/ChannelSplitter.md +68 -4
- package/docs/_posts/components/Sound/Convolver.md +124 -4
- package/docs/_posts/components/Sound/Delay.md +119 -4
- package/docs/_posts/components/Sound/DynamicsCompressor.md +127 -4
- package/docs/_posts/components/Sound/Gain.md +115 -4
- package/docs/_posts/components/Sound/ListenerPointSource.md +109 -4
- package/docs/_posts/components/Sound/MicrophoneSource.md +91 -4
- package/docs/_posts/components/Sound/OscillatorSource.md +95 -4
- package/docs/_posts/components/Sound/PeriodicWave.md +43 -5
- package/docs/_posts/components/Sound/Sound.md +53 -20
- package/docs/_posts/components/Sound/SpatialSound.md +120 -4
- package/docs/_posts/components/Sound/StreamAudioDestination.md +80 -4
- package/docs/_posts/components/Sound/StreamAudioSource.md +91 -4
- package/docs/_posts/components/Sound/WaveShaper.md +123 -4
- package/docs/_posts/components/Text/FontStyle.md +73 -47
- package/docs/_posts/components/Text/Text.md +48 -26
- package/docs/_posts/components/TextureProjector/TextureProjector.md +55 -6
- package/docs/_posts/components/TextureProjector/TextureProjectorParallel.md +56 -6
- package/docs/_posts/components/Texturing/ImageTexture.md +28 -20
- package/docs/_posts/components/Texturing/MovieTexture.md +69 -38
- package/docs/_posts/components/Texturing/MultiTexture.md +47 -19
- package/docs/_posts/components/Texturing/MultiTextureCoordinate.md +27 -10
- package/docs/_posts/components/Texturing/MultiTextureTransform.md +32 -10
- package/docs/_posts/components/Texturing/PixelTexture.md +34 -14
- package/docs/_posts/components/Texturing/TextureCoordinate.md +20 -10
- package/docs/_posts/components/Texturing/TextureCoordinateGenerator.md +22 -12
- package/docs/_posts/components/Texturing/TextureProperties.md +44 -19
- package/docs/_posts/components/Texturing/TextureTransform.md +17 -8
- package/docs/_posts/components/Texturing3D/ComposedTexture3D.md +21 -13
- package/docs/_posts/components/Texturing3D/ImageTexture3D.md +32 -23
- package/docs/_posts/components/Texturing3D/ImageTextureAtlas.md +22 -16
- package/docs/_posts/components/Texturing3D/PixelTexture3D.md +25 -13
- package/docs/_posts/components/Texturing3D/TextureCoordinate3D.md +22 -10
- package/docs/_posts/components/Texturing3D/TextureCoordinate4D.md +21 -9
- package/docs/_posts/components/Texturing3D/TextureTransform3D.md +17 -8
- package/docs/_posts/components/Texturing3D/TextureTransformMatrix3D.md +20 -10
- package/docs/_posts/components/Time/TimeSensor.md +66 -23
- package/docs/_posts/components/VolumeRendering/BlendedVolumeStyle.md +36 -15
- package/docs/_posts/components/VolumeRendering/BoundaryEnhancementVolumeStyle.md +15 -5
- package/docs/_posts/components/VolumeRendering/CartoonVolumeStyle.md +20 -17
- package/docs/_posts/components/VolumeRendering/ComposedVolumeStyle.md +15 -7
- package/docs/_posts/components/VolumeRendering/EdgeEnhancementVolumeStyle.md +16 -8
- package/docs/_posts/components/VolumeRendering/IsoSurfaceVolumeData.md +43 -21
- package/docs/_posts/components/VolumeRendering/OpacityMapVolumeStyle.md +16 -8
- package/docs/_posts/components/VolumeRendering/ProjectionVolumeStyle.md +17 -7
- package/docs/_posts/components/VolumeRendering/SegmentedVolumeData.md +50 -17
- package/docs/_posts/components/VolumeRendering/ShadedVolumeStyle.md +18 -10
- package/docs/_posts/components/VolumeRendering/SilhouetteEnhancementVolumeStyle.md +16 -8
- package/docs/_posts/components/VolumeRendering/ToneMappedVolumeStyle.md +20 -11
- package/docs/_posts/components/VolumeRendering/VolumeData.md +32 -15
- package/docs/_posts/components/X_ITE/BlendMode.md +9 -2
- package/docs/_posts/getting-started.md +1 -0
- package/docs/_posts/laboratory/x3d-file-converter.md +1 -1
- package/package.json +1 -1
- package/src/x_ite/Browser/Core/X3DCoreContext.js +10 -3
- package/src/x_ite/Browser/DOMIntegration.js +13 -8
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +1 -1
- package/src/x_ite/Components/DIS/DISEntityManager.js +1 -1
- package/src/x_ite/Components/Grouping/Switch.js +1 -1
- package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -1
- package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
- package/src/x_ite/Components/Navigation/Collision.js +1 -1
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +1 -1
- package/src/x_ite/Components/Networking/LoadSensor.js +1 -1
- package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +1 -1
- package/src/x_ite/Components/Shape/AcousticProperties.js +1 -1
- package/src/x_ite/Components/Shape/Appearance.js +1 -1
- package/src/x_ite/Components/Shape/Material.js +1 -1
- package/src/x_ite/Components/Shape/TwoSidedMaterial.js +1 -1
- package/src/x_ite/Components/Sound/PeriodicWave.js +1 -1
- package/src/x_ite/Components/Texturing/TextureProperties.js +1 -1
- package/src/x_ite/Fields/ArrayFields.js +2 -2
- package/src/x_ite/Fields/SFColor.js +1 -1
- package/src/x_ite/Fields/SFMatrixPrototypeTemplate.js +1 -1
- package/src/x_ite/Fields/SFRotation.js +3 -3
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +1 -1
- package/src/x_ite/Parser/GoldenGate.js +16 -5
- package/src/x_ite/Parser/PLYAParser.js +615 -0
- package/src/x_ite/Parser/PLYBParser.js +222 -0
- package/src/x_ite/Parser/STLAParser.js +0 -1
- /package/build/{bin → docs}/components.js +0 -0
|
@@ -0,0 +1,615 @@
|
|
|
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 Expressions from "./Expressions.js";
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
* Grammar
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
// Lexical elements
|
|
56
|
+
const Grammar = Expressions ({
|
|
57
|
+
// General
|
|
58
|
+
whitespaces: /[\x20\n\t\r]+/gy,
|
|
59
|
+
whitespacesNoLineTerminator: /[\x20\t]+/gy,
|
|
60
|
+
untilEndOfLine: /([^\r\n]+)/gy,
|
|
61
|
+
line: /.*?\r?\n/gy,
|
|
62
|
+
|
|
63
|
+
// Keywords
|
|
64
|
+
ply: /ply/gy,
|
|
65
|
+
format: /format ascii 1.0/gy,
|
|
66
|
+
comment: /\bcomment\b/gy,
|
|
67
|
+
element: /\belement\b/gy,
|
|
68
|
+
elementName: /\b(\S+)\b/gy,
|
|
69
|
+
property: /\bproperty\b/gy,
|
|
70
|
+
propertyList: /\blist\b/gy,
|
|
71
|
+
propertyType: /\b(char|uchar|short|ushort|int|uint|float|double|int8|uint8|int16|uint16|int32|uint32|float32|float64)\b/gy,
|
|
72
|
+
propertyName: /\b(\S+)\b/gy,
|
|
73
|
+
endHeader: /\bend_header\b/gy,
|
|
74
|
+
|
|
75
|
+
double: /([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,
|
|
76
|
+
int32: /((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/gy,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
* Parser
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
function PLYAParser (scene)
|
|
84
|
+
{
|
|
85
|
+
X3DParser .call (this, scene);
|
|
86
|
+
|
|
87
|
+
this .comments = [ ];
|
|
88
|
+
this .attrib = [ ];
|
|
89
|
+
|
|
90
|
+
this .typeMapping = new Map ([
|
|
91
|
+
["char", this .int32],
|
|
92
|
+
["uchar", this .int32],
|
|
93
|
+
["short", this .int32],
|
|
94
|
+
["ushort", this .int32],
|
|
95
|
+
["int", this .int32],
|
|
96
|
+
["uint", this .int32],
|
|
97
|
+
["float", this .double],
|
|
98
|
+
["double", this .double],
|
|
99
|
+
["int8", this .int32],
|
|
100
|
+
["uint8", this .int32],
|
|
101
|
+
["int16", this .int32],
|
|
102
|
+
["uint16", this .int32],
|
|
103
|
+
["int32", this .int32],
|
|
104
|
+
["uint32", this .int32],
|
|
105
|
+
["float32", this .double],
|
|
106
|
+
["float64", this .double],
|
|
107
|
+
]);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
Object .assign (Object .setPrototypeOf (PLYAParser .prototype, X3DParser .prototype),
|
|
111
|
+
{
|
|
112
|
+
getEncoding ()
|
|
113
|
+
{
|
|
114
|
+
return "STRING";
|
|
115
|
+
},
|
|
116
|
+
setInput (input)
|
|
117
|
+
{
|
|
118
|
+
this .input = input;
|
|
119
|
+
},
|
|
120
|
+
isValid ()
|
|
121
|
+
{
|
|
122
|
+
return this .input .match (/^ply\r?\nformat ascii 1.0/);
|
|
123
|
+
},
|
|
124
|
+
parseIntoScene (resolve, reject)
|
|
125
|
+
{
|
|
126
|
+
this .ply ()
|
|
127
|
+
.then (resolve)
|
|
128
|
+
.catch (reject);
|
|
129
|
+
},
|
|
130
|
+
ply: async function ()
|
|
131
|
+
{
|
|
132
|
+
// Set profile and components.
|
|
133
|
+
|
|
134
|
+
const
|
|
135
|
+
browser = this .getBrowser (),
|
|
136
|
+
scene = this .getScene ();
|
|
137
|
+
|
|
138
|
+
scene .setEncoding ("PLY");
|
|
139
|
+
scene .setProfile (browser .getProfile ("Interchange"));
|
|
140
|
+
|
|
141
|
+
await this .loadComponents ();
|
|
142
|
+
await this .processElements (this .header ([ ]))
|
|
143
|
+
|
|
144
|
+
// Create nodes.
|
|
145
|
+
|
|
146
|
+
return this .getScene ();
|
|
147
|
+
},
|
|
148
|
+
whitespacesOrComments ()
|
|
149
|
+
{
|
|
150
|
+
while (this .whitespaces () || this .comment ())
|
|
151
|
+
;
|
|
152
|
+
},
|
|
153
|
+
whitespaces ()
|
|
154
|
+
{
|
|
155
|
+
return Grammar .whitespaces .parse (this);
|
|
156
|
+
},
|
|
157
|
+
whitespacesNoLineTerminator ()
|
|
158
|
+
{
|
|
159
|
+
Grammar .whitespacesNoLineTerminator .parse (this);
|
|
160
|
+
},
|
|
161
|
+
comment ()
|
|
162
|
+
{
|
|
163
|
+
if (Grammar .comment .parse (this) && Grammar .untilEndOfLine .parse (this))
|
|
164
|
+
{
|
|
165
|
+
this .comments .push (this .result [1] .trim ());
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return false;
|
|
170
|
+
},
|
|
171
|
+
double ()
|
|
172
|
+
{
|
|
173
|
+
this .whitespacesNoLineTerminator ();
|
|
174
|
+
|
|
175
|
+
if (Grammar .double .parse (this))
|
|
176
|
+
{
|
|
177
|
+
this .value = parseFloat (this .result [1]);
|
|
178
|
+
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return false;
|
|
183
|
+
},
|
|
184
|
+
int32 ()
|
|
185
|
+
{
|
|
186
|
+
this .whitespacesNoLineTerminator ();
|
|
187
|
+
|
|
188
|
+
if (Grammar .int32 .parse (this))
|
|
189
|
+
{
|
|
190
|
+
this .value = parseInt (this .result [1]);
|
|
191
|
+
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return false;
|
|
196
|
+
},
|
|
197
|
+
convertColor (value, type)
|
|
198
|
+
{
|
|
199
|
+
switch (type)
|
|
200
|
+
{
|
|
201
|
+
case "uchar":
|
|
202
|
+
case "uint8":
|
|
203
|
+
return value / 0xff;
|
|
204
|
+
case "ushort":
|
|
205
|
+
case "uint16":
|
|
206
|
+
return value / 0xfffff;
|
|
207
|
+
case "uint":
|
|
208
|
+
case "uint32":
|
|
209
|
+
return value / 0xffffffff;
|
|
210
|
+
case "float":
|
|
211
|
+
case "float32":
|
|
212
|
+
case "double":
|
|
213
|
+
case "float64":
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
header (elements)
|
|
218
|
+
{
|
|
219
|
+
Grammar .ply .parse (this);
|
|
220
|
+
Grammar .whitespaces .parse (this);
|
|
221
|
+
Grammar .format .parse (this);
|
|
222
|
+
|
|
223
|
+
this .headings (elements);
|
|
224
|
+
|
|
225
|
+
const
|
|
226
|
+
scene = this .getScene (),
|
|
227
|
+
worldInfo = scene .createNode ("WorldInfo");
|
|
228
|
+
|
|
229
|
+
worldInfo .title = new URL (scene .worldURL) .pathname .split ('/') .at (-1);
|
|
230
|
+
worldInfo .info = this .comments;
|
|
231
|
+
|
|
232
|
+
scene .rootNodes .push (worldInfo);
|
|
233
|
+
|
|
234
|
+
return elements;
|
|
235
|
+
},
|
|
236
|
+
headings (elements)
|
|
237
|
+
{
|
|
238
|
+
while (this .head (elements))
|
|
239
|
+
;
|
|
240
|
+
},
|
|
241
|
+
head (elements)
|
|
242
|
+
{
|
|
243
|
+
if (this .element (elements))
|
|
244
|
+
return true;
|
|
245
|
+
|
|
246
|
+
if (Grammar .endHeader .parse (this))
|
|
247
|
+
return false;
|
|
248
|
+
|
|
249
|
+
if (Grammar .untilEndOfLine .parse (this))
|
|
250
|
+
return true;
|
|
251
|
+
|
|
252
|
+
return false;
|
|
253
|
+
},
|
|
254
|
+
element (elements)
|
|
255
|
+
{
|
|
256
|
+
this .whitespacesOrComments ();
|
|
257
|
+
|
|
258
|
+
if (Grammar .element .parse (this))
|
|
259
|
+
{
|
|
260
|
+
this .whitespacesNoLineTerminator ();
|
|
261
|
+
|
|
262
|
+
if (Grammar .elementName .parse (this))
|
|
263
|
+
{
|
|
264
|
+
const name = this .result [1];
|
|
265
|
+
|
|
266
|
+
if (this .int32 ())
|
|
267
|
+
{
|
|
268
|
+
const element =
|
|
269
|
+
{
|
|
270
|
+
name: name,
|
|
271
|
+
count: this .value,
|
|
272
|
+
properties: [ ],
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
this .properties (element .properties);
|
|
276
|
+
|
|
277
|
+
elements .push (element);
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return false;
|
|
284
|
+
},
|
|
285
|
+
properties (properties)
|
|
286
|
+
{
|
|
287
|
+
while (this .property (properties))
|
|
288
|
+
;
|
|
289
|
+
},
|
|
290
|
+
property (properties)
|
|
291
|
+
{
|
|
292
|
+
this .whitespacesOrComments ();
|
|
293
|
+
|
|
294
|
+
if (Grammar .property .parse (this))
|
|
295
|
+
{
|
|
296
|
+
this .whitespacesNoLineTerminator ();
|
|
297
|
+
|
|
298
|
+
if (Grammar .propertyType .parse (this))
|
|
299
|
+
{
|
|
300
|
+
const
|
|
301
|
+
type = this .result [1],
|
|
302
|
+
value = this .typeMapping .get (type);
|
|
303
|
+
|
|
304
|
+
this .whitespacesNoLineTerminator ();
|
|
305
|
+
|
|
306
|
+
if (Grammar .propertyName .parse (this))
|
|
307
|
+
{
|
|
308
|
+
const name = this .result [1];
|
|
309
|
+
|
|
310
|
+
properties .push ({ type, value, name });
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (Grammar .propertyList .parse (this))
|
|
316
|
+
{
|
|
317
|
+
this .whitespacesNoLineTerminator ();
|
|
318
|
+
|
|
319
|
+
if (Grammar .propertyType .parse (this))
|
|
320
|
+
{
|
|
321
|
+
const count = this .typeMapping .get (this .result [1]);
|
|
322
|
+
|
|
323
|
+
this .whitespacesNoLineTerminator ();
|
|
324
|
+
|
|
325
|
+
if (Grammar .propertyType .parse (this))
|
|
326
|
+
{
|
|
327
|
+
const
|
|
328
|
+
type = this .result [1],
|
|
329
|
+
value = this .typeMapping .get (type);
|
|
330
|
+
|
|
331
|
+
this .whitespacesNoLineTerminator ();
|
|
332
|
+
|
|
333
|
+
if (Grammar .propertyName .parse (this))
|
|
334
|
+
{
|
|
335
|
+
const name = this .result [1];
|
|
336
|
+
|
|
337
|
+
properties .push ({ count, type, value, name });
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return false;
|
|
346
|
+
},
|
|
347
|
+
async processElements (elements)
|
|
348
|
+
{
|
|
349
|
+
// console .log (elements)
|
|
350
|
+
|
|
351
|
+
for (const element of elements)
|
|
352
|
+
await this .processElement (element);
|
|
353
|
+
|
|
354
|
+
if (!this .coord)
|
|
355
|
+
return;
|
|
356
|
+
|
|
357
|
+
const
|
|
358
|
+
scene = this .getScene (),
|
|
359
|
+
shape = scene .createNode ("Shape"),
|
|
360
|
+
appearance = scene .createNode ("Appearance"),
|
|
361
|
+
material = scene .createNode (this .geometry ? "Material" : "UnlitMaterial"),
|
|
362
|
+
geometry = this .geometry ?? scene .createNode ("PointSet");
|
|
363
|
+
|
|
364
|
+
appearance .material = material;
|
|
365
|
+
|
|
366
|
+
if (this .texCoord)
|
|
367
|
+
{
|
|
368
|
+
const textureTransform = scene .createNode ("TextureTransform");
|
|
369
|
+
|
|
370
|
+
textureTransform .translation .y = -1;
|
|
371
|
+
textureTransform .scale .y = -1;
|
|
372
|
+
|
|
373
|
+
appearance .textureTransform = textureTransform;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (geometry .getNodeTypeName () !== "PointSet")
|
|
377
|
+
{
|
|
378
|
+
geometry .solid = false;
|
|
379
|
+
geometry .texCoord = this .texCoord;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
geometry .attrib = this .attrib;
|
|
383
|
+
geometry .color = this .color;
|
|
384
|
+
geometry .normal = this .normal;
|
|
385
|
+
geometry .coord = this .coord;
|
|
386
|
+
|
|
387
|
+
shape .appearance = appearance;
|
|
388
|
+
shape .geometry = geometry;
|
|
389
|
+
|
|
390
|
+
scene .rootNodes .push (shape);
|
|
391
|
+
},
|
|
392
|
+
async processElement (element)
|
|
393
|
+
{
|
|
394
|
+
switch (element .name)
|
|
395
|
+
{
|
|
396
|
+
case "vertex":
|
|
397
|
+
await this .parseVertices (element);
|
|
398
|
+
break;
|
|
399
|
+
case "face":
|
|
400
|
+
this .parseFaces (element);
|
|
401
|
+
break;
|
|
402
|
+
case "multi_texture_vertex":
|
|
403
|
+
this .parseMultiTextureVertices (element);
|
|
404
|
+
break;
|
|
405
|
+
case "multi_texture_face":
|
|
406
|
+
this .parseMultiTextureFaces (element);
|
|
407
|
+
break;
|
|
408
|
+
default:
|
|
409
|
+
this .parseUnknown (element);
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
async parseVertices ({ count, properties })
|
|
414
|
+
{
|
|
415
|
+
const
|
|
416
|
+
scene = this .getScene (),
|
|
417
|
+
colors = [ ],
|
|
418
|
+
texCoord = scene .createNode ("TextureCoordinate"),
|
|
419
|
+
texCoords = [ ],
|
|
420
|
+
normal = scene .createNode ("Normal"),
|
|
421
|
+
normals = [ ],
|
|
422
|
+
coord = scene .createNode ("Coordinate"),
|
|
423
|
+
points = [ ],
|
|
424
|
+
attributes = new Map ();
|
|
425
|
+
|
|
426
|
+
for (const { name } of properties)
|
|
427
|
+
{
|
|
428
|
+
if (name .match (/^(?:red|green|blue|alpha|r|g|b|a|s|t|u|v|nx|ny|nz|x|y|z)$/))
|
|
429
|
+
continue;
|
|
430
|
+
|
|
431
|
+
attributes .set (name, [ ]);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// console .time ("vertices")
|
|
435
|
+
|
|
436
|
+
for (let i = 0; i < count; ++ i)
|
|
437
|
+
{
|
|
438
|
+
this .whitespaces ();
|
|
439
|
+
|
|
440
|
+
for (const { value, name, type } of properties)
|
|
441
|
+
{
|
|
442
|
+
if (!value .call (this))
|
|
443
|
+
throw new Error (`Couldn't parse value for property ${name}.`);
|
|
444
|
+
|
|
445
|
+
switch (name)
|
|
446
|
+
{
|
|
447
|
+
default:
|
|
448
|
+
attributes .get (name) .push (this .value);
|
|
449
|
+
break;
|
|
450
|
+
case "red": case "green": case "blue": case "alpha":
|
|
451
|
+
case "r": case "g": case "b": case "a":
|
|
452
|
+
colors .push (this .convertColor (this .value, type));
|
|
453
|
+
break;
|
|
454
|
+
case "s": case "t":
|
|
455
|
+
case "u": case "v":
|
|
456
|
+
texCoords .push (this .value);
|
|
457
|
+
break;
|
|
458
|
+
case "nx": case "ny": case "nz":
|
|
459
|
+
normals .push (this .value);
|
|
460
|
+
break;
|
|
461
|
+
case "x": case "y": case "z":
|
|
462
|
+
points .push (this .value);
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// console .timeEnd ("vertices")
|
|
469
|
+
|
|
470
|
+
// Attributes
|
|
471
|
+
|
|
472
|
+
if (attributes .size)
|
|
473
|
+
{
|
|
474
|
+
scene .addComponent (this .getBrowser () .getComponent ("Shaders", 1));
|
|
475
|
+
|
|
476
|
+
await this .loadComponents ();
|
|
477
|
+
|
|
478
|
+
for (const [name, value] of attributes)
|
|
479
|
+
{
|
|
480
|
+
const floatVertexAttribute = scene .createNode ("FloatVertexAttribute");
|
|
481
|
+
|
|
482
|
+
floatVertexAttribute .name = name;
|
|
483
|
+
floatVertexAttribute .numComponents = 1;
|
|
484
|
+
floatVertexAttribute .value = value;
|
|
485
|
+
|
|
486
|
+
this .attrib .push (floatVertexAttribute);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// Geometric properties
|
|
491
|
+
|
|
492
|
+
const
|
|
493
|
+
pAlpha = properties .some (p => p .name .match (/^(?:alpha|a)$/)),
|
|
494
|
+
alpha = pAlpha && colors .some ((v, i) => i % 4 === 3 && v < 1),
|
|
495
|
+
color = scene .createNode (alpha ? "ColorRGBA" : "Color");
|
|
496
|
+
|
|
497
|
+
color .color = alpha || !pAlpha ? colors : colors .filter ((v, i) => i % 4 !== 3);
|
|
498
|
+
texCoord .point = texCoords;
|
|
499
|
+
normal .vector = normals;
|
|
500
|
+
coord .point = points;
|
|
501
|
+
|
|
502
|
+
this .color = colors .length ? color : null;
|
|
503
|
+
this .texCoord = texCoords .length ? texCoord : null;
|
|
504
|
+
this .normal = normals .length ? normal : null;
|
|
505
|
+
this .coord = coord;
|
|
506
|
+
},
|
|
507
|
+
parseFaces ({ count, properties })
|
|
508
|
+
{
|
|
509
|
+
const
|
|
510
|
+
scene = this .getScene (),
|
|
511
|
+
geometry = scene .createNode ("IndexedFaceSet"),
|
|
512
|
+
coordIndex = [ ];
|
|
513
|
+
|
|
514
|
+
for (let i = 0; i < count; ++ i)
|
|
515
|
+
{
|
|
516
|
+
this .whitespaces ();
|
|
517
|
+
|
|
518
|
+
for (const { count, value, name } of properties)
|
|
519
|
+
{
|
|
520
|
+
if (!count .call (this))
|
|
521
|
+
throw new Error (`Couldn't parse property count for ${name}.`);
|
|
522
|
+
|
|
523
|
+
const length = this .value;
|
|
524
|
+
|
|
525
|
+
for (let i = 0; i < length; ++ i)
|
|
526
|
+
{
|
|
527
|
+
if (!value .call (this))
|
|
528
|
+
throw new Error (`Couldn't parse a property value for ${name}.`);
|
|
529
|
+
|
|
530
|
+
coordIndex .push (this .value);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
coordIndex .push (-1);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
geometry .coordIndex = coordIndex;
|
|
538
|
+
this .geometry = geometry;
|
|
539
|
+
},
|
|
540
|
+
parseMultiTextureVertices ({ count, properties })
|
|
541
|
+
{
|
|
542
|
+
const
|
|
543
|
+
scene = this .getScene (),
|
|
544
|
+
texCoord = scene .createNode ("TextureCoordinate"),
|
|
545
|
+
texCoords = [ ];
|
|
546
|
+
|
|
547
|
+
for (let i = 0; i < count; ++ i)
|
|
548
|
+
{
|
|
549
|
+
this .whitespaces ();
|
|
550
|
+
|
|
551
|
+
for (const { value, name } of properties)
|
|
552
|
+
{
|
|
553
|
+
if (!value .call (this))
|
|
554
|
+
throw new Error (`Couldn't parse value for property ${name}.`);
|
|
555
|
+
|
|
556
|
+
switch (name)
|
|
557
|
+
{
|
|
558
|
+
case "s": case "t":
|
|
559
|
+
case "u": case "v":
|
|
560
|
+
texCoords .push (this .value);
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
texCoord .point = texCoords;
|
|
567
|
+
|
|
568
|
+
this .texCoord = texCoords .length ? texCoord : null;
|
|
569
|
+
},
|
|
570
|
+
parseMultiTextureFaces ({ count, properties })
|
|
571
|
+
{
|
|
572
|
+
const texCoordIndex = [ ];
|
|
573
|
+
|
|
574
|
+
for (let i = 0; i < count; ++ i)
|
|
575
|
+
{
|
|
576
|
+
for (const { count, value, name } of properties)
|
|
577
|
+
{
|
|
578
|
+
if (count)
|
|
579
|
+
{
|
|
580
|
+
if (!count .call (this))
|
|
581
|
+
throw new Error (`Couldn't parse property count for ${name}.`);
|
|
582
|
+
|
|
583
|
+
const length = this .value;
|
|
584
|
+
|
|
585
|
+
for (let i = 0; i < length; ++ i)
|
|
586
|
+
{
|
|
587
|
+
if (!value .call (this))
|
|
588
|
+
throw new Error (`Couldn't parse value for property ${name}.`);
|
|
589
|
+
|
|
590
|
+
texCoordIndex .push (this .value);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
texCoordIndex .push (-1);
|
|
594
|
+
}
|
|
595
|
+
else
|
|
596
|
+
{
|
|
597
|
+
if (!value .call (this))
|
|
598
|
+
throw new Error (`Couldn't parse value for property ${name}.`);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
if (this .geometry)
|
|
604
|
+
this .geometry .texCoordIndex = texCoordIndex;
|
|
605
|
+
},
|
|
606
|
+
parseUnknown ({ count })
|
|
607
|
+
{
|
|
608
|
+
this .whitespaces ();
|
|
609
|
+
|
|
610
|
+
for (let i = 0; i < count; ++ i)
|
|
611
|
+
Grammar .line .parse (this);
|
|
612
|
+
},
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
export default PLYAParser;
|