x_ite 8.4.3 → 8.5.3
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/.vscode/settings.json +5 -1
- package/Makefile +0 -3
- package/build/bin/components.js +173 -0
- package/build/bin/tags.pl +28 -0
- package/build/bin/tests.pl +80 -2
- package/build/bin/version.pl +12 -7
- 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 +28 -29
- 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 +63 -42
- 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 +37 -29
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +29 -31
- 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 +19 -19
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +24 -19
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +30 -30
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +172 -594
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +31 -47
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +367 -346
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- 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 +12174 -3553
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +5 -136
- package/docs/_data/nav/components-CADGeometry.yml +14 -0
- package/docs/_data/nav/components-Core.yml +16 -0
- package/docs/_data/nav/components-CubeMapTexturing.yml +8 -0
- package/docs/_data/nav/components-DIS.yml +14 -0
- package/docs/_data/nav/components-EnvironmentalEffects.yml +12 -0
- package/docs/_data/nav/components-EnvironmentalSensor.yml +8 -0
- package/docs/_data/nav/components-EventUtilities.yml +16 -0
- package/docs/_data/nav/components-Followers.yml +30 -0
- package/docs/_data/nav/components-Geometry2D.yml +18 -0
- package/docs/_data/nav/components-Geometry3D.yml +16 -0
- package/docs/_data/nav/components-Geospatial.yml +24 -0
- package/docs/_data/nav/components-Grouping.yml +10 -0
- package/docs/_data/nav/components-HAnim.yml +14 -0
- package/docs/_data/nav/components-Interpolation.yml +28 -0
- package/docs/_data/nav/components-KeyDeviceSensor.yml +6 -0
- package/docs/_data/nav/components-Layering.yml +8 -0
- package/docs/_data/nav/components-Layout.yml +12 -0
- package/docs/_data/nav/components-Lighting.yml +10 -0
- package/docs/_data/nav/components-NURBS.yml +30 -0
- package/docs/_data/nav/components-Navigation.yml +16 -0
- package/docs/_data/nav/components-Networking.yml +8 -0
- package/docs/_data/nav/components-ParticleSystems.yml +22 -0
- package/docs/_data/nav/components-Picking.yml +12 -0
- package/docs/_data/nav/components-PointingDeviceSensor.yml +10 -0
- package/docs/_data/nav/components-Rendering.yml +30 -0
- package/docs/_data/nav/components-RigidBodyPhysics.yml +30 -0
- package/docs/_data/nav/components-Scripting.yml +4 -0
- package/docs/_data/nav/components-Shaders.yml +18 -0
- package/docs/_data/nav/components-Shape.yml +22 -0
- package/docs/_data/nav/components-Sound.yml +44 -0
- package/docs/_data/nav/components-Text.yml +6 -0
- package/docs/_data/nav/components-TextureProjector.yml +6 -0
- package/docs/_data/nav/components-Texturing.yml +22 -0
- package/docs/_data/nav/components-Texturing3D.yml +18 -0
- package/docs/_data/nav/components-Time.yml +4 -0
- package/docs/_data/nav/components-VolumeRendering.yml +28 -0
- package/docs/_data/nav/components-X_ITE.yml +4 -0
- package/docs/_data/nav/main.yml +26 -0
- package/docs/_data/nav/reference.yml +18 -0
- package/docs/_data/nav/tutorials-animation-sensors-and-geometry.yml +18 -0
- package/docs/_data/nav/tutorials-basic.yml +6 -0
- package/docs/_data/nav/tutorials-optimize-your-scene.yml +6 -0
- package/docs/_data/nav/tutorials-scripts-and-prototypes.yml +12 -0
- package/docs/_data/nav/tutorials-shapes-geometry-and-appearance.yml +16 -0
- package/docs/_data/nav/tutorials-textures-lights-and-environment.yml +20 -0
- package/docs/_includes/nav.html +2 -2
- package/docs/_includes/scripts.html +2 -1
- package/docs/_posts/accessing-the-external-browser.md +1 -1
- package/docs/_posts/browser-support.md +1 -1
- package/docs/_posts/components/CADGeometry/CADAssembly.md +83 -0
- package/docs/_posts/components/CADGeometry/CADFace.md +70 -0
- package/docs/_posts/components/CADGeometry/CADLayer.md +84 -0
- package/docs/_posts/components/CADGeometry/CADPart.md +117 -0
- package/docs/_posts/components/CADGeometry/IndexedQuadSet.md +125 -0
- package/docs/_posts/components/CADGeometry/QuadSet.md +113 -0
- package/docs/_posts/components/Core/MetadataBoolean.md +90 -0
- package/docs/_posts/components/Core/MetadataDouble.md +67 -0
- package/docs/_posts/components/Core/MetadataFloat.md +67 -0
- package/docs/_posts/components/Core/MetadataInteger.md +66 -0
- package/docs/_posts/components/Core/MetadataSet.md +63 -0
- package/docs/_posts/components/Core/MetadataString.md +66 -0
- package/docs/_posts/components/Core/WorldInfo.md +54 -0
- package/docs/_posts/components/CubeMapTexturing/ComposedCubeMapTexture.md +76 -0
- package/docs/_posts/components/CubeMapTexturing/GeneratedCubeMapTexture.md +65 -0
- package/docs/_posts/components/CubeMapTexturing/ImageCubeMapTexture.md +66 -0
- package/docs/_posts/components/DIS/DISEntityManager.md +73 -0
- package/docs/_posts/components/DIS/DISEntityTypeMapping.md +88 -0
- package/docs/_posts/components/DIS/EspduTransform.md +416 -0
- package/docs/_posts/components/DIS/ReceiverPdu.md +168 -0
- package/docs/_posts/components/DIS/SignalPdu.md +168 -0
- package/docs/_posts/components/DIS/TransmitterPdu.md +232 -0
- package/docs/_posts/components/EnvironmentalEffects/Background.md +189 -0
- package/docs/_posts/components/EnvironmentalEffects/Fog.md +97 -0
- package/docs/_posts/components/EnvironmentalEffects/FogCoordinate.md +40 -0
- package/docs/_posts/components/EnvironmentalEffects/LocalFog.md +84 -0
- package/docs/_posts/components/EnvironmentalEffects/TextureBackground.md +142 -0
- package/docs/_posts/components/EnvironmentalSensor/ProximitySensor.md +90 -0
- package/docs/_posts/components/EnvironmentalSensor/TransformSensor.md +91 -0
- package/docs/_posts/components/EnvironmentalSensor/VisibilitySensor.md +73 -0
- package/docs/_posts/components/EventUtilities/BooleanFilter.md +62 -0
- package/docs/_posts/components/EventUtilities/BooleanSequencer.md +86 -0
- package/docs/_posts/components/EventUtilities/BooleanToggle.md +46 -0
- package/docs/_posts/components/EventUtilities/BooleanTrigger.md +47 -0
- package/docs/_posts/components/EventUtilities/IntegerSequencer.md +90 -0
- package/docs/_posts/components/EventUtilities/IntegerTrigger.md +51 -0
- package/docs/_posts/components/EventUtilities/TimeTrigger.md +47 -0
- package/docs/_posts/components/Followers/ColorChaser.md +77 -0
- package/docs/_posts/components/Followers/ColorDamper.md +85 -0
- package/docs/_posts/components/Followers/CoordinateChaser.md +76 -0
- package/docs/_posts/components/Followers/CoordinateDamper.md +80 -0
- package/docs/_posts/components/Followers/OrientationChaser.md +72 -0
- package/docs/_posts/components/Followers/OrientationDamper.md +80 -0
- package/docs/_posts/components/Followers/PositionChaser.md +72 -0
- package/docs/_posts/components/Followers/PositionChaser2D.md +72 -0
- package/docs/_posts/components/Followers/PositionDamper.md +80 -0
- package/docs/_posts/components/Followers/PositionDamper2D.md +80 -0
- package/docs/_posts/components/Followers/ScalarChaser.md +76 -0
- package/docs/_posts/components/Followers/ScalarDamper.md +80 -0
- package/docs/_posts/components/Followers/TexCoordChaser2D.md +72 -0
- package/docs/_posts/components/Followers/TexCoordDamper2D.md +80 -0
- package/docs/_posts/components/Geometry2D/Arc2D.md +71 -0
- package/docs/_posts/components/Geometry2D/ArcClose2D.md +91 -0
- package/docs/_posts/components/Geometry2D/Circle2D.md +55 -0
- package/docs/_posts/components/Geometry2D/Disk2D.md +75 -0
- package/docs/_posts/components/Geometry2D/Polyline2D.md +54 -0
- package/docs/_posts/components/Geometry2D/Polypoint2D.md +54 -0
- package/docs/_posts/components/Geometry2D/Rectangle2D.md +66 -0
- package/docs/_posts/components/Geometry2D/TriangleSet2D.md +66 -0
- package/docs/_posts/components/Geometry3D/Box.md +66 -0
- package/docs/_posts/components/Geometry3D/Cone.md +90 -0
- package/docs/_posts/components/Geometry3D/Cylinder.md +98 -0
- package/docs/_posts/components/Geometry3D/ElevationGrid.md +162 -0
- package/docs/_posts/components/Geometry3D/Extrusion.md +170 -0
- package/docs/_posts/components/Geometry3D/IndexedFaceSet.md +208 -0
- package/docs/_posts/components/Geometry3D/Sphere.md +66 -0
- package/docs/_posts/components/Geospatial/GeoCoordinate.md +65 -0
- package/docs/_posts/components/Geospatial/GeoElevationGrid.md +180 -0
- package/docs/_posts/components/Geospatial/GeoLOD.md +128 -0
- package/docs/_posts/components/Geospatial/GeoLocation.md +93 -0
- package/docs/_posts/components/Geospatial/GeoMetadata.md +75 -0
- package/docs/_posts/components/Geospatial/GeoOrigin.md +69 -0
- package/docs/_posts/components/Geospatial/GeoPositionInterpolator.md +95 -0
- package/docs/_posts/components/Geospatial/GeoProximitySensor.md +109 -0
- package/docs/_posts/components/Geospatial/GeoTouchSensor.md +108 -0
- package/docs/_posts/components/Geospatial/GeoTransform.md +121 -0
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +126 -0
- package/docs/_posts/components/Grouping/Group.md +75 -0
- package/docs/_posts/components/Grouping/StaticGroup.md +65 -0
- package/docs/_posts/components/Grouping/Switch.md +89 -0
- package/docs/_posts/components/Grouping/Transform.md +126 -0
- package/docs/_posts/components/HAnim/HAnimDisplacer.md +89 -0
- package/docs/_posts/components/HAnim/HAnimHumanoid.md +136 -0
- package/docs/_posts/components/HAnim/HAnimJoint.md +165 -0
- package/docs/_posts/components/HAnim/HAnimMotion.md +68 -0
- package/docs/_posts/components/HAnim/HAnimSegment.md +107 -0
- package/docs/_posts/components/HAnim/HAnimSite.md +108 -0
- package/docs/_posts/components/Interpolation/ColorInterpolator.md +73 -0
- package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +76 -0
- package/docs/_posts/components/Interpolation/CoordinateInterpolator2D.md +73 -0
- package/docs/_posts/components/Interpolation/EaseInEaseOut.md +67 -0
- package/docs/_posts/components/Interpolation/NormalInterpolator.md +68 -0
- package/docs/_posts/components/Interpolation/OrientationInterpolator.md +72 -0
- package/docs/_posts/components/Interpolation/PositionInterpolator.md +72 -0
- package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +77 -0
- package/docs/_posts/components/Interpolation/ScalarInterpolator.md +76 -0
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator.md +93 -0
- package/docs/_posts/components/Interpolation/SplinePositionInterpolator2D.md +93 -0
- package/docs/_posts/components/Interpolation/SplineScalarInterpolator.md +106 -0
- package/docs/_posts/components/Interpolation/SquadOrientationInterpolator.md +78 -0
- package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +78 -0
- package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +70 -0
- package/docs/_posts/components/Layering/Layer.md +67 -0
- package/docs/_posts/components/Layering/LayerSet.md +78 -0
- package/docs/_posts/components/Layering/Viewport.md +80 -0
- package/docs/_posts/components/Layout/Layout.md +107 -0
- package/docs/_posts/components/Layout/LayoutGroup.md +85 -0
- package/docs/_posts/components/Layout/LayoutLayer.md +74 -0
- package/docs/_posts/components/Layout/ScreenFontStyle.md +137 -0
- package/docs/_posts/components/Layout/ScreenGroup.md +71 -0
- package/docs/_posts/components/Lighting/DirectionalLight.md +100 -0
- package/docs/_posts/components/Lighting/EnvironmentLight.md +91 -0
- package/docs/_posts/components/Lighting/PointLight.md +103 -0
- package/docs/_posts/components/Lighting/SpotLight.md +132 -0
- package/docs/_posts/components/NURBS/Contour2D.md +57 -0
- package/docs/_posts/components/NURBS/ContourPolyline2D.md +46 -0
- package/docs/_posts/components/NURBS/CoordinateDouble.md +47 -0
- package/docs/_posts/components/NURBS/NurbsCurve.md +71 -0
- package/docs/_posts/components/NURBS/NurbsCurve2D.md +66 -0
- package/docs/_posts/components/NURBS/NurbsOrientationInterpolator.md +70 -0
- package/docs/_posts/components/NURBS/NurbsPatchSurface.md +106 -0
- package/docs/_posts/components/NURBS/NurbsPositionInterpolator.md +70 -0
- package/docs/_posts/components/NURBS/NurbsSet.md +66 -0
- package/docs/_posts/components/NURBS/NurbsSurfaceInterpolator.md +90 -0
- package/docs/_posts/components/NURBS/NurbsSweptSurface.md +69 -0
- package/docs/_posts/components/NURBS/NurbsSwungSurface.md +65 -0
- package/docs/_posts/components/NURBS/NurbsTextureCoordinate.md +77 -0
- package/docs/_posts/components/NURBS/NurbsTrimmedSurface.md +114 -0
- package/docs/_posts/components/Navigation/Billboard.md +88 -0
- package/docs/_posts/components/Navigation/Collision.md +102 -0
- package/docs/_posts/components/Navigation/LOD.md +99 -0
- package/docs/_posts/components/Navigation/NavigationInfo.md +122 -0
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +117 -0
- package/docs/_posts/components/Navigation/Viewpoint.md +117 -0
- package/docs/_posts/components/Navigation/ViewpointGroup.md +80 -0
- package/docs/_posts/components/Networking/Anchor.md +111 -0
- package/docs/_posts/components/Networking/Inline.md +115 -0
- package/docs/_posts/components/Networking/LoadSensor.md +91 -0
- package/docs/_posts/components/ParticleSystems/BoundedPhysicsModel.md +54 -0
- package/docs/_posts/components/ParticleSystems/ConeEmitter.md +76 -0
- package/docs/_posts/components/ParticleSystems/ExplosionEmitter.md +72 -0
- package/docs/_posts/components/ParticleSystems/ForcePhysicsModel.md +58 -0
- package/docs/_posts/components/ParticleSystems/ParticleSystem.md +177 -0
- package/docs/_posts/components/ParticleSystems/PointEmitter.md +76 -0
- package/docs/_posts/components/ParticleSystems/PolylineEmitter.md +94 -0
- package/docs/_posts/components/ParticleSystems/SurfaceEmitter.md +90 -0
- package/docs/_posts/components/ParticleSystems/VolumeEmitter.md +90 -0
- package/docs/_posts/components/ParticleSystems/WindPhysicsModel.md +68 -0
- package/docs/_posts/components/Picking/LinePickSensor.md +125 -0
- package/docs/_posts/components/Picking/PickableGroup.md +93 -0
- package/docs/_posts/components/Picking/PointPickSensor.md +112 -0
- package/docs/_posts/components/Picking/PrimitivePickSensor.md +114 -0
- package/docs/_posts/components/Picking/VolumePickSensor.md +107 -0
- package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +122 -0
- package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +114 -0
- package/docs/_posts/components/PointingDeviceSensor/SphereSensor.md +89 -0
- package/docs/_posts/components/PointingDeviceSensor/TouchSensor.md +87 -0
- package/docs/_posts/components/Rendering/ClipPlane.md +67 -0
- package/docs/_posts/components/Rendering/Color.md +56 -0
- package/docs/_posts/components/Rendering/ColorRGBA.md +61 -0
- package/docs/_posts/components/Rendering/Coordinate.md +45 -0
- package/docs/_posts/components/Rendering/IndexedLineSet.md +128 -0
- package/docs/_posts/components/Rendering/IndexedTriangleFanSet.md +128 -0
- package/docs/_posts/components/Rendering/IndexedTriangleSet.md +128 -0
- package/docs/_posts/components/Rendering/IndexedTriangleStripSet.md +116 -0
- package/docs/_posts/components/Rendering/LineSet.md +85 -0
- package/docs/_posts/components/Rendering/Normal.md +41 -0
- package/docs/_posts/components/Rendering/PointSet.md +76 -0
- package/docs/_posts/components/Rendering/TriangleFanSet.md +112 -0
- package/docs/_posts/components/Rendering/TriangleSet.md +108 -0
- package/docs/_posts/components/Rendering/TriangleStripSet.md +116 -0
- package/docs/_posts/components/RigidBodyPhysics/BallJoint.md +78 -0
- package/docs/_posts/components/RigidBodyPhysics/CollidableOffset.md +75 -0
- package/docs/_posts/components/RigidBodyPhysics/CollidableShape.md +83 -0
- package/docs/_posts/components/RigidBodyPhysics/CollisionCollection.md +90 -0
- package/docs/_posts/components/RigidBodyPhysics/CollisionSensor.md +65 -0
- package/docs/_posts/components/RigidBodyPhysics/CollisionSpace.md +70 -0
- package/docs/_posts/components/RigidBodyPhysics/Contact.md +117 -0
- package/docs/_posts/components/RigidBodyPhysics/DoubleAxisHingeJoint.md +162 -0
- package/docs/_posts/components/RigidBodyPhysics/MotorJoint.md +183 -0
- package/docs/_posts/components/RigidBodyPhysics/RigidBody.md +175 -0
- package/docs/_posts/components/RigidBodyPhysics/RigidBodyCollection.md +120 -0
- package/docs/_posts/components/RigidBodyPhysics/SingleAxisHingeJoint.md +108 -0
- package/docs/_posts/components/RigidBodyPhysics/SliderJoint.md +106 -0
- package/docs/_posts/components/RigidBodyPhysics/UniversalJoint.md +119 -0
- package/docs/_posts/components/Scripting/Script.md +81 -0
- package/docs/_posts/components/Shaders/ComposedShader.md +81 -0
- package/docs/_posts/components/Shaders/FloatVertexAttribute.md +65 -0
- package/docs/_posts/components/Shaders/Matrix3VertexAttribute.md +53 -0
- package/docs/_posts/components/Shaders/Matrix4VertexAttribute.md +53 -0
- package/docs/_posts/components/Shaders/PackagedShader.md +77 -0
- package/docs/_posts/components/Shaders/ProgramShader.md +71 -0
- package/docs/_posts/components/Shaders/ShaderPart.md +76 -0
- package/docs/_posts/components/Shaders/ShaderProgram.md +68 -0
- package/docs/_posts/components/Shape/AcousticProperties.md +52 -0
- package/docs/_posts/components/Shape/Appearance.md +123 -0
- package/docs/_posts/components/Shape/FillProperties.md +67 -0
- package/docs/_posts/components/Shape/LineProperties.md +63 -0
- package/docs/_posts/components/Shape/Material.md +217 -0
- package/docs/_posts/components/Shape/PhysicalMaterial.md +173 -0
- package/docs/_posts/components/Shape/PointProperties.md +84 -0
- package/docs/_posts/components/Shape/Shape.md +63 -0
- package/docs/_posts/components/Shape/TwoSidedMaterial.md +149 -0
- package/docs/_posts/components/Shape/UnlitMaterial.md +115 -0
- package/docs/_posts/components/Sound/Analyser.md +72 -0
- package/docs/_posts/components/Sound/AudioClip.md +139 -0
- package/docs/_posts/components/Sound/AudioDestination.md +52 -0
- package/docs/_posts/components/Sound/BiquadFilter.md +70 -0
- package/docs/_posts/components/Sound/BufferAudioSource.md +86 -0
- package/docs/_posts/components/Sound/ChannelMerger.md +46 -0
- package/docs/_posts/components/Sound/ChannelSelector.md +48 -0
- package/docs/_posts/components/Sound/ChannelSplitter.md +48 -0
- package/docs/_posts/components/Sound/Convolver.md +66 -0
- package/docs/_posts/components/Sound/Delay.md +66 -0
- package/docs/_posts/components/Sound/DynamicsCompressor.md +74 -0
- package/docs/_posts/components/Sound/Gain.md +62 -0
- package/docs/_posts/components/Sound/ListenerPointSource.md +62 -0
- package/docs/_posts/components/Sound/MicrophoneSource.md +54 -0
- package/docs/_posts/components/Sound/OscillatorSource.md +58 -0
- package/docs/_posts/components/Sound/PeriodicWave.md +42 -0
- package/docs/_posts/components/Sound/Sound.md +92 -0
- package/docs/_posts/components/Sound/SpatialSound.md +68 -0
- package/docs/_posts/components/Sound/StreamAudioDestination.md +52 -0
- package/docs/_posts/components/Sound/StreamAudioSource.md +54 -0
- package/docs/_posts/components/Sound/WaveShaper.md +66 -0
- package/docs/_posts/components/Text/FontStyle.md +145 -0
- package/docs/_posts/components/Text/Text.md +102 -0
- package/docs/_posts/components/TextureProjector/TextureProjector.md +52 -0
- package/docs/_posts/components/TextureProjector/TextureProjectorParallel.md +52 -0
- package/docs/_posts/components/Texturing/ImageTexture.md +134 -0
- package/docs/_posts/components/Texturing/MovieTexture.md +221 -0
- package/docs/_posts/components/Texturing/MultiTexture.md +100 -0
- package/docs/_posts/components/Texturing/MultiTextureCoordinate.md +47 -0
- package/docs/_posts/components/Texturing/MultiTextureTransform.md +47 -0
- package/docs/_posts/components/Texturing/PixelTexture.md +80 -0
- package/docs/_posts/components/Texturing/TextureCoordinate.md +52 -0
- package/docs/_posts/components/Texturing/TextureCoordinateGenerator.md +64 -0
- package/docs/_posts/components/Texturing/TextureProperties.md +137 -0
- package/docs/_posts/components/Texturing/TextureTransform.md +73 -0
- package/docs/_posts/components/Texturing3D/ComposedTexture3D.md +76 -0
- package/docs/_posts/components/Texturing3D/ImageTexture3D.md +132 -0
- package/docs/_posts/components/Texturing3D/ImageTextureAtlas.md +131 -0
- package/docs/_posts/components/Texturing3D/PixelTexture3D.md +75 -0
- package/docs/_posts/components/Texturing3D/TextureCoordinate3D.md +53 -0
- package/docs/_posts/components/Texturing3D/TextureCoordinate4D.md +52 -0
- package/docs/_posts/components/Texturing3D/TextureTransform3D.md +69 -0
- package/docs/_posts/components/Texturing3D/TextureTransformMatrix3D.md +57 -0
- package/docs/_posts/components/Time/TimeSensor.md +136 -0
- package/docs/_posts/components/VolumeRendering/BlendedVolumeStyle.md +92 -0
- package/docs/_posts/components/VolumeRendering/BoundaryEnhancementVolumeStyle.md +53 -0
- package/docs/_posts/components/VolumeRendering/CartoonVolumeStyle.md +83 -0
- package/docs/_posts/components/VolumeRendering/ComposedVolumeStyle.md +51 -0
- package/docs/_posts/components/VolumeRendering/EdgeEnhancementVolumeStyle.md +67 -0
- package/docs/_posts/components/VolumeRendering/IsoSurfaceVolumeData.md +99 -0
- package/docs/_posts/components/VolumeRendering/OpacityMapVolumeStyle.md +51 -0
- package/docs/_posts/components/VolumeRendering/ProjectionVolumeStyle.md +48 -0
- package/docs/_posts/components/VolumeRendering/SegmentedVolumeData.md +80 -0
- package/docs/_posts/components/VolumeRendering/ShadedVolumeStyle.md +75 -0
- package/docs/_posts/components/VolumeRendering/SilhouetteEnhancementVolumeStyle.md +63 -0
- package/docs/_posts/components/VolumeRendering/ToneMappedVolumeStyle.md +71 -0
- package/docs/_posts/components/VolumeRendering/VolumeData.md +71 -0
- package/docs/_posts/components/X_ITE/BlendMode.md +94 -0
- package/docs/_posts/custom-shaders.md +9 -4
- package/docs/_posts/dom-integration.md +1 -6
- package/docs/_posts/features.md +2 -2
- package/docs/_posts/getting-started.md +100 -57
- package/docs/_posts/glossary.md +1 -1
- package/docs/_posts/how-to-configure-your-web-server.md +1 -1
- package/docs/_posts/reference/browser-services.md +78 -18
- package/docs/_posts/reference/constants-services.md +1 -1
- package/docs/_posts/reference/ecmascript-object-and-function-definitions.md +1 -1
- package/docs/_posts/reference/field-services-and-objects.md +8 -8
- package/docs/_posts/reference/prototype-services.md +7 -7
- package/docs/_posts/reference/route-services.md +1 -1
- package/docs/_posts/reference/scene-services.md +5 -5
- package/docs/_posts/reference/script-node-authoring-interface.md +1 -1
- package/docs/_posts/report-a-bug.md +1 -1
- package/docs/_posts/setup-a-localhost-server.md +5 -1
- package/docs/_posts/supported-nodes.md +239 -238
- package/docs/_posts/tutorials/adding-backgrounds.md +3 -3
- package/docs/_posts/tutorials/adding-fog.md +2 -2
- package/docs/_posts/tutorials/adding-sound.md +19 -19
- package/docs/_posts/tutorials/animating-transforms.md +17 -17
- package/docs/_posts/tutorials/basic-nodes.md +30 -30
- package/docs/_posts/tutorials/building-a-x3d-world.md +3 -3
- package/docs/_posts/tutorials/building-elevation-grids.md +7 -7
- package/docs/_posts/tutorials/building-extruded-shapes.md +7 -7
- package/docs/_posts/tutorials/building-primitive-shapes.md +13 -13
- package/docs/_posts/tutorials/building-shapes-out-of-points-lines-and-faces.md +21 -21
- package/docs/_posts/tutorials/controlling-appearance-with-materials.md +7 -7
- package/docs/_posts/tutorials/controlling-color-on-coordinate-based-geometry.md +11 -11
- package/docs/_posts/tutorials/controlling-detail.md +4 -4
- package/docs/_posts/tutorials/controlling-how-textures-are-mapped.md +7 -7
- package/docs/_posts/tutorials/controlling-navigation.md +3 -3
- package/docs/_posts/tutorials/controlling-shading-on-coordinate-based-geometry.md +13 -13
- package/docs/_posts/tutorials/controlling-the-viewpoint.md +3 -3
- package/docs/_posts/tutorials/creating-new-node-types.md +4 -4
- package/docs/_posts/tutorials/grouping-nodes.md +13 -13
- package/docs/_posts/tutorials/hello-world.md +1 -1
- package/docs/_posts/tutorials/improving-performance.md +1 -1
- package/docs/_posts/tutorials/increasing-rendering-speed.md +1 -1
- package/docs/_posts/tutorials/introducing-animation.md +10 -10
- package/docs/_posts/tutorials/introducing-script-use.md +3 -3
- package/docs/_posts/tutorials/introducing-x3d.md +1 -1
- package/docs/_posts/tutorials/lighting-your-world.md +4 -4
- package/docs/_posts/tutorials/mapping-textures.md +7 -7
- package/docs/_posts/tutorials/naming-nodes.md +1 -1
- package/docs/_posts/tutorials/overview.md +1 -1
- package/docs/_posts/tutorials/providing-information-about-your-world.md +2 -2
- package/docs/_posts/tutorials/sensing-the-viewer.md +15 -15
- package/docs/_posts/tutorials/sensing-viewer-actions.md +10 -10
- package/docs/_posts/tutorials/transforming-shapes.md +4 -4
- package/docs/_posts/tutorials/writing-program-scripts-with-ecmascript.md +5 -5
- package/docs/_posts/what's-new.md +40 -2
- package/docs/_tabs/components.md +383 -0
- package/docs/_tabs/imprint.md +1 -1
- package/docs/_tabs/laboratory.md +38 -6
- package/docs/_tabs/playground.html +22 -66
- package/docs/_tabs/reference.md +2 -1
- package/docs/_tabs/tags.md +1 -1
- package/docs/_tabs/tutorials.md +1 -1
- package/docs/assets/X3D/Michroma-Regular.ttf +0 -0
- package/docs/assets/X3D/peakpx.jpg +0 -0
- package/docs/assets/X3D/teaser.x3d +55 -0
- package/docs/assets/css/style.scss +120 -11
- 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/js/autoupdate.js +25 -0
- package/docs/laboratory/gltf-sample-viewer.html +318 -0
- package/docs/laboratory/x3d-visual-blend-mode-editor.html +1 -0
- package/package.json +9 -2
- package/src/assets/components/Texturing3D.js +5 -3
- package/src/assets/shaders/Types.glsl.js +5 -5
- package/src/assets/shaders/webgl1/PBR.fs.js +1 -1
- package/src/assets/shaders/webgl1/include/Colors.glsl.js +5 -7
- package/src/assets/shaders/webgl1/include/Fragment.glsl.js +4 -0
- package/src/assets/shaders/webgl1/include/Hatch.glsl.js +1 -1
- package/src/assets/shaders/webgl1/include/Texture.glsl.js +3 -3
- package/src/assets/shaders/webgl2/include/Colors.glsl.js +5 -7
- package/src/assets/shaders/webgl2/include/Hatch.glsl.js +1 -1
- package/src/assets/shaders/webgl2/include/Particle.glsl.js +2 -2
- package/src/assets/shaders/webgl2/include/Texture.glsl.js +2 -2
- package/src/bookmarks.js +12 -8
- package/src/examples.js +3 -0
- package/src/lib/jquery.js +20 -0
- package/src/lib/libgif/libgif.js +1004 -0
- package/src/lib/libtess.js +1 -0
- package/src/lib/nurbs/extras/sample.js +5 -7
- package/src/standard/Math/Algorithms/Bezier.js +175 -33
- package/src/standard/Math/Geometry/Box2.js +15 -55
- package/src/standard/Math/Geometry/Box3.js +19 -66
- package/src/standard/Math/Geometry/Triangle3.js +14 -79
- package/src/standard/Math/Numbers/Color3.js +4 -0
- package/src/standard/Math/Numbers/Color4.js +4 -0
- package/src/standard/Math/Numbers/Matrix3.js +11 -3
- package/src/standard/Math/Numbers/Matrix4.js +9 -6
- package/src/standard/Math/Numbers/Rotation4.js +72 -65
- package/src/tests.js +3 -0
- package/src/x_ite/Base/X3DArrayField.js +0 -2
- package/src/x_ite/Base/X3DInfoArray.js +2 -2
- package/src/x_ite/Base/X3DObjectArrayField.js +19 -0
- package/src/x_ite/Base/X3DTypedArrayField.js +149 -0
- package/src/x_ite/Browser/Core/BrowserOptions.js +108 -64
- package/src/x_ite/Browser/Core/Context.js +1 -1
- package/src/x_ite/Browser/Core/ContextMenu.js +2 -2
- package/src/x_ite/Browser/Core/Notification.js +1 -1
- package/src/x_ite/Browser/Core/RenderingProperties.js +4 -0
- package/src/x_ite/Browser/Core/X3DCoreContext.js +99 -54
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +4 -14
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -13
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -12
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +25 -22
- package/src/x_ite/Browser/Navigation/X3DViewer.js +12 -3
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +2 -2
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +19 -15
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +30 -10
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +1 -1
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +30 -3
- package/src/x_ite/Browser/Text/PolygonText.js +137 -134
- package/src/x_ite/Browser/Texturing/GifMedia.js +113 -0
- package/src/x_ite/Browser/Texturing3D/DICOMParser.js +1 -6
- package/src/x_ite/Browser/Texturing3D/NRRDParser.js +81 -310
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +162 -122
- package/src/x_ite/Browser/X3DBrowserContext.js +7 -5
- package/src/x_ite/Components/Core/WorldInfo.js +3 -3
- package/src/x_ite/Components/Core/X3DNode.js +7 -7
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +1 -1
- package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +2 -3
- package/src/x_ite/Components/Geometry3D/Extrusion.js +27 -23
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +10 -19
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +1 -3
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +39 -15
- package/src/x_ite/Components/HAnim/HAnimJoint.js +6 -9
- package/src/x_ite/Components/Layering/X3DLayerNode.js +21 -2
- package/src/x_ite/Components/Layout/Layout.js +4 -2
- package/src/x_ite/Components/Layout/ScreenFontStyle.js +6 -0
- package/src/x_ite/Components/Lighting/DirectionalLight.js +4 -11
- package/src/x_ite/Components/Lighting/EnvironmentLight.js +1 -1
- package/src/x_ite/Components/Lighting/PointLight.js +4 -11
- package/src/x_ite/Components/Lighting/SpotLight.js +4 -11
- package/src/x_ite/Components/Lighting/X3DLightNode.js +7 -9
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +2 -2
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +14 -6
- package/src/x_ite/Components/Networking/Inline.js +48 -59
- package/src/x_ite/Components/Networking/X3DUrlObject.js +1 -1
- package/src/x_ite/Components/PointingDeviceSensor/CylinderSensor.js +2 -2
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +7 -13
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +4 -2
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +4 -2
- package/src/x_ite/Components/Scripting/Script.js +2 -2
- package/src/x_ite/Components/Shaders/ShaderPart.js +1 -1
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1 -3
- package/src/x_ite/Components/Shape/Appearance.js +27 -1
- package/src/x_ite/Components/Shape/FillProperties.js +1 -0
- package/src/x_ite/Components/Shape/LineProperties.js +15 -9
- package/src/x_ite/Components/Shape/Material.js +33 -22
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +22 -15
- package/src/x_ite/Components/Shape/PointProperties.js +23 -7
- package/src/x_ite/Components/Shape/UnlitMaterial.js +3 -2
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +25 -19
- package/src/x_ite/Components/Sound/AudioClip.js +5 -5
- package/src/x_ite/Components/Sound/X3DSoundSourceNode.js +26 -34
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +1 -1
- package/src/x_ite/Components/TextureProjector/TextureProjector.js +4 -12
- package/src/x_ite/Components/TextureProjector/TextureProjectorParallel.js +6 -14
- package/src/x_ite/Components/TextureProjector/X3DTextureProjectorNode.js +7 -7
- package/src/x_ite/Components/Texturing/ImageTexture.js +15 -10
- package/src/x_ite/Components/Texturing/MovieTexture.js +51 -11
- package/src/x_ite/Components/Texturing3D/ImageTexture3D.js +2 -2
- package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +230 -0
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +12 -10
- package/src/x_ite/Execution/BindableList.js +35 -37
- package/src/x_ite/Execution/BindableStack.js +25 -7
- package/src/x_ite/Execution/X3DScene.js +2 -2
- package/src/x_ite/Execution/X3DWorld.js +1 -1
- package/src/x_ite/Fields/SFRotation.js +2 -1
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/InputOutput/FileLoader.js +105 -236
- package/src/x_ite/InputOutput/Generator.js +12 -8
- package/src/x_ite/Parser/Expressions.js +85 -0
- package/src/x_ite/Parser/GLB2Parser.js +147 -0
- package/src/x_ite/Parser/GLTF2Parser.js +2221 -0
- package/src/x_ite/Parser/GoldenGate.js +64 -13
- package/src/x_ite/Parser/JSONParser.js +7 -36
- package/src/x_ite/Parser/OBJParser.js +1076 -0
- package/src/x_ite/Parser/STLAParser.js +376 -0
- package/src/x_ite/Parser/STLBParser.js +156 -0
- package/src/x_ite/Parser/SVGParser.js +2476 -0
- package/src/x_ite/Parser/VRMLParser.js +127 -183
- package/src/x_ite/Parser/X3DOptimizer.js +191 -0
- package/src/x_ite/Parser/X3DParser.js +34 -0
- package/src/x_ite/Parser/XMLParser.js +11 -109
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +2 -2
- package/src/x_ite/Prototype/X3DProtoDeclaration.js +3 -3
- package/src/x_ite/Rendering/DependentRenderer.js +1 -1
- package/src/x_ite/Rendering/MultiSampleFrameBuffer.js +150 -0
- package/src/x_ite/Rendering/TextureBuffer.js +3 -5
- package/src/x_ite/Rendering/X3DRenderObject.js +2 -7
- package/src/x_ite/X3D.js +1 -0
- package/src/x_ite/X3DCanvas.js +10 -0
- package/src/x_ite.html +39 -17
- package/webpack.config.js +1 -0
- package/x_ite.min.html +38 -17
- package/src/standard/Networking/BinaryTransport.js +0 -116
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
+
import X3DParser from "./X3DParser.js";
|
|
49
|
+
import Expressions from "./Expressions.js";
|
|
48
50
|
import Fields from "../Fields.js";
|
|
49
51
|
import X3DField from "../Base/X3DField.js";
|
|
50
|
-
import X3DParser from "./X3DParser.js";
|
|
51
52
|
import X3DExternProtoDeclaration from "../Prototype/X3DExternProtoDeclaration.js";
|
|
52
53
|
import X3DProtoDeclaration from "../Prototype/X3DProtoDeclaration.js";
|
|
53
54
|
import X3DConstants from "../Base/X3DConstants.js";
|
|
@@ -56,174 +57,66 @@ import X3DConstants from "../Base/X3DConstants.js";
|
|
|
56
57
|
* Grammar
|
|
57
58
|
*/
|
|
58
59
|
|
|
59
|
-
// Comment out scriptBody function fragments
|
|
60
|
-
//
|
|
61
|
-
// // VRML lexical elements
|
|
62
|
-
// var Grammar =
|
|
63
|
-
// {
|
|
64
|
-
// // General
|
|
65
|
-
// Whitespaces: /^([\x20\n,\t\r]+)/,
|
|
66
|
-
// Comment: /^#(.*?)(?=[\n\r])/,
|
|
67
|
-
//
|
|
68
|
-
// // Header
|
|
69
|
-
// Header: /^#(VRML|X3D) V(.*?) (utf8)(?: (.*?))?[\n\r]/,
|
|
70
|
-
//
|
|
71
|
-
// // Keywords
|
|
72
|
-
// AS: /^AS/,
|
|
73
|
-
// COMPONENT: /^COMPONENT/,
|
|
74
|
-
// DEF: /^DEF/,
|
|
75
|
-
// EXPORT: /^EXPORT/,
|
|
76
|
-
// EXTERNPROTO: /^EXTERNPROTO/,
|
|
77
|
-
// FALSE: /^FALSE/,
|
|
78
|
-
// false: /^false/,
|
|
79
|
-
// IMPORT: /^IMPORT/,
|
|
80
|
-
// IS: /^IS/,
|
|
81
|
-
// META: /^META/,
|
|
82
|
-
// NULL: /^NULL/,
|
|
83
|
-
// TRUE: /^TRUE/,
|
|
84
|
-
// true: /^true/,
|
|
85
|
-
// PROFILE: /^PROFILE/,
|
|
86
|
-
// PROTO: /^PROTO/,
|
|
87
|
-
// ROUTE: /^ROUTE/,
|
|
88
|
-
// TO: /^TO/,
|
|
89
|
-
// UNIT: /^UNIT/,
|
|
90
|
-
// USE: /^USE/,
|
|
91
|
-
//
|
|
92
|
-
// // Terminal symbols
|
|
93
|
-
// OpenBrace: /^\{/,
|
|
94
|
-
// CloseBrace: /^\}/,
|
|
95
|
-
// OpenBracket: /^\[/,
|
|
96
|
-
// CloseBracket: /^\]/,
|
|
97
|
-
// Period: /^\./,
|
|
98
|
-
// Colon: /^\:/,
|
|
99
|
-
//
|
|
100
|
-
// Id: /^([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*)/,
|
|
101
|
-
// ComponentNameId: /^([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]*)/,
|
|
102
|
-
//
|
|
103
|
-
// initializeOnly: /^initializeOnly/,
|
|
104
|
-
// inputOnly: /^inputOnly/,
|
|
105
|
-
// outputOnly: /^outputOnly/,
|
|
106
|
-
// inputOutput: /^inputOutput/,
|
|
107
|
-
//
|
|
108
|
-
// field: /^field/,
|
|
109
|
-
// eventIn: /^eventIn/,
|
|
110
|
-
// eventOut: /^eventOut/,
|
|
111
|
-
// exposedField: /^exposedField/,
|
|
112
|
-
//
|
|
113
|
-
// FieldType: /^(MFBool|MFColorRGBA|MFColor|MFDouble|MFFloat|MFImage|MFInt32|MFMatrix3d|MFMatrix3f|MFMatrix4d|MFMatrix4f|MFNode|MFRotation|MFString|MFTime|MFVec2d|MFVec2f|MFVec3d|MFVec3f|MFVec4d|MFVec4f|SFBool|SFColorRGBA|SFColor|SFDouble|SFFloat|SFImage|SFInt32|SFMatrix3d|SFMatrix3f|SFMatrix4d|SFMatrix4f|SFNode|SFRotation|SFString|SFTime|SFVec2d|SFVec2f|SFVec3d|SFVec3f|SFVec4d|SFVec4f)/,
|
|
114
|
-
//
|
|
115
|
-
// // Values
|
|
116
|
-
// int32: /^((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/,
|
|
117
|
-
// double: /^([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/,
|
|
118
|
-
// string: /^"((?:[^"\\]|\\\\|\\")*)"/,
|
|
119
|
-
//
|
|
120
|
-
// Inf: /^[+]?inf/i,
|
|
121
|
-
// NegativeInf: /^-inf/i,
|
|
122
|
-
// NaN: /^[+-]?nan/i,
|
|
123
|
-
//
|
|
124
|
-
// // Misc
|
|
125
|
-
// Break: /\r?\n/g,
|
|
126
|
-
// };
|
|
127
|
-
//
|
|
128
|
-
// function parse (parser)
|
|
129
|
-
// {
|
|
130
|
-
// this .lastIndex = 0;
|
|
131
|
-
// parser .result = this .exec (parser .input);
|
|
132
|
-
//
|
|
133
|
-
// if (parser .result)
|
|
134
|
-
// {
|
|
135
|
-
// parser .input = parser .input .slice (parser .result [0] .length);
|
|
136
|
-
// return true;
|
|
137
|
-
// }
|
|
138
|
-
//
|
|
139
|
-
// return false;
|
|
140
|
-
// }
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// Comment out scriptBody function fragments
|
|
144
|
-
//
|
|
145
60
|
// VRML lexical elements
|
|
146
|
-
|
|
147
|
-
{
|
|
61
|
+
const Grammar = Expressions ({
|
|
148
62
|
// General
|
|
149
|
-
Whitespaces:
|
|
150
|
-
Comment:
|
|
63
|
+
Whitespaces: /([\x20\n,\t\r]+)/gy,
|
|
64
|
+
Comment: /#(.*?)(?=[\n\r])/gy,
|
|
65
|
+
Break: /\r?\n/g,
|
|
151
66
|
|
|
152
67
|
// Header
|
|
153
|
-
Header:
|
|
68
|
+
Header: /^#(VRML|X3D) V(.*?) (utf8)(?:[ \t]+(.*?))?[ \t]*[\n\r]/gy,
|
|
154
69
|
|
|
155
70
|
// Keywords
|
|
156
|
-
AS:
|
|
157
|
-
COMPONENT:
|
|
158
|
-
DEF:
|
|
159
|
-
EXPORT:
|
|
160
|
-
EXTERNPROTO:
|
|
161
|
-
FALSE:
|
|
162
|
-
IMPORT:
|
|
163
|
-
IS:
|
|
164
|
-
META:
|
|
165
|
-
NULL:
|
|
166
|
-
TRUE:
|
|
167
|
-
PROFILE:
|
|
168
|
-
PROTO:
|
|
169
|
-
ROUTE:
|
|
170
|
-
TO:
|
|
171
|
-
UNIT:
|
|
172
|
-
USE:
|
|
71
|
+
AS: /AS/gy,
|
|
72
|
+
COMPONENT: /COMPONENT/gy,
|
|
73
|
+
DEF: /DEF/gy,
|
|
74
|
+
EXPORT: /EXPORT/gy,
|
|
75
|
+
EXTERNPROTO: /EXTERNPROTO/gy,
|
|
76
|
+
FALSE: /FALSE|false/gy,
|
|
77
|
+
IMPORT: /IMPORT/gy,
|
|
78
|
+
IS: /IS/gy,
|
|
79
|
+
META: /META/gy,
|
|
80
|
+
NULL: /NULL/gy,
|
|
81
|
+
TRUE: /TRUE|true/gy,
|
|
82
|
+
PROFILE: /PROFILE/gy,
|
|
83
|
+
PROTO: /PROTO/gy,
|
|
84
|
+
ROUTE: /ROUTE/gy,
|
|
85
|
+
TO: /TO/gy,
|
|
86
|
+
UNIT: /UNIT/gy,
|
|
87
|
+
USE: /USE/gy,
|
|
173
88
|
|
|
174
89
|
// Terminal symbols
|
|
175
|
-
OpenBrace:
|
|
176
|
-
CloseBrace:
|
|
177
|
-
OpenBracket:
|
|
178
|
-
CloseBracket:
|
|
179
|
-
Period:
|
|
180
|
-
Colon:
|
|
90
|
+
OpenBrace: /\{/gy,
|
|
91
|
+
CloseBrace: /\}/gy,
|
|
92
|
+
OpenBracket: /\[/gy,
|
|
93
|
+
CloseBracket: /\]/gy,
|
|
94
|
+
Period: /\./gy,
|
|
95
|
+
Colon: /\:/gy,
|
|
181
96
|
|
|
182
|
-
Id:
|
|
183
|
-
ComponentNameId:
|
|
97
|
+
Id: /([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*)/gy,
|
|
98
|
+
ComponentNameId: /([^\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]{1}[^\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f\x3a]*)/gy,
|
|
184
99
|
|
|
185
|
-
initializeOnly:
|
|
186
|
-
inputOnly:
|
|
187
|
-
outputOnly:
|
|
188
|
-
inputOutput:
|
|
100
|
+
initializeOnly: /initializeOnly/gy,
|
|
101
|
+
inputOnly: /inputOnly/gy,
|
|
102
|
+
outputOnly: /outputOnly/gy,
|
|
103
|
+
inputOutput: /inputOutput/gy,
|
|
189
104
|
|
|
190
|
-
field:
|
|
191
|
-
eventIn:
|
|
192
|
-
eventOut:
|
|
193
|
-
exposedField:
|
|
105
|
+
field: /field/gy,
|
|
106
|
+
eventIn: /eventIn/gy,
|
|
107
|
+
eventOut: /eventOut/gy,
|
|
108
|
+
exposedField: /exposedField/gy,
|
|
194
109
|
|
|
195
|
-
FieldType:
|
|
110
|
+
FieldType: /(MFBool|MFColorRGBA|MFColor|MFDouble|MFFloat|MFImage|MFInt32|MFMatrix3d|MFMatrix3f|MFMatrix4d|MFMatrix4f|MFNode|MFRotation|MFString|MFTime|MFVec2d|MFVec2f|MFVec3d|MFVec3f|MFVec4d|MFVec4f|SFBool|SFColorRGBA|SFColor|SFDouble|SFFloat|SFImage|SFInt32|SFMatrix3d|SFMatrix3f|SFMatrix4d|SFMatrix4f|SFNode|SFRotation|SFString|SFTime|SFVec2d|SFVec2f|SFVec3d|SFVec3f|SFVec4d|SFVec4f)/gy,
|
|
196
111
|
|
|
197
112
|
// Values
|
|
198
|
-
int32:
|
|
199
|
-
double:
|
|
200
|
-
string:
|
|
201
|
-
|
|
202
|
-
Inf: new RegExp ('[+]?(?:inf|Infinity)', 'gy'),
|
|
203
|
-
NegativeInf: new RegExp ('-(?:inf|Infinity)', 'gy'),
|
|
204
|
-
NaN: new RegExp ('[+-]?(nan|NaN)', 'gy'),
|
|
205
|
-
|
|
206
|
-
// Misc
|
|
207
|
-
Break: new RegExp ('\\r?\\n', 'g'),
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
function parse (parser)
|
|
211
|
-
{
|
|
212
|
-
this .lastIndex = parser .lastIndex;
|
|
213
|
-
|
|
214
|
-
parser .result = this .exec (parser .input);
|
|
215
|
-
|
|
216
|
-
if (parser .result)
|
|
217
|
-
{
|
|
218
|
-
parser .lastIndex = this .lastIndex;
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return false;
|
|
223
|
-
}
|
|
113
|
+
int32: /((?:0[xX][\da-fA-F]+)|(?:[+-]?\d+))/gy,
|
|
114
|
+
double: /([+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?))/gy,
|
|
115
|
+
string: /"((?:[^\\"]|\\\\|\\")*)"/gy,
|
|
224
116
|
|
|
225
|
-
|
|
226
|
-
|
|
117
|
+
CONSTANTS: /([+-]?)\b(NAN|INFINITY|INF|PI|PI2|PI1_4|PI2_4|PI3_4|PI4_4|PI5_4|PI6_4|PI7_4|PI8_4|PI1_2|PI2_2|PI3_2|PI4_2|PI1_3|PI2_3|PI3_3|PI4_3|PI5_3|PI6_3|SQRT1_2|SQRT2)\b/igy,
|
|
118
|
+
HTMLColor: /([a-zA-Z]+|0[xX][\da-fA-F]+|rgba?\(.*?\))/gy,
|
|
119
|
+
});
|
|
227
120
|
|
|
228
121
|
/*
|
|
229
122
|
* Parser
|
|
@@ -290,14 +183,44 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
290
183
|
MFVec3f: new Fields .MFVec3f (),
|
|
291
184
|
MFVec4d: new Fields .MFVec4d (),
|
|
292
185
|
MFVec4f: new Fields .MFVec4f (),
|
|
186
|
+
CONSTANTS: {
|
|
187
|
+
NAN: Number .NaN,
|
|
188
|
+
INFINITY: Number .POSITIVE_INFINITY,
|
|
189
|
+
INF: Number .POSITIVE_INFINITY,
|
|
190
|
+
PI: Math .PI,
|
|
191
|
+
PI2: Math .PI * 2,
|
|
192
|
+
PI1_4: Math .PI * 1/4,
|
|
193
|
+
PI2_4: Math .PI * 2/4,
|
|
194
|
+
PI3_4: Math .PI * 3/4,
|
|
195
|
+
PI4_4: Math .PI * 4/4,
|
|
196
|
+
PI5_4: Math .PI * 5/4,
|
|
197
|
+
PI6_4: Math .PI * 6/4,
|
|
198
|
+
PI7_4: Math .PI * 7/4,
|
|
199
|
+
PI8_4: Math .PI * 8/4,
|
|
200
|
+
PI1_2: Math .PI * 1/2,
|
|
201
|
+
PI2_2: Math .PI * 2/2,
|
|
202
|
+
PI3_2: Math .PI * 3/2,
|
|
203
|
+
PI4_2: Math .PI * 4/2,
|
|
204
|
+
PI1_3: Math .PI * 1/3,
|
|
205
|
+
PI2_3: Math .PI * 2/3,
|
|
206
|
+
PI3_3: Math .PI * 3/3,
|
|
207
|
+
PI4_3: Math .PI * 4/3,
|
|
208
|
+
PI5_3: Math .PI * 5/3,
|
|
209
|
+
PI6_3: Math .PI * 6/3,
|
|
210
|
+
SQRT1_2: Math .SQRT1_2,
|
|
211
|
+
SQRT2: Math .SQRT2,
|
|
212
|
+
},
|
|
213
|
+
getEncoding: function ()
|
|
214
|
+
{
|
|
215
|
+
return "STRING";
|
|
216
|
+
},
|
|
293
217
|
isValid: function ()
|
|
294
218
|
{
|
|
219
|
+
if (!(typeof this .input === "string"))
|
|
220
|
+
return false;
|
|
221
|
+
|
|
295
222
|
return !! this .input .match (/^(?:#X3D|#VRML|(?:[\x20\n,\t\r]*|#.*?[\r\n])*(PROFILE|COMPONENT|META|UNIT|EXTERNPROTO|PROTO|DEF|NULL|IMPORT|EXPORT|ROUTE|\w+(?:[\x20\n,\t\r]*|#.*?[\r\n])\{|$))/);
|
|
296
223
|
},
|
|
297
|
-
getInput: function ()
|
|
298
|
-
{
|
|
299
|
-
return this .input;
|
|
300
|
-
},
|
|
301
224
|
setInput: function (vrmlSyntax)
|
|
302
225
|
{
|
|
303
226
|
this .input = vrmlSyntax;
|
|
@@ -352,7 +275,7 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
352
275
|
var message = "\n"
|
|
353
276
|
+ "********************************************************************************" + "\n"
|
|
354
277
|
+ "Parser error at line " + this .lineNumber + ":" + linePos + "\n"
|
|
355
|
-
+ "in '" + this .
|
|
278
|
+
+ "in '" + this .getExecutionContext () .getWorldURL () + "'" + "\n"
|
|
356
279
|
+ "\n"
|
|
357
280
|
+ lastLine + "\n"
|
|
358
281
|
+ line + "\n"
|
|
@@ -411,8 +334,7 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
411
334
|
{
|
|
412
335
|
if (Grammar .Whitespaces .parse (this))
|
|
413
336
|
{
|
|
414
|
-
|
|
415
|
-
this .lines (this .result [1]);
|
|
337
|
+
this .lines (this .result [1]);
|
|
416
338
|
|
|
417
339
|
return true;
|
|
418
340
|
}
|
|
@@ -447,7 +369,7 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
447
369
|
{
|
|
448
370
|
try
|
|
449
371
|
{
|
|
450
|
-
this .statements (this .
|
|
372
|
+
this .statements (this .getExecutionContext () .rootNodes);
|
|
451
373
|
|
|
452
374
|
if (this .lastIndex < this .input .length)
|
|
453
375
|
throw new Error ("Unknown statement.");
|
|
@@ -456,7 +378,7 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
456
378
|
}
|
|
457
379
|
catch (error)
|
|
458
380
|
{
|
|
459
|
-
|
|
381
|
+
console .error (error);
|
|
460
382
|
this .error (new Error (this .getError (error)));
|
|
461
383
|
}
|
|
462
384
|
})
|
|
@@ -464,7 +386,7 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
464
386
|
}
|
|
465
387
|
else
|
|
466
388
|
{
|
|
467
|
-
this .statements (this .
|
|
389
|
+
this .statements (this .getExecutionContext () .rootNodes);
|
|
468
390
|
|
|
469
391
|
if (this .lastIndex < this .input .length)
|
|
470
392
|
throw new Error ("Unknown statement.");
|
|
@@ -1381,10 +1303,6 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1381
1303
|
lastIndex = this .lastIndex,
|
|
1382
1304
|
lineNumber = this .lineNumber;
|
|
1383
1305
|
|
|
1384
|
-
// var
|
|
1385
|
-
// input = this .input,
|
|
1386
|
-
// lineNumber = this .lineNumber;
|
|
1387
|
-
|
|
1388
1306
|
if (this .Id ())
|
|
1389
1307
|
{
|
|
1390
1308
|
var accessType = this .accessTypes [this .result [1]];
|
|
@@ -1463,9 +1381,6 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1463
1381
|
this .lastIndex = lastIndex;
|
|
1464
1382
|
this .lineNumber = lineNumber;
|
|
1465
1383
|
|
|
1466
|
-
// this .input = input;
|
|
1467
|
-
// this .lineNumber = lineNumber;
|
|
1468
|
-
|
|
1469
1384
|
var field = this .interfaceDeclaration ();
|
|
1470
1385
|
|
|
1471
1386
|
if (field)
|
|
@@ -1625,21 +1540,15 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1625
1540
|
return true;
|
|
1626
1541
|
}
|
|
1627
1542
|
|
|
1628
|
-
|
|
1629
|
-
{
|
|
1630
|
-
this .value = Number .POSITIVE_INFINITY;
|
|
1631
|
-
return true;
|
|
1632
|
-
}
|
|
1543
|
+
// Constants
|
|
1633
1544
|
|
|
1634
|
-
if (Grammar .
|
|
1545
|
+
if (Grammar .CONSTANTS .parse (this))
|
|
1635
1546
|
{
|
|
1636
|
-
this .value =
|
|
1637
|
-
|
|
1638
|
-
|
|
1547
|
+
this .value = this .CONSTANTS [this .result [2] .toUpperCase ()];
|
|
1548
|
+
|
|
1549
|
+
if (this .result [1] === "-")
|
|
1550
|
+
this .value = - this .value;
|
|
1639
1551
|
|
|
1640
|
-
if (Grammar .NaN .parse (this))
|
|
1641
|
-
{
|
|
1642
|
-
this .value = Number .NaN;
|
|
1643
1552
|
return true;
|
|
1644
1553
|
}
|
|
1645
1554
|
|
|
@@ -1726,6 +1635,8 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1726
1635
|
},
|
|
1727
1636
|
sfcolorValue: function (field)
|
|
1728
1637
|
{
|
|
1638
|
+
const lastIndex = this .lastIndex;
|
|
1639
|
+
|
|
1729
1640
|
if (this .double ())
|
|
1730
1641
|
{
|
|
1731
1642
|
var r = this .value;
|
|
@@ -1747,6 +1658,21 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1747
1658
|
}
|
|
1748
1659
|
}
|
|
1749
1660
|
|
|
1661
|
+
this .lastIndex = lastIndex;
|
|
1662
|
+
|
|
1663
|
+
this .comments ();
|
|
1664
|
+
|
|
1665
|
+
if (Grammar .HTMLColor .parse (this))
|
|
1666
|
+
{
|
|
1667
|
+
const color = this .convertColor (this .result [1] .replace (/0x/i, "#"));
|
|
1668
|
+
|
|
1669
|
+
field .r = color [0];
|
|
1670
|
+
field .g = color [1];
|
|
1671
|
+
field .b = color [2];
|
|
1672
|
+
|
|
1673
|
+
return true;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1750
1676
|
return false;
|
|
1751
1677
|
},
|
|
1752
1678
|
mfcolorValue: function (field)
|
|
@@ -1785,6 +1711,8 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1785
1711
|
},
|
|
1786
1712
|
sfcolorrgbaValue: function (field)
|
|
1787
1713
|
{
|
|
1714
|
+
const lastIndex = this .lastIndex;
|
|
1715
|
+
|
|
1788
1716
|
if (this .double ())
|
|
1789
1717
|
{
|
|
1790
1718
|
var r = this .value;
|
|
@@ -1812,6 +1740,22 @@ VRMLParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1812
1740
|
}
|
|
1813
1741
|
}
|
|
1814
1742
|
|
|
1743
|
+
this .lastIndex = lastIndex;
|
|
1744
|
+
|
|
1745
|
+
this .comments ();
|
|
1746
|
+
|
|
1747
|
+
if (Grammar .HTMLColor .parse (this))
|
|
1748
|
+
{
|
|
1749
|
+
const color = this .convertColor (this .result [1] .replace (/0x/i, "#"));
|
|
1750
|
+
|
|
1751
|
+
field .r = color [0];
|
|
1752
|
+
field .g = color [1];
|
|
1753
|
+
field .b = color [2];
|
|
1754
|
+
field .a = color [3];
|
|
1755
|
+
|
|
1756
|
+
return true;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1815
1759
|
return false;
|
|
1816
1760
|
},
|
|
1817
1761
|
mfcolorrgbaValue: function (field)
|
|
@@ -0,0 +1,191 @@
|
|
|
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 Vector3 from "../../standard/Math/Numbers/Vector3.js";
|
|
49
|
+
import Rotation4 from "../../standard/Math/Numbers/Rotation4.js";
|
|
50
|
+
import Matrix4 from "../../standard/Math/Numbers/Matrix4.js";
|
|
51
|
+
|
|
52
|
+
function X3DOptimizer () { }
|
|
53
|
+
|
|
54
|
+
X3DOptimizer .prototype = {
|
|
55
|
+
constructor: X3DOptimizer,
|
|
56
|
+
removeGroups: false,
|
|
57
|
+
removeEmptyGroups: false,
|
|
58
|
+
combineGroupingNodes: false,
|
|
59
|
+
optimizeSceneGraph: function (nodes)
|
|
60
|
+
{
|
|
61
|
+
const removedNodes = [ ];
|
|
62
|
+
|
|
63
|
+
nodes .setValue (this .optimizeNodes (nodes, true, removedNodes));
|
|
64
|
+
|
|
65
|
+
removedNodes .forEach (node => node .dispose ());
|
|
66
|
+
},
|
|
67
|
+
optimizeNodes: function (nodes, combine, removedNodes)
|
|
68
|
+
{
|
|
69
|
+
return nodes .flatMap (node => this .optimizeNode (node, combine, removedNodes));
|
|
70
|
+
},
|
|
71
|
+
optimizeNode: function (node, combine, removedNodes)
|
|
72
|
+
{
|
|
73
|
+
if (!node)
|
|
74
|
+
return [ ];
|
|
75
|
+
|
|
76
|
+
switch (node .getNodeTypeName ())
|
|
77
|
+
{
|
|
78
|
+
case "Transform":
|
|
79
|
+
{
|
|
80
|
+
node .children = this .optimizeNodes (node .children, true, removedNodes);
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "Anchor":
|
|
84
|
+
case "Group":
|
|
85
|
+
{
|
|
86
|
+
node .children = this .optimizeNodes (node .children, true, removedNodes);
|
|
87
|
+
|
|
88
|
+
if (this .removeEmptyGroups)
|
|
89
|
+
{
|
|
90
|
+
if (node .children .length === 0)
|
|
91
|
+
return [ ];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (this .removeGroups)
|
|
95
|
+
break;
|
|
96
|
+
|
|
97
|
+
return node;
|
|
98
|
+
}
|
|
99
|
+
case "LOD":
|
|
100
|
+
case "Switch":
|
|
101
|
+
{
|
|
102
|
+
this .optimizeNodes (node .children, false, removedNodes);
|
|
103
|
+
return node;
|
|
104
|
+
}
|
|
105
|
+
default:
|
|
106
|
+
{
|
|
107
|
+
return node;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!combine)
|
|
112
|
+
return node;
|
|
113
|
+
|
|
114
|
+
if (this .removeEmptyGroups)
|
|
115
|
+
{
|
|
116
|
+
if (node .children .length === 0)
|
|
117
|
+
return [ ];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!this .combineGroupingNodes)
|
|
121
|
+
return node;
|
|
122
|
+
|
|
123
|
+
if (node .getValue () .hasRoutes ())
|
|
124
|
+
return node;
|
|
125
|
+
|
|
126
|
+
if (node .getNodeTypeName () === "Transform")
|
|
127
|
+
{
|
|
128
|
+
this .combineSingleChild (node, removedNodes);
|
|
129
|
+
|
|
130
|
+
if (!node .translation .getValue () .equals (Vector3 .Zero))
|
|
131
|
+
return node;
|
|
132
|
+
|
|
133
|
+
if (!node .rotation .getValue () .equals (Rotation4 .Identity))
|
|
134
|
+
return node;
|
|
135
|
+
|
|
136
|
+
if (!node .scale .getValue () .equals (Vector3 .One))
|
|
137
|
+
return node;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
removedNodes .push (node .getValue ());
|
|
141
|
+
|
|
142
|
+
return [... node .children];
|
|
143
|
+
},
|
|
144
|
+
combineSingleChild: function (node, removedNodes)
|
|
145
|
+
{
|
|
146
|
+
if (node .children .length !== 1)
|
|
147
|
+
return;
|
|
148
|
+
|
|
149
|
+
const child = node .children [0];
|
|
150
|
+
|
|
151
|
+
if (child .getNodeTypeName () !== "Transform")
|
|
152
|
+
return;
|
|
153
|
+
|
|
154
|
+
if (child .getValue () .hasRoutes ())
|
|
155
|
+
return;
|
|
156
|
+
|
|
157
|
+
// Combine single Transform nodes.
|
|
158
|
+
|
|
159
|
+
const
|
|
160
|
+
translation = new Vector3 (0, 0, 0),
|
|
161
|
+
rotation = new Rotation4 (),
|
|
162
|
+
scale = new Vector3 (1, 1, 1),
|
|
163
|
+
scaleOrientation = new Rotation4 (),
|
|
164
|
+
nodeMatrix = new Matrix4 (),
|
|
165
|
+
childMatrix = new Matrix4 ();
|
|
166
|
+
|
|
167
|
+
nodeMatrix .set (node .translation .getValue (),
|
|
168
|
+
node .rotation .getValue (),
|
|
169
|
+
node .scale .getValue (),
|
|
170
|
+
node .scaleOrientation .getValue ());
|
|
171
|
+
|
|
172
|
+
childMatrix .set (child .translation .getValue (),
|
|
173
|
+
child .rotation .getValue (),
|
|
174
|
+
child .scale .getValue (),
|
|
175
|
+
child .scaleOrientation .getValue ());
|
|
176
|
+
|
|
177
|
+
nodeMatrix .multLeft (childMatrix);
|
|
178
|
+
|
|
179
|
+
nodeMatrix .get (translation, rotation, scale, scaleOrientation);
|
|
180
|
+
|
|
181
|
+
node .translation = translation;
|
|
182
|
+
node .rotation = rotation;
|
|
183
|
+
node .scale = scale;
|
|
184
|
+
node .scaleOrientation = scaleOrientation;
|
|
185
|
+
node .children = child .children;
|
|
186
|
+
|
|
187
|
+
removedNodes .push (child .getValue ());
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export default X3DOptimizer;
|
|
@@ -166,6 +166,40 @@ X3DParser .prototype = {
|
|
|
166
166
|
|
|
167
167
|
return value;
|
|
168
168
|
},
|
|
169
|
+
convertColor: function (value)
|
|
170
|
+
{
|
|
171
|
+
const
|
|
172
|
+
div = $("<div></div>") .css ("color", value) .appendTo (this .getBrowser () .getShadow ()),
|
|
173
|
+
rgb = window .getComputedStyle (div [0]) .color,
|
|
174
|
+
values = rgb .replace (/^rgba?\(|\)$/g, "") .split (/[\s,]+/) .map (s => parseFloat (s));
|
|
175
|
+
|
|
176
|
+
div .remove ();
|
|
177
|
+
|
|
178
|
+
values [0] /= 255;
|
|
179
|
+
values [1] /= 255;
|
|
180
|
+
values [2] /= 255;
|
|
181
|
+
|
|
182
|
+
if (typeof values [3] !== "number")
|
|
183
|
+
values [3] = 1;
|
|
184
|
+
|
|
185
|
+
return values;
|
|
186
|
+
},
|
|
187
|
+
sanitizeName: function (name = "")
|
|
188
|
+
{
|
|
189
|
+
// NonIdFirstChar
|
|
190
|
+
name = name .replace (/^[\x30-\x39\x00-\x20\x22\x23\x27\x2b\x2c\x2d\x2e\x5b\x5c\x5d\x7b\x7d\x7f]*/, "");
|
|
191
|
+
|
|
192
|
+
// NonIdChars
|
|
193
|
+
name = name .replace (/[\x00-\x20\x22\x23\x27\x2c\x2e\x5b\x5c\x5d\x7b\x7d\x7f]+/g, "-");
|
|
194
|
+
|
|
195
|
+
// Spaces
|
|
196
|
+
name = name .trim () .replace (/[\s_-]+/g, "-");
|
|
197
|
+
|
|
198
|
+
// Trim
|
|
199
|
+
name = name .replace (/^-+|-+$/g, "");
|
|
200
|
+
|
|
201
|
+
return name;
|
|
202
|
+
},
|
|
169
203
|
};
|
|
170
204
|
|
|
171
205
|
export default X3DParser;
|