three-stdlib 2.22.10 → 2.23.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/_polyfill/CompressedArrayTexture.cjs +12 -0
- package/dist/_polyfill/CompressedArrayTexture.js +6 -6
- package/dist/_polyfill/Data3DTexture.cjs +17 -0
- package/dist/_polyfill/Data3DTexture.js +8 -8
- package/dist/animation/{AnimationClipCreator.mjs → AnimationClipCreator.cjs} +18 -18
- package/dist/animation/AnimationClipCreator.js +18 -18
- package/dist/animation/{CCDIKSolver.mjs → CCDIKSolver.cjs} +32 -32
- package/dist/animation/CCDIKSolver.js +32 -32
- package/dist/animation/{MMDAnimationHelper.mjs → MMDAnimationHelper.cjs} +17 -17
- package/dist/animation/MMDAnimationHelper.js +17 -17
- package/dist/animation/{MMDPhysics.mjs → MMDPhysics.cjs} +25 -25
- package/dist/animation/MMDPhysics.js +25 -25
- package/dist/cameras/{CinematicCamera.mjs → CinematicCamera.cjs} +17 -17
- package/dist/cameras/CinematicCamera.js +17 -17
- package/dist/controls/{ArcballControls.mjs → ArcballControls.cjs} +102 -102
- package/dist/controls/ArcballControls.js +102 -102
- package/dist/controls/{DeviceOrientationControls.mjs → DeviceOrientationControls.cjs} +14 -14
- package/dist/controls/DeviceOrientationControls.js +14 -14
- package/dist/controls/{DragControls.mjs → DragControls.cjs} +12 -12
- package/dist/controls/DragControls.js +12 -12
- package/dist/controls/{FirstPersonControls.mjs → FirstPersonControls.cjs} +16 -16
- package/dist/controls/FirstPersonControls.js +16 -16
- package/dist/controls/{FlyControls.mjs → FlyControls.cjs} +10 -10
- package/dist/controls/FlyControls.js +10 -10
- package/dist/controls/{OrbitControls.mjs → OrbitControls.cjs} +52 -54
- package/dist/controls/OrbitControls.d.ts +4 -4
- package/dist/controls/OrbitControls.js +52 -54
- package/dist/controls/{PointerLockControls.mjs → PointerLockControls.cjs} +8 -8
- package/dist/controls/PointerLockControls.js +8 -8
- package/dist/controls/{TrackballControls.mjs → TrackballControls.cjs} +32 -32
- package/dist/controls/TrackballControls.d.ts +2 -2
- package/dist/controls/TrackballControls.js +32 -32
- package/dist/controls/{TransformControls.mjs → TransformControls.cjs} +169 -169
- package/dist/controls/TransformControls.js +169 -169
- package/dist/controls/experimental/{CameraControls.mjs → CameraControls.cjs} +59 -59
- package/dist/controls/experimental/CameraControls.js +59 -59
- package/dist/csm/{CSM.mjs → CSM.cjs} +17 -17
- package/dist/csm/CSM.js +17 -17
- package/dist/csm/{CSMFrustum.mjs → CSMFrustum.cjs} +7 -7
- package/dist/csm/CSMFrustum.js +7 -7
- package/dist/csm/{CSMHelper.mjs → CSMHelper.cjs} +14 -14
- package/dist/csm/CSMHelper.js +14 -14
- package/dist/csm/{CSMShader.mjs → CSMShader.cjs} +5 -5
- package/dist/csm/CSMShader.js +5 -5
- package/dist/curves/{CurveExtras.mjs → CurveExtras.cjs} +45 -45
- package/dist/curves/CurveExtras.js +45 -45
- package/dist/curves/{NURBSCurve.mjs → NURBSCurve.cjs} +11 -11
- package/dist/curves/NURBSCurve.js +11 -11
- package/dist/curves/{NURBSSurface.mjs → NURBSSurface.cjs} +7 -7
- package/dist/curves/NURBSSurface.js +7 -7
- package/dist/curves/{NURBSUtils.mjs → NURBSUtils.cjs} +17 -17
- package/dist/curves/NURBSUtils.js +17 -17
- package/dist/deprecated/{Geometry.mjs → Geometry.cjs} +51 -51
- package/dist/deprecated/Geometry.js +51 -51
- package/dist/effects/{AnaglyphEffect.mjs → AnaglyphEffect.cjs} +14 -14
- package/dist/effects/AnaglyphEffect.js +14 -14
- package/dist/effects/{AsciiEffect.mjs → AsciiEffect.cjs} +3 -3
- package/dist/effects/AsciiEffect.js +3 -3
- package/dist/effects/{OutlineEffect.mjs → OutlineEffect.cjs} +8 -8
- package/dist/effects/OutlineEffect.js +8 -8
- package/dist/effects/{ParallaxBarrierEffect.mjs → ParallaxBarrierEffect.cjs} +12 -12
- package/dist/effects/ParallaxBarrierEffect.js +12 -12
- package/dist/effects/{PeppersGhostEffect.mjs → PeppersGhostEffect.cjs} +11 -11
- package/dist/effects/PeppersGhostEffect.js +11 -11
- package/dist/effects/{StereoEffect.mjs → StereoEffect.cjs} +6 -6
- package/dist/effects/StereoEffect.js +6 -6
- package/dist/environments/RoomEnvironment.cjs +95 -0
- package/dist/environments/RoomEnvironment.js +23 -40
- package/dist/exporters/{ColladaExporter.mjs → ColladaExporter.cjs} +16 -16
- package/dist/exporters/ColladaExporter.js +16 -16
- package/dist/exporters/{DRACOExporter.mjs → DRACOExporter.cjs} +8 -8
- package/dist/exporters/DRACOExporter.js +8 -8
- package/dist/exporters/{GLTFExporter.mjs → GLTFExporter.cjs} +52 -49
- package/dist/exporters/GLTFExporter.js +52 -49
- package/dist/exporters/{MMDExporter.mjs → MMDExporter.cjs} +10 -10
- package/dist/exporters/MMDExporter.js +10 -10
- package/dist/exporters/{OBJExporter.mjs → OBJExporter.cjs} +13 -13
- package/dist/exporters/OBJExporter.js +13 -13
- package/dist/exporters/{PLYExporter.mjs → PLYExporter.cjs} +8 -8
- package/dist/exporters/PLYExporter.js +8 -8
- package/dist/exporters/{STLExporter.mjs → STLExporter.cjs} +12 -12
- package/dist/exporters/STLExporter.js +12 -12
- package/dist/exporters/{USDZExporter.mjs → USDZExporter.cjs} +10 -10
- package/dist/exporters/USDZExporter.js +10 -10
- package/dist/geometries/{BoxLineGeometry.mjs → BoxLineGeometry.cjs} +6 -6
- package/dist/geometries/BoxLineGeometry.js +6 -6
- package/dist/geometries/ConvexGeometry.cjs +26 -0
- package/dist/geometries/ConvexGeometry.js +9 -9
- package/dist/geometries/{DecalGeometry.mjs → DecalGeometry.cjs} +16 -16
- package/dist/geometries/DecalGeometry.js +16 -16
- package/dist/geometries/{LightningStrike.mjs → LightningStrike.cjs} +45 -45
- package/dist/geometries/LightningStrike.js +45 -45
- package/dist/geometries/{ParametricGeometries.mjs → ParametricGeometries.cjs} +11 -11
- package/dist/geometries/ParametricGeometries.js +11 -11
- package/dist/geometries/{ParametricGeometry.mjs → ParametricGeometry.cjs} +11 -11
- package/dist/geometries/ParametricGeometry.js +11 -11
- package/dist/geometries/{RoundedBoxGeometry.mjs → RoundedBoxGeometry.cjs} +10 -10
- package/dist/geometries/RoundedBoxGeometry.js +10 -10
- package/dist/geometries/{TeapotGeometry.mjs → TeapotGeometry.cjs} +21 -21
- package/dist/geometries/TeapotGeometry.js +21 -21
- package/dist/geometries/{TextGeometry.mjs → TextGeometry.cjs} +6 -6
- package/dist/geometries/TextGeometry.js +6 -6
- package/dist/helpers/{LightProbeHelper.mjs → LightProbeHelper.cjs} +7 -7
- package/dist/helpers/LightProbeHelper.js +7 -7
- package/dist/helpers/{PositionalAudioHelper.mjs → PositionalAudioHelper.cjs} +11 -11
- package/dist/helpers/PositionalAudioHelper.js +11 -11
- package/dist/helpers/{RectAreaLightHelper.mjs → RectAreaLightHelper.cjs} +11 -11
- package/dist/helpers/RectAreaLightHelper.js +11 -11
- package/dist/helpers/{VertexNormalsHelper.mjs → VertexNormalsHelper.cjs} +11 -11
- package/dist/helpers/VertexNormalsHelper.js +11 -11
- package/dist/helpers/{VertexTangentsHelper.mjs → VertexTangentsHelper.cjs} +10 -10
- package/dist/helpers/VertexTangentsHelper.js +10 -10
- package/dist/index.cjs +613 -0
- package/dist/index.js +613 -613
- package/dist/interactive/{HTMLMesh.mjs → HTMLMesh.cjs} +11 -11
- package/dist/interactive/HTMLMesh.js +11 -11
- package/dist/interactive/{InteractiveGroup.mjs → InteractiveGroup.cjs} +8 -8
- package/dist/interactive/InteractiveGroup.js +8 -8
- package/dist/interactive/{SelectionBox.mjs → SelectionBox.cjs} +21 -21
- package/dist/interactive/SelectionBox.js +21 -21
- package/dist/interactive/{SelectionHelper.mjs → SelectionHelper.cjs} +7 -7
- package/dist/interactive/SelectionHelper.js +7 -7
- package/dist/libs/{MeshoptDecoder.mjs → MeshoptDecoder.cjs} +3 -3
- package/dist/libs/MeshoptDecoder.js +3 -3
- package/dist/libs/{MotionControllers.mjs → MotionControllers.cjs} +6 -6
- package/dist/libs/MotionControllers.js +6 -6
- package/dist/lights/{LightProbeGenerator.mjs → LightProbeGenerator.cjs} +16 -16
- package/dist/lights/LightProbeGenerator.js +16 -16
- package/dist/lights/{RectAreaLightUniformsLib.mjs → RectAreaLightUniformsLib.cjs} +42 -42
- package/dist/lights/RectAreaLightUniformsLib.js +42 -42
- package/dist/lines/Line2.cjs +13 -0
- package/dist/lines/Line2.js +8 -8
- package/dist/lines/{LineGeometry.mjs → LineGeometry.cjs} +5 -5
- package/dist/lines/LineGeometry.js +5 -5
- package/dist/lines/{LineMaterial.mjs → LineMaterial.cjs} +10 -10
- package/dist/lines/LineMaterial.js +10 -10
- package/dist/lines/{LineSegments2.mjs → LineSegments2.cjs} +28 -28
- package/dist/lines/LineSegments2.js +28 -28
- package/dist/lines/{LineSegmentsGeometry.mjs → LineSegmentsGeometry.cjs} +18 -18
- package/dist/lines/LineSegmentsGeometry.js +18 -18
- package/dist/lines/Wireframe.cjs +32 -0
- package/dist/lines/Wireframe.js +13 -13
- package/dist/lines/WireframeGeometry2.cjs +13 -0
- package/dist/lines/WireframeGeometry2.js +7 -7
- package/dist/loaders/{3DMLoader.mjs → 3DMLoader.cjs} +37 -37
- package/dist/loaders/3DMLoader.js +37 -37
- package/dist/loaders/{3MFLoader.mjs → 3MFLoader.cjs} +53 -53
- package/dist/loaders/3MFLoader.js +53 -53
- package/dist/loaders/{AMFLoader.mjs → AMFLoader.cjs} +19 -19
- package/dist/loaders/AMFLoader.js +19 -19
- package/dist/loaders/{AssimpLoader.mjs → AssimpLoader.cjs} +41 -41
- package/dist/loaders/AssimpLoader.js +41 -41
- package/dist/loaders/{BVHLoader.mjs → BVHLoader.cjs} +18 -18
- package/dist/loaders/BVHLoader.js +18 -18
- package/dist/loaders/{BasisTextureLoader.mjs → BasisTextureLoader.cjs} +22 -22
- package/dist/loaders/BasisTextureLoader.js +22 -22
- package/dist/loaders/{ColladaLoader.mjs → ColladaLoader.cjs} +76 -76
- package/dist/loaders/ColladaLoader.js +76 -76
- package/dist/loaders/{DDSLoader.mjs → DDSLoader.cjs} +10 -10
- package/dist/loaders/DDSLoader.js +10 -10
- package/dist/loaders/{DRACOLoader.mjs → DRACOLoader.cjs} +12 -12
- package/dist/loaders/DRACOLoader.js +12 -12
- package/dist/loaders/{EXRLoader.mjs → EXRLoader.cjs} +23 -23
- package/dist/loaders/EXRLoader.js +23 -23
- package/dist/loaders/{FBXLoader.mjs → FBXLoader.cjs} +116 -116
- package/dist/loaders/FBXLoader.js +116 -116
- package/dist/loaders/{FontLoader.mjs → FontLoader.cjs} +9 -9
- package/dist/loaders/FontLoader.js +9 -9
- package/dist/loaders/{GCodeLoader.mjs → GCodeLoader.cjs} +13 -13
- package/dist/loaders/GCodeLoader.js +13 -13
- package/dist/loaders/{GLTFLoader.mjs → GLTFLoader.cjs} +112 -112
- package/dist/loaders/GLTFLoader.js +112 -112
- package/dist/loaders/{HDRCubeTextureLoader.mjs → HDRCubeTextureLoader.cjs} +15 -15
- package/dist/loaders/HDRCubeTextureLoader.js +15 -15
- package/dist/loaders/{KMZLoader.mjs → KMZLoader.cjs} +13 -13
- package/dist/loaders/KMZLoader.js +13 -13
- package/dist/loaders/{KTX2Loader.mjs → KTX2Loader.cjs} +65 -65
- package/dist/loaders/KTX2Loader.js +65 -65
- package/dist/loaders/{KTXLoader.mjs → KTXLoader.cjs} +5 -5
- package/dist/loaders/KTXLoader.js +5 -5
- package/dist/loaders/{LDrawLoader.mjs → LDrawLoader.cjs} +39 -39
- package/dist/loaders/LDrawLoader.js +39 -39
- package/dist/loaders/{LUT3dlLoader.mjs → LUT3dlLoader.cjs} +22 -22
- package/dist/loaders/LUT3dlLoader.js +22 -22
- package/dist/loaders/{LUTCubeLoader.mjs → LUTCubeLoader.cjs} +22 -22
- package/dist/loaders/LUTCubeLoader.js +22 -22
- package/dist/loaders/{LWOLoader.mjs → LWOLoader.cjs} +42 -42
- package/dist/loaders/LWOLoader.js +42 -42
- package/dist/loaders/{LottieLoader.mjs → LottieLoader.cjs} +8 -8
- package/dist/loaders/LottieLoader.js +8 -8
- package/dist/loaders/{MD2Loader.mjs → MD2Loader.cjs} +15 -15
- package/dist/loaders/MD2Loader.js +15 -15
- package/dist/loaders/{MDDLoader.mjs → MDDLoader.cjs} +9 -9
- package/dist/loaders/MDDLoader.js +9 -9
- package/dist/loaders/{MMDLoader.mjs → MMDLoader.cjs} +59 -59
- package/dist/loaders/MMDLoader.js +59 -59
- package/dist/loaders/{MTLLoader.mjs → MTLLoader.cjs} +17 -17
- package/dist/loaders/MTLLoader.js +17 -17
- package/dist/loaders/{NRRDLoader.mjs → NRRDLoader.cjs} +17 -17
- package/dist/loaders/NRRDLoader.js +17 -17
- package/dist/loaders/{OBJLoader.mjs → OBJLoader.cjs} +37 -37
- package/dist/loaders/OBJLoader.js +37 -37
- package/dist/loaders/{PCDLoader.mjs → PCDLoader.cjs} +13 -13
- package/dist/loaders/PCDLoader.js +13 -13
- package/dist/loaders/{PDBLoader.mjs → PDBLoader.cjs} +11 -11
- package/dist/loaders/PDBLoader.js +11 -11
- package/dist/loaders/{PLYLoader.mjs → PLYLoader.cjs} +13 -13
- package/dist/loaders/PLYLoader.js +13 -13
- package/dist/loaders/{PRWMLoader.mjs → PRWMLoader.cjs} +9 -9
- package/dist/loaders/PRWMLoader.js +9 -9
- package/dist/loaders/{PVRLoader.mjs → PVRLoader.cjs} +11 -11
- package/dist/loaders/PVRLoader.js +11 -11
- package/dist/loaders/{RGBELoader.mjs → RGBELoader.cjs} +18 -18
- package/dist/loaders/RGBELoader.js +18 -18
- package/dist/loaders/{RGBMLoader.mjs → RGBMLoader.cjs} +16 -16
- package/dist/loaders/RGBMLoader.js +16 -16
- package/dist/loaders/{STLLoader.mjs → STLLoader.cjs} +15 -15
- package/dist/loaders/STLLoader.js +15 -15
- package/dist/loaders/{SVGLoader.mjs → SVGLoader.cjs} +55 -55
- package/dist/loaders/SVGLoader.js +55 -55
- package/dist/loaders/{TDSLoader.mjs → TDSLoader.cjs} +20 -20
- package/dist/loaders/TDSLoader.js +20 -20
- package/dist/loaders/{TGALoader.mjs → TGALoader.cjs} +6 -6
- package/dist/loaders/TGALoader.js +6 -6
- package/dist/loaders/{TTFLoader.mjs → TTFLoader.cjs} +9 -9
- package/dist/loaders/TTFLoader.js +9 -9
- package/dist/loaders/{TiltLoader.mjs → TiltLoader.cjs} +26 -26
- package/dist/loaders/TiltLoader.js +26 -26
- package/dist/loaders/{VOXLoader.mjs → VOXLoader.cjs} +18 -18
- package/dist/loaders/VOXLoader.js +18 -18
- package/dist/loaders/{VRMLLoader.mjs → VRMLLoader.cjs} +125 -125
- package/dist/loaders/VRMLLoader.js +125 -125
- package/dist/loaders/{VRMLoader.mjs → VRMLoader.cjs} +7 -7
- package/dist/loaders/VRMLoader.js +7 -7
- package/dist/loaders/{VTKLoader.mjs → VTKLoader.cjs} +24 -24
- package/dist/loaders/VTKLoader.js +24 -24
- package/dist/loaders/{XLoader.mjs → XLoader.cjs} +42 -42
- package/dist/loaders/XLoader.js +42 -42
- package/dist/loaders/{XYZLoader.mjs → XYZLoader.cjs} +9 -9
- package/dist/loaders/XYZLoader.js +9 -9
- package/dist/loaders/lwo/{IFFParser.mjs → IFFParser.cjs} +7 -7
- package/dist/loaders/lwo/IFFParser.js +7 -7
- package/dist/loaders/lwo/{LWO2Parser.mjs → LWO2Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO2Parser.js +3 -3
- package/dist/loaders/lwo/{LWO3Parser.mjs → LWO3Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO3Parser.js +3 -3
- package/dist/math/{Capsule.mjs → Capsule.cjs} +8 -8
- package/dist/math/Capsule.js +8 -8
- package/dist/math/{ColorConverter.mjs → ColorConverter.cjs} +7 -7
- package/dist/math/ColorConverter.js +7 -7
- package/dist/math/{ConvexHull.mjs → ConvexHull.cjs} +18 -18
- package/dist/math/ConvexHull.js +18 -18
- package/dist/math/{ImprovedNoise.mjs → ImprovedNoise.cjs} +3 -3
- package/dist/math/ImprovedNoise.js +3 -3
- package/dist/math/{Lut.mjs → Lut.cjs} +14 -14
- package/dist/math/Lut.js +14 -14
- package/dist/math/{MeshSurfaceSampler.mjs → MeshSurfaceSampler.cjs} +6 -6
- package/dist/math/MeshSurfaceSampler.js +6 -6
- package/dist/math/{OBB.mjs → OBB.cjs} +21 -21
- package/dist/math/OBB.js +21 -21
- package/dist/math/{Octree.mjs → Octree.cjs} +19 -19
- package/dist/math/Octree.js +19 -19
- package/dist/math/{SimplexNoise.mjs → SimplexNoise.cjs} +3 -3
- package/dist/math/SimplexNoise.js +3 -3
- package/dist/misc/{ConvexObjectBreaker.mjs → ConvexObjectBreaker.cjs} +25 -25
- package/dist/misc/ConvexObjectBreaker.js +25 -25
- package/dist/misc/{GPUComputationRenderer.mjs → GPUComputationRenderer.cjs} +19 -19
- package/dist/misc/GPUComputationRenderer.js +19 -19
- package/dist/misc/{Gyroscope.mjs → Gyroscope.cjs} +11 -11
- package/dist/misc/Gyroscope.js +11 -11
- package/dist/misc/{MD2Character.mjs → MD2Character.cjs} +14 -14
- package/dist/misc/MD2Character.js +14 -14
- package/dist/misc/{MD2CharacterComplex.mjs → MD2CharacterComplex.cjs} +20 -20
- package/dist/misc/MD2CharacterComplex.js +20 -20
- package/dist/misc/{MorphAnimMesh.mjs → MorphAnimMesh.cjs} +8 -8
- package/dist/misc/MorphAnimMesh.js +8 -8
- package/dist/misc/{MorphBlendMesh.mjs → MorphBlendMesh.cjs} +6 -6
- package/dist/misc/MorphBlendMesh.js +6 -6
- package/dist/misc/{ProgressiveLightmap.mjs → ProgressiveLightmap.cjs} +17 -17
- package/dist/misc/ProgressiveLightmap.js +17 -17
- package/dist/misc/{RollerCoaster.mjs → RollerCoaster.cjs} +77 -77
- package/dist/misc/RollerCoaster.js +77 -77
- package/dist/misc/{Timer.mjs → Timer.cjs} +3 -3
- package/dist/misc/Timer.js +3 -3
- package/dist/misc/{TubePainter.mjs → TubePainter.cjs} +24 -24
- package/dist/misc/TubePainter.js +24 -24
- package/dist/misc/{Volume.mjs → Volume.cjs} +18 -18
- package/dist/misc/Volume.js +18 -18
- package/dist/misc/{VolumeSlice.mjs → VolumeSlice.cjs} +10 -10
- package/dist/misc/VolumeSlice.js +10 -10
- package/dist/misc/{WebGL.mjs → WebGL.cjs} +7 -7
- package/dist/misc/WebGL.js +7 -7
- package/dist/modifiers/{CurveModifier.mjs → CurveModifier.cjs} +17 -17
- package/dist/modifiers/CurveModifier.js +17 -17
- package/dist/modifiers/{EdgeSplitModifier.mjs → EdgeSplitModifier.cjs} +12 -13
- package/dist/modifiers/EdgeSplitModifier.js +13 -12
- package/dist/modifiers/{SimplifyModifier.mjs → SimplifyModifier.cjs} +12 -12
- package/dist/modifiers/SimplifyModifier.js +12 -12
- package/dist/modifiers/{TessellateModifier.mjs → TessellateModifier.cjs} +30 -30
- package/dist/modifiers/TessellateModifier.js +30 -30
- package/dist/objects/{GroundProjectedEnv.mjs → GroundProjectedEnv.cjs} +8 -8
- package/dist/objects/GroundProjectedEnv.js +8 -8
- package/dist/objects/{Lensflare.mjs → Lensflare.cjs} +37 -37
- package/dist/objects/Lensflare.js +37 -37
- package/dist/objects/{LightningStorm.mjs → LightningStorm.cjs} +17 -17
- package/dist/objects/LightningStorm.js +17 -17
- package/dist/objects/{MarchingCubes.mjs → MarchingCubes.cjs} +21 -21
- package/dist/objects/MarchingCubes.js +21 -21
- package/dist/objects/{Reflector.mjs → Reflector.cjs} +23 -23
- package/dist/objects/Reflector.js +23 -23
- package/dist/objects/{ReflectorForSSRPass.mjs → ReflectorForSSRPass.cjs} +33 -33
- package/dist/objects/ReflectorForSSRPass.js +33 -33
- package/dist/objects/ReflectorRTT.cjs +10 -0
- package/dist/objects/ReflectorRTT.js +5 -5
- package/dist/objects/{Refractor.mjs → Refractor.cjs} +26 -26
- package/dist/objects/Refractor.js +26 -26
- package/dist/objects/{ShadowMesh.mjs → ShadowMesh.cjs} +9 -9
- package/dist/objects/ShadowMesh.js +9 -9
- package/dist/objects/{Sky.mjs → Sky.cjs} +11 -11
- package/dist/objects/Sky.js +11 -11
- package/dist/objects/{Water.mjs → Water.cjs} +33 -33
- package/dist/objects/Water.js +33 -33
- package/dist/objects/{Water2.mjs → Water2.cjs} +20 -20
- package/dist/objects/Water2.js +20 -20
- package/dist/physics/{AmmoPhysics.mjs → AmmoPhysics.cjs} +3 -3
- package/dist/physics/AmmoPhysics.js +3 -3
- package/dist/postprocessing/{AdaptiveToneMappingPass.mjs → AdaptiveToneMappingPass.cjs} +32 -32
- package/dist/postprocessing/AdaptiveToneMappingPass.js +32 -32
- package/dist/postprocessing/{AfterimagePass.mjs → AfterimagePass.cjs} +21 -21
- package/dist/postprocessing/AfterimagePass.js +21 -21
- package/dist/postprocessing/{BloomPass.mjs → BloomPass.cjs} +20 -20
- package/dist/postprocessing/BloomPass.js +20 -20
- package/dist/postprocessing/{BokehPass.mjs → BokehPass.cjs} +19 -19
- package/dist/postprocessing/BokehPass.js +19 -19
- package/dist/postprocessing/{ClearPass.mjs → ClearPass.cjs} +7 -7
- package/dist/postprocessing/ClearPass.js +7 -7
- package/dist/postprocessing/{CubeTexturePass.mjs → CubeTexturePass.cjs} +14 -14
- package/dist/postprocessing/CubeTexturePass.js +14 -14
- package/dist/postprocessing/{DotScreenPass.mjs → DotScreenPass.cjs} +12 -12
- package/dist/postprocessing/DotScreenPass.js +12 -12
- package/dist/postprocessing/{EffectComposer.mjs → EffectComposer.cjs} +20 -20
- package/dist/postprocessing/EffectComposer.js +20 -20
- package/dist/postprocessing/{FilmPass.mjs → FilmPass.cjs} +12 -12
- package/dist/postprocessing/FilmPass.js +12 -12
- package/dist/postprocessing/{GlitchPass.mjs → GlitchPass.cjs} +26 -26
- package/dist/postprocessing/GlitchPass.js +26 -26
- package/dist/postprocessing/{HalftonePass.mjs → HalftonePass.cjs} +13 -13
- package/dist/postprocessing/HalftonePass.js +13 -13
- package/dist/postprocessing/{LUTPass.mjs → LUTPass.cjs} +5 -5
- package/dist/postprocessing/LUTPass.js +5 -5
- package/dist/postprocessing/{MaskPass.mjs → MaskPass.cjs} +7 -7
- package/dist/postprocessing/MaskPass.js +7 -7
- package/dist/postprocessing/{OutlinePass.mjs → OutlinePass.cjs} +45 -45
- package/dist/postprocessing/OutlinePass.js +45 -45
- package/dist/postprocessing/{Pass.mjs → Pass.cjs} +8 -8
- package/dist/postprocessing/Pass.js +8 -8
- package/dist/postprocessing/{RenderPass.mjs → RenderPass.cjs} +7 -7
- package/dist/postprocessing/RenderPass.js +7 -7
- package/dist/postprocessing/{RenderPixelatedPass.mjs → RenderPixelatedPass.cjs} +18 -18
- package/dist/postprocessing/RenderPixelatedPass.js +18 -18
- package/dist/postprocessing/{SAOPass.mjs → SAOPass.cjs} +69 -69
- package/dist/postprocessing/SAOPass.js +69 -69
- package/dist/postprocessing/{SMAAPass.mjs → SMAAPass.cjs} +30 -30
- package/dist/postprocessing/SMAAPass.js +30 -30
- package/dist/postprocessing/{SSAARenderPass.mjs → SSAARenderPass.cjs} +19 -19
- package/dist/postprocessing/SSAARenderPass.js +19 -19
- package/dist/postprocessing/{SSAOPass.mjs → SSAOPass.cjs} +63 -63
- package/dist/postprocessing/SSAOPass.js +63 -63
- package/dist/postprocessing/{SSRPass.mjs → SSRPass.cjs} +86 -86
- package/dist/postprocessing/SSRPass.js +86 -86
- package/dist/postprocessing/{SavePass.mjs → SavePass.cjs} +13 -13
- package/dist/postprocessing/SavePass.js +13 -13
- package/dist/postprocessing/{ShaderPass.mjs → ShaderPass.cjs} +10 -10
- package/dist/postprocessing/ShaderPass.js +10 -10
- package/dist/postprocessing/{TAARenderPass.mjs → TAARenderPass.cjs} +8 -8
- package/dist/postprocessing/TAARenderPass.js +8 -8
- package/dist/postprocessing/{TexturePass.mjs → TexturePass.cjs} +11 -11
- package/dist/postprocessing/TexturePass.js +11 -11
- package/dist/postprocessing/{UnrealBloomPass.mjs → UnrealBloomPass.cjs} +36 -36
- package/dist/postprocessing/UnrealBloomPass.js +36 -36
- package/dist/postprocessing/{WaterPass.mjs → WaterPass.cjs} +10 -10
- package/dist/postprocessing/WaterPass.js +10 -10
- package/dist/renderers/{CSS2DRenderer.mjs → CSS2DRenderer.cjs} +12 -12
- package/dist/renderers/CSS2DRenderer.js +12 -12
- package/dist/renderers/{CSS3DRenderer.mjs → CSS3DRenderer.cjs} +12 -12
- package/dist/renderers/CSS3DRenderer.js +12 -12
- package/dist/renderers/{Projector.mjs → Projector.cjs} +21 -21
- package/dist/renderers/Projector.js +21 -21
- package/dist/renderers/{SVGRenderer.mjs → SVGRenderer.cjs} +12 -12
- package/dist/renderers/SVGRenderer.js +12 -12
- package/dist/shaders/{ACESFilmicToneMappingShader.mjs → ACESFilmicToneMappingShader.cjs} +3 -3
- package/dist/shaders/ACESFilmicToneMappingShader.js +3 -3
- package/dist/shaders/{AfterimageShader.mjs → AfterimageShader.cjs} +3 -3
- package/dist/shaders/AfterimageShader.js +3 -3
- package/dist/shaders/{BasicShader.mjs → BasicShader.cjs} +3 -3
- package/dist/shaders/BasicShader.js +3 -3
- package/dist/shaders/{BleachBypassShader.mjs → BleachBypassShader.cjs} +3 -3
- package/dist/shaders/BleachBypassShader.js +3 -3
- package/dist/shaders/{BlendShader.mjs → BlendShader.cjs} +3 -3
- package/dist/shaders/BlendShader.js +3 -3
- package/dist/shaders/{BokehShader.mjs → BokehShader.cjs} +3 -3
- package/dist/shaders/BokehShader.js +3 -3
- package/dist/shaders/{BokehShader2.mjs → BokehShader2.cjs} +6 -6
- package/dist/shaders/BokehShader2.js +6 -6
- package/dist/shaders/{BrightnessContrastShader.mjs → BrightnessContrastShader.cjs} +3 -3
- package/dist/shaders/BrightnessContrastShader.js +3 -3
- package/dist/shaders/{ColorCorrectionShader.mjs → ColorCorrectionShader.cjs} +7 -7
- package/dist/shaders/ColorCorrectionShader.js +7 -7
- package/dist/shaders/{ColorifyShader.mjs → ColorifyShader.cjs} +5 -5
- package/dist/shaders/ColorifyShader.js +5 -5
- package/dist/shaders/{ConvolutionShader.mjs → ConvolutionShader.cjs} +5 -5
- package/dist/shaders/ConvolutionShader.js +5 -5
- package/dist/shaders/{CopyShader.mjs → CopyShader.cjs} +3 -3
- package/dist/shaders/CopyShader.js +3 -3
- package/dist/shaders/{DOFMipMapShader.mjs → DOFMipMapShader.cjs} +3 -3
- package/dist/shaders/DOFMipMapShader.js +3 -3
- package/dist/shaders/{DepthLimitedBlurShader.mjs → DepthLimitedBlurShader.cjs} +7 -7
- package/dist/shaders/DepthLimitedBlurShader.js +7 -7
- package/dist/shaders/{DigitalGlitch.mjs → DigitalGlitch.cjs} +3 -3
- package/dist/shaders/DigitalGlitch.js +3 -3
- package/dist/shaders/{DotScreenShader.mjs → DotScreenShader.cjs} +6 -6
- package/dist/shaders/DotScreenShader.js +6 -6
- package/dist/shaders/{FXAAShader.mjs → FXAAShader.cjs} +5 -5
- package/dist/shaders/FXAAShader.js +5 -5
- package/dist/shaders/{FilmShader.mjs → FilmShader.cjs} +3 -3
- package/dist/shaders/FilmShader.js +3 -3
- package/dist/shaders/{FocusShader.mjs → FocusShader.cjs} +3 -3
- package/dist/shaders/FocusShader.js +3 -3
- package/dist/shaders/{FreiChenShader.mjs → FreiChenShader.cjs} +5 -5
- package/dist/shaders/FreiChenShader.js +5 -5
- package/dist/shaders/{FresnelShader.mjs → FresnelShader.cjs} +3 -3
- package/dist/shaders/FresnelShader.js +3 -3
- package/dist/shaders/{GammaCorrectionShader.mjs → GammaCorrectionShader.cjs} +3 -3
- package/dist/shaders/GammaCorrectionShader.js +3 -3
- package/dist/shaders/{GodRaysShader.mjs → GodRaysShader.cjs} +11 -11
- package/dist/shaders/GodRaysShader.js +11 -11
- package/dist/shaders/{HalftoneShader.mjs → HalftoneShader.cjs} +3 -3
- package/dist/shaders/HalftoneShader.js +3 -3
- package/dist/shaders/{HorizontalBlurShader.mjs → HorizontalBlurShader.cjs} +3 -3
- package/dist/shaders/HorizontalBlurShader.js +3 -3
- package/dist/shaders/{HorizontalTiltShiftShader.mjs → HorizontalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/HorizontalTiltShiftShader.js +3 -3
- package/dist/shaders/{HueSaturationShader.mjs → HueSaturationShader.cjs} +3 -3
- package/dist/shaders/HueSaturationShader.js +3 -3
- package/dist/shaders/{KaleidoShader.mjs → KaleidoShader.cjs} +3 -3
- package/dist/shaders/KaleidoShader.js +3 -3
- package/dist/shaders/{LuminosityHighPassShader.mjs → LuminosityHighPassShader.cjs} +5 -5
- package/dist/shaders/LuminosityHighPassShader.js +5 -5
- package/dist/shaders/{LuminosityShader.mjs → LuminosityShader.cjs} +3 -3
- package/dist/shaders/LuminosityShader.js +3 -3
- package/dist/shaders/{MirrorShader.mjs → MirrorShader.cjs} +3 -3
- package/dist/shaders/MirrorShader.js +3 -3
- package/dist/shaders/{NormalMapShader.mjs → NormalMapShader.cjs} +6 -6
- package/dist/shaders/NormalMapShader.js +6 -6
- package/dist/shaders/{ParallaxShader.mjs → ParallaxShader.cjs} +3 -3
- package/dist/shaders/ParallaxShader.js +3 -3
- package/dist/shaders/{PixelShader.mjs → PixelShader.cjs} +3 -3
- package/dist/shaders/PixelShader.js +3 -3
- package/dist/shaders/{RGBShiftShader.mjs → RGBShiftShader.cjs} +3 -3
- package/dist/shaders/RGBShiftShader.js +3 -3
- package/dist/shaders/{SAOShader.mjs → SAOShader.cjs} +7 -7
- package/dist/shaders/SAOShader.js +7 -7
- package/dist/shaders/{SMAAShader.mjs → SMAAShader.cjs} +9 -9
- package/dist/shaders/SMAAShader.js +9 -9
- package/dist/shaders/{SSAOShader.mjs → SSAOShader.cjs} +10 -10
- package/dist/shaders/SSAOShader.js +10 -10
- package/dist/shaders/{SSRShader.mjs → SSRShader.cjs} +10 -10
- package/dist/shaders/SSRShader.js +10 -10
- package/dist/shaders/{SepiaShader.mjs → SepiaShader.cjs} +3 -3
- package/dist/shaders/SepiaShader.js +3 -3
- package/dist/shaders/{SobelOperatorShader.mjs → SobelOperatorShader.cjs} +5 -5
- package/dist/shaders/SobelOperatorShader.js +5 -5
- package/dist/shaders/{SubsurfaceScatteringShader.mjs → SubsurfaceScatteringShader.cjs} +13 -13
- package/dist/shaders/SubsurfaceScatteringShader.js +13 -13
- package/dist/shaders/{TechnicolorShader.mjs → TechnicolorShader.cjs} +3 -3
- package/dist/shaders/TechnicolorShader.js +3 -3
- package/dist/shaders/{ToneMapShader.mjs → ToneMapShader.cjs} +3 -3
- package/dist/shaders/ToneMapShader.js +3 -3
- package/dist/shaders/{ToonShader.mjs → ToonShader.cjs} +32 -32
- package/dist/shaders/ToonShader.js +32 -32
- package/dist/shaders/{TriangleBlurShader.mjs → TriangleBlurShader.cjs} +5 -5
- package/dist/shaders/TriangleBlurShader.js +5 -5
- package/dist/shaders/{UnpackDepthRGBAShader.mjs → UnpackDepthRGBAShader.cjs} +3 -3
- package/dist/shaders/UnpackDepthRGBAShader.js +3 -3
- package/dist/shaders/{VerticalBlurShader.mjs → VerticalBlurShader.cjs} +3 -3
- package/dist/shaders/VerticalBlurShader.js +3 -3
- package/dist/shaders/{VerticalTiltShiftShader.mjs → VerticalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/VerticalTiltShiftShader.js +3 -3
- package/dist/shaders/{VignetteShader.mjs → VignetteShader.cjs} +3 -3
- package/dist/shaders/VignetteShader.js +3 -3
- package/dist/shaders/{VolumeShader.mjs → VolumeShader.cjs} +6 -6
- package/dist/shaders/VolumeShader.js +6 -6
- package/dist/shaders/{WaterRefractionShader.mjs → WaterRefractionShader.cjs} +3 -3
- package/dist/shaders/WaterRefractionShader.js +3 -3
- package/dist/shaders/types.cjs +1 -0
- package/dist/shaders/types.js +1 -1
- package/dist/textures/{FlakesTexture.mjs → FlakesTexture.cjs} +3 -3
- package/dist/textures/FlakesTexture.js +3 -3
- package/dist/types/Loader.cjs +26 -0
- package/dist/types/Loader.js +5 -22
- package/dist/types/helpers.cjs +4 -0
- package/dist/types/helpers.js +3 -3
- package/dist/utils/{BufferGeometryUtils.mjs → BufferGeometryUtils.cjs} +41 -41
- package/dist/utils/BufferGeometryUtils.js +41 -41
- package/dist/utils/{GeometryCompressionUtils.mjs → GeometryCompressionUtils.cjs} +94 -94
- package/dist/utils/GeometryCompressionUtils.js +94 -94
- package/dist/utils/{GeometryUtils.mjs → GeometryUtils.cjs} +18 -18
- package/dist/utils/GeometryUtils.js +18 -18
- package/dist/utils/{RoughnessMipmapper.mjs → RoughnessMipmapper.cjs} +13 -13
- package/dist/utils/RoughnessMipmapper.js +13 -13
- package/dist/utils/{SceneUtils.mjs → SceneUtils.cjs} +8 -8
- package/dist/utils/SceneUtils.js +8 -8
- package/dist/utils/{ShadowMapViewer.mjs → ShadowMapViewer.cjs} +18 -18
- package/dist/utils/ShadowMapViewer.js +18 -18
- package/dist/utils/{SkeletonUtils.mjs → SkeletonUtils.cjs} +10 -10
- package/dist/utils/SkeletonUtils.js +10 -10
- package/dist/utils/{UVsDebug.mjs → UVsDebug.cjs} +7 -7
- package/dist/utils/UVsDebug.js +7 -7
- package/dist/utils/{WorkerPool.mjs → WorkerPool.cjs} +3 -3
- package/dist/utils/WorkerPool.js +3 -3
- package/dist/webxr/{ARButton.mjs → ARButton.cjs} +3 -3
- package/dist/webxr/ARButton.js +3 -3
- package/dist/webxr/{OculusHandModel.mjs → OculusHandModel.cjs} +9 -9
- package/dist/webxr/OculusHandModel.js +9 -9
- package/dist/webxr/{OculusHandPointerModel.mjs → OculusHandPointerModel.cjs} +41 -24
- package/dist/webxr/OculusHandPointerModel.js +24 -41
- package/dist/webxr/Text2D.cjs +48 -0
- package/dist/webxr/Text2D.js +9 -26
- package/dist/webxr/{VRButton.mjs → VRButton.cjs} +3 -3
- package/dist/webxr/VRButton.js +3 -3
- package/dist/webxr/{XRControllerModelFactory.mjs → XRControllerModelFactory.cjs} +18 -18
- package/dist/webxr/XRControllerModelFactory.js +18 -18
- package/dist/webxr/{XREstimatedLight.mjs → XREstimatedLight.cjs} +8 -8
- package/dist/webxr/XREstimatedLight.js +8 -8
- package/dist/webxr/{XRHandMeshModel.mjs → XRHandMeshModel.cjs} +5 -5
- package/dist/webxr/XRHandMeshModel.js +5 -5
- package/dist/webxr/{XRHandModelFactory.mjs → XRHandModelFactory.cjs} +10 -10
- package/dist/webxr/XRHandModelFactory.js +10 -10
- package/dist/webxr/{XRHandPrimitiveModel.mjs → XRHandPrimitiveModel.cjs} +11 -11
- package/dist/webxr/XRHandPrimitiveModel.js +11 -11
- package/package.json +3 -3
- package/dist/_polyfill/CompressedArrayTexture.mjs +0 -12
- package/dist/_polyfill/Data3DTexture.mjs +0 -17
- package/dist/environments/RoomEnvironment.mjs +0 -78
- package/dist/geometries/ConvexGeometry.mjs +0 -26
- package/dist/index.mjs +0 -613
- package/dist/lines/Line2.mjs +0 -13
- package/dist/lines/Wireframe.mjs +0 -32
- package/dist/lines/WireframeGeometry2.mjs +0 -13
- package/dist/objects/ReflectorRTT.mjs +0 -10
- package/dist/shaders/types.mjs +0 -1
- package/dist/types/Loader.mjs +0 -9
- package/dist/types/helpers.mjs +0 -4
- package/dist/webxr/Text2D.mjs +0 -31
@@ -1,13 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const THREE = require("three");
|
4
|
+
const chevrotain = require("chevrotain");
|
5
|
+
class VRMLLoader extends THREE.Loader {
|
4
6
|
constructor(manager) {
|
5
7
|
super(manager);
|
6
8
|
}
|
7
9
|
load(url, onLoad, onProgress, onError) {
|
8
10
|
const scope = this;
|
9
|
-
const path = scope.path === "" ? LoaderUtils.extractUrlBase(url) : scope.path;
|
10
|
-
const loader = new FileLoader(scope.manager);
|
11
|
+
const path = scope.path === "" ? THREE.LoaderUtils.extractUrlBase(url) : scope.path;
|
12
|
+
const loader = new THREE.FileLoader(scope.manager);
|
11
13
|
loader.setPath(scope.path);
|
12
14
|
loader.setRequestHeader(scope.requestHeader);
|
13
15
|
loader.setWithCredentials(scope.withCredentials);
|
@@ -47,11 +49,11 @@ class VRMLLoader extends Loader {
|
|
47
49
|
return ast;
|
48
50
|
}
|
49
51
|
function createTokens() {
|
50
|
-
const RouteIdentifier = createToken({
|
52
|
+
const RouteIdentifier = chevrotain.createToken({
|
51
53
|
name: "RouteIdentifier",
|
52
54
|
pattern: /[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/
|
53
55
|
});
|
54
|
-
const Identifier = createToken({
|
56
|
+
const Identifier = chevrotain.createToken({
|
55
57
|
name: "Identifier",
|
56
58
|
pattern: /[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/,
|
57
59
|
longer_alt: RouteIdentifier
|
@@ -122,58 +124,58 @@ class VRMLLoader extends Loader {
|
|
122
124
|
"Text"
|
123
125
|
// Text must be placed at the end of the regex so there are no matches for TextureTransform and TextureCoordinate
|
124
126
|
];
|
125
|
-
const Version = createToken({
|
127
|
+
const Version = chevrotain.createToken({
|
126
128
|
name: "Version",
|
127
129
|
pattern: /#VRML.*/,
|
128
130
|
longer_alt: Identifier
|
129
131
|
});
|
130
|
-
const NodeName = createToken({
|
132
|
+
const NodeName = chevrotain.createToken({
|
131
133
|
name: "NodeName",
|
132
134
|
pattern: new RegExp(nodeTypes.join("|")),
|
133
135
|
longer_alt: Identifier
|
134
136
|
});
|
135
|
-
const DEF = createToken({
|
137
|
+
const DEF = chevrotain.createToken({
|
136
138
|
name: "DEF",
|
137
139
|
pattern: /DEF/,
|
138
140
|
longer_alt: Identifier
|
139
141
|
});
|
140
|
-
const USE = createToken({
|
142
|
+
const USE = chevrotain.createToken({
|
141
143
|
name: "USE",
|
142
144
|
pattern: /USE/,
|
143
145
|
longer_alt: Identifier
|
144
146
|
});
|
145
|
-
const ROUTE = createToken({
|
147
|
+
const ROUTE = chevrotain.createToken({
|
146
148
|
name: "ROUTE",
|
147
149
|
pattern: /ROUTE/,
|
148
150
|
longer_alt: Identifier
|
149
151
|
});
|
150
|
-
const TO = createToken({
|
152
|
+
const TO = chevrotain.createToken({
|
151
153
|
name: "TO",
|
152
154
|
pattern: /TO/,
|
153
155
|
longer_alt: Identifier
|
154
156
|
});
|
155
|
-
const StringLiteral = createToken({
|
157
|
+
const StringLiteral = chevrotain.createToken({
|
156
158
|
name: "StringLiteral",
|
157
159
|
pattern: /"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/
|
158
160
|
});
|
159
|
-
const HexLiteral = createToken({ name: "HexLiteral", pattern: /0[xX][0-9a-fA-F]+/ });
|
160
|
-
const NumberLiteral = createToken({ name: "NumberLiteral", pattern: /[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/ });
|
161
|
-
const TrueLiteral = createToken({ name: "TrueLiteral", pattern: /TRUE/ });
|
162
|
-
const FalseLiteral = createToken({ name: "FalseLiteral", pattern: /FALSE/ });
|
163
|
-
const NullLiteral = createToken({ name: "NullLiteral", pattern: /NULL/ });
|
164
|
-
const LSquare = createToken({ name: "LSquare", pattern: /\[/ });
|
165
|
-
const RSquare = createToken({ name: "RSquare", pattern: /]/ });
|
166
|
-
const LCurly = createToken({ name: "LCurly", pattern: /{/ });
|
167
|
-
const RCurly = createToken({ name: "RCurly", pattern: /}/ });
|
168
|
-
const Comment = createToken({
|
161
|
+
const HexLiteral = chevrotain.createToken({ name: "HexLiteral", pattern: /0[xX][0-9a-fA-F]+/ });
|
162
|
+
const NumberLiteral = chevrotain.createToken({ name: "NumberLiteral", pattern: /[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/ });
|
163
|
+
const TrueLiteral = chevrotain.createToken({ name: "TrueLiteral", pattern: /TRUE/ });
|
164
|
+
const FalseLiteral = chevrotain.createToken({ name: "FalseLiteral", pattern: /FALSE/ });
|
165
|
+
const NullLiteral = chevrotain.createToken({ name: "NullLiteral", pattern: /NULL/ });
|
166
|
+
const LSquare = chevrotain.createToken({ name: "LSquare", pattern: /\[/ });
|
167
|
+
const RSquare = chevrotain.createToken({ name: "RSquare", pattern: /]/ });
|
168
|
+
const LCurly = chevrotain.createToken({ name: "LCurly", pattern: /{/ });
|
169
|
+
const RCurly = chevrotain.createToken({ name: "RCurly", pattern: /}/ });
|
170
|
+
const Comment = chevrotain.createToken({
|
169
171
|
name: "Comment",
|
170
172
|
pattern: /#.*/,
|
171
|
-
group: Lexer.SKIPPED
|
173
|
+
group: chevrotain.Lexer.SKIPPED
|
172
174
|
});
|
173
|
-
const WhiteSpace = createToken({
|
175
|
+
const WhiteSpace = chevrotain.createToken({
|
174
176
|
name: "WhiteSpace",
|
175
177
|
pattern: /[ ,\s]/,
|
176
|
-
group: Lexer.SKIPPED
|
178
|
+
group: chevrotain.Lexer.SKIPPED
|
177
179
|
});
|
178
180
|
const tokens = [
|
179
181
|
WhiteSpace,
|
@@ -355,7 +357,7 @@ class VRMLLoader extends Loader {
|
|
355
357
|
}
|
356
358
|
function parseTree(tree2) {
|
357
359
|
const nodes = tree2.nodes;
|
358
|
-
const scene2 = new Scene();
|
360
|
+
const scene2 = new THREE.Scene();
|
359
361
|
for (let i = 0, l = nodes.length; i < l; i++) {
|
360
362
|
const node = nodes[i];
|
361
363
|
buildNodeMap(node);
|
@@ -363,7 +365,7 @@ class VRMLLoader extends Loader {
|
|
363
365
|
for (let i = 0, l = nodes.length; i < l; i++) {
|
364
366
|
const node = nodes[i];
|
365
367
|
const object = getNode(node);
|
366
|
-
if (object instanceof Object3D)
|
368
|
+
if (object instanceof THREE.Object3D)
|
367
369
|
scene2.add(object);
|
368
370
|
if (node.name === "WorldInfo")
|
369
371
|
scene2.userData.worldInfo = object;
|
@@ -501,7 +503,7 @@ class VRMLLoader extends Loader {
|
|
501
503
|
return build;
|
502
504
|
}
|
503
505
|
function buildGroupingNode(node) {
|
504
|
-
const object = new Group();
|
506
|
+
const object = new THREE.Group();
|
505
507
|
const fields = node.fields;
|
506
508
|
for (let i = 0, l = fields.length; i < l; i++) {
|
507
509
|
const field = fields[i];
|
@@ -520,7 +522,7 @@ class VRMLLoader extends Loader {
|
|
520
522
|
case "collide":
|
521
523
|
break;
|
522
524
|
case "rotation":
|
523
|
-
const axis = new Vector3(fieldValues[0], fieldValues[1], fieldValues[2]);
|
525
|
+
const axis = new THREE.Vector3(fieldValues[0], fieldValues[1], fieldValues[2]);
|
524
526
|
const angle = fieldValues[3];
|
525
527
|
object.quaternion.setFromAxisAngle(axis, angle);
|
526
528
|
break;
|
@@ -542,7 +544,7 @@ class VRMLLoader extends Loader {
|
|
542
544
|
return object;
|
543
545
|
}
|
544
546
|
function buildBackgroundNode(node) {
|
545
|
-
const group = new Group();
|
547
|
+
const group = new THREE.Group();
|
546
548
|
let groundAngle, groundColor;
|
547
549
|
let skyAngle, skyColor;
|
548
550
|
const fields = node.fields;
|
@@ -582,29 +584,29 @@ class VRMLLoader extends Loader {
|
|
582
584
|
}
|
583
585
|
const radius = 1e4;
|
584
586
|
if (skyColor) {
|
585
|
-
const skyGeometry = new SphereGeometry(radius, 32, 16);
|
586
|
-
const skyMaterial = new MeshBasicMaterial({ fog: false, side: BackSide, depthWrite: false, depthTest: false });
|
587
|
+
const skyGeometry = new THREE.SphereGeometry(radius, 32, 16);
|
588
|
+
const skyMaterial = new THREE.MeshBasicMaterial({ fog: false, side: THREE.BackSide, depthWrite: false, depthTest: false });
|
587
589
|
if (skyColor.length > 3) {
|
588
590
|
paintFaces(skyGeometry, radius, skyAngle, toColorArray(skyColor), true);
|
589
591
|
skyMaterial.vertexColors = true;
|
590
592
|
} else {
|
591
593
|
skyMaterial.color.setRGB(skyColor[0], skyColor[1], skyColor[2]);
|
592
594
|
}
|
593
|
-
const sky = new Mesh(skyGeometry, skyMaterial);
|
595
|
+
const sky = new THREE.Mesh(skyGeometry, skyMaterial);
|
594
596
|
group.add(sky);
|
595
597
|
}
|
596
598
|
if (groundColor) {
|
597
599
|
if (groundColor.length > 0) {
|
598
|
-
const groundGeometry = new SphereGeometry(radius, 32, 16, 0, 2 * Math.PI, 0.5 * Math.PI, 1.5 * Math.PI);
|
599
|
-
const groundMaterial = new MeshBasicMaterial({
|
600
|
+
const groundGeometry = new THREE.SphereGeometry(radius, 32, 16, 0, 2 * Math.PI, 0.5 * Math.PI, 1.5 * Math.PI);
|
601
|
+
const groundMaterial = new THREE.MeshBasicMaterial({
|
600
602
|
fog: false,
|
601
|
-
side: BackSide,
|
603
|
+
side: THREE.BackSide,
|
602
604
|
vertexColors: true,
|
603
605
|
depthWrite: false,
|
604
606
|
depthTest: false
|
605
607
|
});
|
606
608
|
paintFaces(groundGeometry, radius, groundAngle, toColorArray(groundColor), false);
|
607
|
-
const ground = new Mesh(groundGeometry, groundMaterial);
|
609
|
+
const ground = new THREE.Mesh(groundGeometry, groundMaterial);
|
608
610
|
group.add(ground);
|
609
611
|
}
|
610
612
|
}
|
@@ -613,7 +615,7 @@ class VRMLLoader extends Loader {
|
|
613
615
|
}
|
614
616
|
function buildShapeNode(node) {
|
615
617
|
const fields = node.fields;
|
616
|
-
let material = new MeshBasicMaterial({ color: 0 });
|
618
|
+
let material = new THREE.MeshBasicMaterial({ color: 0 });
|
617
619
|
let geometry;
|
618
620
|
for (let i = 0, l = fields.length; i < l; i++) {
|
619
621
|
const field = fields[i];
|
@@ -639,7 +641,7 @@ class VRMLLoader extends Loader {
|
|
639
641
|
if (geometry && geometry.attributes.position) {
|
640
642
|
const type = geometry._type;
|
641
643
|
if (type === "points") {
|
642
|
-
const pointsMaterial = new PointsMaterial({ color: 16777215 });
|
644
|
+
const pointsMaterial = new THREE.PointsMaterial({ color: 16777215 });
|
643
645
|
if (geometry.attributes.color !== void 0) {
|
644
646
|
pointsMaterial.vertexColors = true;
|
645
647
|
} else {
|
@@ -647,9 +649,9 @@ class VRMLLoader extends Loader {
|
|
647
649
|
pointsMaterial.color.copy(material.emissive);
|
648
650
|
}
|
649
651
|
}
|
650
|
-
object = new Points(geometry, pointsMaterial);
|
652
|
+
object = new THREE.Points(geometry, pointsMaterial);
|
651
653
|
} else if (type === "line") {
|
652
|
-
const lineMaterial = new LineBasicMaterial({ color: 16777215 });
|
654
|
+
const lineMaterial = new THREE.LineBasicMaterial({ color: 16777215 });
|
653
655
|
if (geometry.attributes.color !== void 0) {
|
654
656
|
lineMaterial.vertexColors = true;
|
655
657
|
} else {
|
@@ -657,24 +659,24 @@ class VRMLLoader extends Loader {
|
|
657
659
|
lineMaterial.color.copy(material.emissive);
|
658
660
|
}
|
659
661
|
}
|
660
|
-
object = new LineSegments(geometry, lineMaterial);
|
662
|
+
object = new THREE.LineSegments(geometry, lineMaterial);
|
661
663
|
} else {
|
662
664
|
if (geometry._solid !== void 0) {
|
663
|
-
material.side = geometry._solid ? FrontSide : DoubleSide;
|
665
|
+
material.side = geometry._solid ? THREE.FrontSide : THREE.DoubleSide;
|
664
666
|
}
|
665
667
|
if (geometry.attributes.color !== void 0) {
|
666
668
|
material.vertexColors = true;
|
667
669
|
}
|
668
|
-
object = new Mesh(geometry, material);
|
670
|
+
object = new THREE.Mesh(geometry, material);
|
669
671
|
}
|
670
672
|
} else {
|
671
|
-
object = new Object3D();
|
673
|
+
object = new THREE.Object3D();
|
672
674
|
object.visible = false;
|
673
675
|
}
|
674
676
|
return object;
|
675
677
|
}
|
676
678
|
function buildAppearanceNode(node) {
|
677
|
-
let material = new MeshPhongMaterial();
|
679
|
+
let material = new THREE.MeshPhongMaterial();
|
678
680
|
let transformData;
|
679
681
|
const fields = node.fields;
|
680
682
|
for (let i = 0, l = fields.length; i < l; i++) {
|
@@ -698,7 +700,7 @@ class VRMLLoader extends Loader {
|
|
698
700
|
if (materialData.transparency > 0)
|
699
701
|
material.transparent = true;
|
700
702
|
} else {
|
701
|
-
material = new MeshBasicMaterial({ color: 0 });
|
703
|
+
material = new THREE.MeshBasicMaterial({ color: 0 });
|
702
704
|
}
|
703
705
|
break;
|
704
706
|
case "texture":
|
@@ -757,16 +759,16 @@ class VRMLLoader extends Loader {
|
|
757
759
|
case "ambientIntensity":
|
758
760
|
break;
|
759
761
|
case "diffuseColor":
|
760
|
-
materialData.diffuseColor = new Color(fieldValues[0], fieldValues[1], fieldValues[2]);
|
762
|
+
materialData.diffuseColor = new THREE.Color(fieldValues[0], fieldValues[1], fieldValues[2]);
|
761
763
|
break;
|
762
764
|
case "emissiveColor":
|
763
|
-
materialData.emissiveColor = new Color(fieldValues[0], fieldValues[1], fieldValues[2]);
|
765
|
+
materialData.emissiveColor = new THREE.Color(fieldValues[0], fieldValues[1], fieldValues[2]);
|
764
766
|
break;
|
765
767
|
case "shininess":
|
766
768
|
materialData.shininess = fieldValues[0];
|
767
769
|
break;
|
768
770
|
case "specularColor":
|
769
|
-
materialData.emissiveColor = new Color(fieldValues[0], fieldValues[1], fieldValues[2]);
|
771
|
+
materialData.emissiveColor = new THREE.Color(fieldValues[0], fieldValues[1], fieldValues[2]);
|
770
772
|
break;
|
771
773
|
case "transparency":
|
772
774
|
materialData.transparency = fieldValues[0];
|
@@ -831,8 +833,8 @@ class VRMLLoader extends Loader {
|
|
831
833
|
}
|
832
834
|
function buildPixelTextureNode(node) {
|
833
835
|
let texture;
|
834
|
-
let wrapS = RepeatWrapping;
|
835
|
-
let wrapT = RepeatWrapping;
|
836
|
+
let wrapS = THREE.RepeatWrapping;
|
837
|
+
let wrapT = THREE.RepeatWrapping;
|
836
838
|
const fields = node.fields;
|
837
839
|
for (let i = 0, l = fields.length; i < l; i++) {
|
838
840
|
const field = fields[i];
|
@@ -854,17 +856,17 @@ class VRMLLoader extends Loader {
|
|
854
856
|
data2[stride + 2] = color.b;
|
855
857
|
data2[stride + 3] = color.a;
|
856
858
|
}
|
857
|
-
texture = new DataTexture(data2, width, height);
|
859
|
+
texture = new THREE.DataTexture(data2, width, height);
|
858
860
|
texture.needsUpdate = true;
|
859
861
|
texture.__type = textureType;
|
860
862
|
break;
|
861
863
|
case "repeatS":
|
862
864
|
if (fieldValues[0] === false)
|
863
|
-
wrapS = ClampToEdgeWrapping;
|
865
|
+
wrapS = THREE.ClampToEdgeWrapping;
|
864
866
|
break;
|
865
867
|
case "repeatT":
|
866
868
|
if (fieldValues[0] === false)
|
867
|
-
wrapT = ClampToEdgeWrapping;
|
869
|
+
wrapT = THREE.ClampToEdgeWrapping;
|
868
870
|
break;
|
869
871
|
default:
|
870
872
|
console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
|
@@ -879,8 +881,8 @@ class VRMLLoader extends Loader {
|
|
879
881
|
}
|
880
882
|
function buildImageTextureNode(node) {
|
881
883
|
let texture;
|
882
|
-
let wrapS = RepeatWrapping;
|
883
|
-
let wrapT = RepeatWrapping;
|
884
|
+
let wrapS = THREE.RepeatWrapping;
|
885
|
+
let wrapT = THREE.RepeatWrapping;
|
884
886
|
const fields = node.fields;
|
885
887
|
for (let i = 0, l = fields.length; i < l; i++) {
|
886
888
|
const field = fields[i];
|
@@ -894,11 +896,11 @@ class VRMLLoader extends Loader {
|
|
894
896
|
break;
|
895
897
|
case "repeatS":
|
896
898
|
if (fieldValues[0] === false)
|
897
|
-
wrapS = ClampToEdgeWrapping;
|
899
|
+
wrapS = THREE.ClampToEdgeWrapping;
|
898
900
|
break;
|
899
901
|
case "repeatT":
|
900
902
|
if (fieldValues[0] === false)
|
901
|
-
wrapT = ClampToEdgeWrapping;
|
903
|
+
wrapT = THREE.ClampToEdgeWrapping;
|
902
904
|
break;
|
903
905
|
default:
|
904
906
|
console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
|
@@ -913,10 +915,10 @@ class VRMLLoader extends Loader {
|
|
913
915
|
}
|
914
916
|
function buildTextureTransformNode(node) {
|
915
917
|
const transformData = {
|
916
|
-
center: new Vector2(),
|
917
|
-
rotation: new Vector2(),
|
918
|
-
scale: new Vector2(),
|
919
|
-
translation: new Vector2()
|
918
|
+
center: new THREE.Vector2(),
|
919
|
+
rotation: new THREE.Vector2(),
|
920
|
+
scale: new THREE.Vector2(),
|
921
|
+
translation: new THREE.Vector2()
|
920
922
|
};
|
921
923
|
const fields = node.fields;
|
922
924
|
for (let i = 0, l = fields.length; i < l; i++) {
|
@@ -1038,7 +1040,7 @@ class VRMLLoader extends Loader {
|
|
1038
1040
|
}
|
1039
1041
|
if (coordIndex === void 0) {
|
1040
1042
|
console.warn("THREE.VRMLLoader: Missing coordIndex.");
|
1041
|
-
return new BufferGeometry();
|
1043
|
+
return new THREE.BufferGeometry();
|
1042
1044
|
}
|
1043
1045
|
const triangulatedCoordIndex = triangulateFaceIndex(coordIndex, ccw);
|
1044
1046
|
let colorAttribute;
|
@@ -1050,7 +1052,7 @@ class VRMLLoader extends Loader {
|
|
1050
1052
|
const triangulatedColorIndex = triangulateFaceIndex(colorIndex, ccw);
|
1051
1053
|
colorAttribute = computeAttributeFromIndexedData(triangulatedCoordIndex, triangulatedColorIndex, color, 3);
|
1052
1054
|
} else {
|
1053
|
-
colorAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(color, 3));
|
1055
|
+
colorAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new THREE.Float32BufferAttribute(color, 3));
|
1054
1056
|
}
|
1055
1057
|
} else {
|
1056
1058
|
if (colorIndex && colorIndex.length > 0) {
|
@@ -1074,7 +1076,7 @@ class VRMLLoader extends Loader {
|
|
1074
1076
|
3
|
1075
1077
|
);
|
1076
1078
|
} else {
|
1077
|
-
normalAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(normal, 3));
|
1079
|
+
normalAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new THREE.Float32BufferAttribute(normal, 3));
|
1078
1080
|
}
|
1079
1081
|
} else {
|
1080
1082
|
if (normalIndex && normalIndex.length > 0) {
|
@@ -1094,11 +1096,11 @@ class VRMLLoader extends Loader {
|
|
1094
1096
|
const triangulatedTexCoordIndex = triangulateFaceIndex(texCoordIndex, ccw);
|
1095
1097
|
uvAttribute = computeAttributeFromIndexedData(triangulatedCoordIndex, triangulatedTexCoordIndex, texCoord, 2);
|
1096
1098
|
} else {
|
1097
|
-
uvAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(texCoord, 2));
|
1099
|
+
uvAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new THREE.Float32BufferAttribute(texCoord, 2));
|
1098
1100
|
}
|
1099
1101
|
}
|
1100
|
-
const geometry = new BufferGeometry();
|
1101
|
-
const positionAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(coord, 3));
|
1102
|
+
const geometry = new THREE.BufferGeometry();
|
1103
|
+
const positionAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new THREE.Float32BufferAttribute(coord, 3));
|
1102
1104
|
geometry.setAttribute("position", positionAttribute);
|
1103
1105
|
geometry.setAttribute("normal", normalAttribute);
|
1104
1106
|
if (colorAttribute)
|
@@ -1153,7 +1155,7 @@ class VRMLLoader extends Loader {
|
|
1153
1155
|
const expandedColorIndex = expandLineIndex(colorIndex);
|
1154
1156
|
colorAttribute = computeAttributeFromIndexedData(expandedLineIndex, expandedColorIndex, color, 3);
|
1155
1157
|
} else {
|
1156
|
-
colorAttribute = toNonIndexedAttribute(expandedLineIndex, new Float32BufferAttribute(color, 3));
|
1158
|
+
colorAttribute = toNonIndexedAttribute(expandedLineIndex, new THREE.Float32BufferAttribute(color, 3));
|
1157
1159
|
}
|
1158
1160
|
} else {
|
1159
1161
|
if (colorIndex.length > 0) {
|
@@ -1166,8 +1168,8 @@ class VRMLLoader extends Loader {
|
|
1166
1168
|
}
|
1167
1169
|
}
|
1168
1170
|
}
|
1169
|
-
const geometry = new BufferGeometry();
|
1170
|
-
const positionAttribute = toNonIndexedAttribute(expandedLineIndex, new Float32BufferAttribute(coord, 3));
|
1171
|
+
const geometry = new THREE.BufferGeometry();
|
1172
|
+
const positionAttribute = toNonIndexedAttribute(expandedLineIndex, new THREE.Float32BufferAttribute(coord, 3));
|
1171
1173
|
geometry.setAttribute("position", positionAttribute);
|
1172
1174
|
if (colorAttribute)
|
1173
1175
|
geometry.setAttribute("color", colorAttribute);
|
@@ -1199,15 +1201,15 @@ class VRMLLoader extends Loader {
|
|
1199
1201
|
break;
|
1200
1202
|
}
|
1201
1203
|
}
|
1202
|
-
const geometry = new BufferGeometry();
|
1203
|
-
geometry.setAttribute("position", new Float32BufferAttribute(coord, 3));
|
1204
|
+
const geometry = new THREE.BufferGeometry();
|
1205
|
+
geometry.setAttribute("position", new THREE.Float32BufferAttribute(coord, 3));
|
1204
1206
|
if (color)
|
1205
|
-
geometry.setAttribute("color", new Float32BufferAttribute(color, 3));
|
1207
|
+
geometry.setAttribute("color", new THREE.Float32BufferAttribute(color, 3));
|
1206
1208
|
geometry._type = "points";
|
1207
1209
|
return geometry;
|
1208
1210
|
}
|
1209
1211
|
function buildBoxNode(node) {
|
1210
|
-
const size = new Vector3(2, 2, 2);
|
1212
|
+
const size = new THREE.Vector3(2, 2, 2);
|
1211
1213
|
const fields = node.fields;
|
1212
1214
|
for (let i = 0, l = fields.length; i < l; i++) {
|
1213
1215
|
const field = fields[i];
|
@@ -1224,7 +1226,7 @@ class VRMLLoader extends Loader {
|
|
1224
1226
|
break;
|
1225
1227
|
}
|
1226
1228
|
}
|
1227
|
-
const geometry = new BoxGeometry(size.x, size.y, size.z);
|
1229
|
+
const geometry = new THREE.BoxGeometry(size.x, size.y, size.z);
|
1228
1230
|
return geometry;
|
1229
1231
|
}
|
1230
1232
|
function buildConeNode(node) {
|
@@ -1251,7 +1253,7 @@ class VRMLLoader extends Loader {
|
|
1251
1253
|
break;
|
1252
1254
|
}
|
1253
1255
|
}
|
1254
|
-
const geometry = new ConeGeometry(radius, height, 16, 1, openEnded);
|
1256
|
+
const geometry = new THREE.ConeGeometry(radius, height, 16, 1, openEnded);
|
1255
1257
|
return geometry;
|
1256
1258
|
}
|
1257
1259
|
function buildCylinderNode(node) {
|
@@ -1279,7 +1281,7 @@ class VRMLLoader extends Loader {
|
|
1279
1281
|
break;
|
1280
1282
|
}
|
1281
1283
|
}
|
1282
|
-
const geometry = new CylinderGeometry(radius, radius, height, 16, 1);
|
1284
|
+
const geometry = new THREE.CylinderGeometry(radius, radius, height, 16, 1);
|
1283
1285
|
return geometry;
|
1284
1286
|
}
|
1285
1287
|
function buildSphereNode(node) {
|
@@ -1298,7 +1300,7 @@ class VRMLLoader extends Loader {
|
|
1298
1300
|
break;
|
1299
1301
|
}
|
1300
1302
|
}
|
1301
|
-
const geometry = new SphereGeometry(radius, 16, 16);
|
1303
|
+
const geometry = new THREE.SphereGeometry(radius, 16, 16);
|
1302
1304
|
return geometry;
|
1303
1305
|
}
|
1304
1306
|
function buildElevationGridNode(node) {
|
@@ -1422,8 +1424,8 @@ class VRMLLoader extends Loader {
|
|
1422
1424
|
}
|
1423
1425
|
}
|
1424
1426
|
}
|
1425
|
-
const positionAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(vertices, 3));
|
1426
|
-
const uvAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(uvs, 2));
|
1427
|
+
const positionAttribute = toNonIndexedAttribute(indices, new THREE.Float32BufferAttribute(vertices, 3));
|
1428
|
+
const uvAttribute = toNonIndexedAttribute(indices, new THREE.Float32BufferAttribute(uvs, 2));
|
1427
1429
|
let colorAttribute;
|
1428
1430
|
let normalAttribute;
|
1429
1431
|
if (color) {
|
@@ -1442,9 +1444,9 @@ class VRMLLoader extends Loader {
|
|
1442
1444
|
colors.push(r, g, b);
|
1443
1445
|
}
|
1444
1446
|
}
|
1445
|
-
colorAttribute = new Float32BufferAttribute(colors, 3);
|
1447
|
+
colorAttribute = new THREE.Float32BufferAttribute(colors, 3);
|
1446
1448
|
} else {
|
1447
|
-
colorAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(colors, 3));
|
1449
|
+
colorAttribute = toNonIndexedAttribute(indices, new THREE.Float32BufferAttribute(colors, 3));
|
1448
1450
|
}
|
1449
1451
|
}
|
1450
1452
|
if (normal) {
|
@@ -1463,14 +1465,14 @@ class VRMLLoader extends Loader {
|
|
1463
1465
|
normals.push(xn, yn, zn);
|
1464
1466
|
}
|
1465
1467
|
}
|
1466
|
-
normalAttribute = new Float32BufferAttribute(normals, 3);
|
1468
|
+
normalAttribute = new THREE.Float32BufferAttribute(normals, 3);
|
1467
1469
|
} else {
|
1468
|
-
normalAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(normals, 3));
|
1470
|
+
normalAttribute = toNonIndexedAttribute(indices, new THREE.Float32BufferAttribute(normals, 3));
|
1469
1471
|
}
|
1470
1472
|
} else {
|
1471
1473
|
normalAttribute = computeNormalAttribute(indices, vertices, creaseAngle);
|
1472
1474
|
}
|
1473
|
-
const geometry = new BufferGeometry();
|
1475
|
+
const geometry = new THREE.BufferGeometry();
|
1474
1476
|
geometry.setAttribute("position", positionAttribute);
|
1475
1477
|
geometry.setAttribute("normal", normalAttribute);
|
1476
1478
|
geometry.setAttribute("uv", uvAttribute);
|
@@ -1532,11 +1534,11 @@ class VRMLLoader extends Loader {
|
|
1532
1534
|
}
|
1533
1535
|
const crossSectionClosed = crossSection[0] === crossSection[crossSection.length - 2] && crossSection[1] === crossSection[crossSection.length - 1];
|
1534
1536
|
const vertices = [];
|
1535
|
-
const spineVector = new Vector3();
|
1536
|
-
const scaling = new Vector3();
|
1537
|
-
const axis = new Vector3();
|
1538
|
-
const vertex = new Vector3();
|
1539
|
-
const quaternion = new Quaternion();
|
1537
|
+
const spineVector = new THREE.Vector3();
|
1538
|
+
const scaling = new THREE.Vector3();
|
1539
|
+
const axis = new THREE.Vector3();
|
1540
|
+
const vertex = new THREE.Vector3();
|
1541
|
+
const quaternion = new THREE.Quaternion();
|
1540
1542
|
for (let i = 0, j = 0, o = 0, il = spine.length; i < il; i += 3, j += 2, o += 4) {
|
1541
1543
|
spineVector.fromArray(spine, i);
|
1542
1544
|
scaling.x = scale ? scale[j + 0] : 1;
|
@@ -1582,9 +1584,9 @@ class VRMLLoader extends Loader {
|
|
1582
1584
|
if (beginCap === true || endCap === true) {
|
1583
1585
|
const contour = [];
|
1584
1586
|
for (let i = 0, l = crossSection.length; i < l; i += 2) {
|
1585
|
-
contour.push(new Vector2(crossSection[i], crossSection[i + 1]));
|
1587
|
+
contour.push(new THREE.Vector2(crossSection[i], crossSection[i + 1]));
|
1586
1588
|
}
|
1587
|
-
const faces = ShapeUtils.triangulateShape(contour, []);
|
1589
|
+
const faces = THREE.ShapeUtils.triangulateShape(contour, []);
|
1588
1590
|
const capIndices = [];
|
1589
1591
|
for (let i = 0, l = faces.length; i < l; i++) {
|
1590
1592
|
const face = faces[i];
|
@@ -1618,9 +1620,9 @@ class VRMLLoader extends Loader {
|
|
1618
1620
|
}
|
1619
1621
|
}
|
1620
1622
|
}
|
1621
|
-
const positionAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(vertices, 3));
|
1623
|
+
const positionAttribute = toNonIndexedAttribute(indices, new THREE.Float32BufferAttribute(vertices, 3));
|
1622
1624
|
const normalAttribute = computeNormalAttribute(indices, vertices, creaseAngle);
|
1623
|
-
const geometry = new BufferGeometry();
|
1625
|
+
const geometry = new THREE.BufferGeometry();
|
1624
1626
|
geometry.setAttribute("position", positionAttribute);
|
1625
1627
|
geometry.setAttribute("normal", normalAttribute);
|
1626
1628
|
geometry._solid = solid;
|
@@ -1635,7 +1637,7 @@ class VRMLLoader extends Loader {
|
|
1635
1637
|
function parseFieldChildren(children, owner) {
|
1636
1638
|
for (let i = 0, l = children.length; i < l; i++) {
|
1637
1639
|
const object = getNode(children[i]);
|
1638
|
-
if (object instanceof Object3D)
|
1640
|
+
if (object instanceof THREE.Object3D)
|
1639
1641
|
owner.add(object);
|
1640
1642
|
}
|
1641
1643
|
}
|
@@ -1710,12 +1712,12 @@ class VRMLLoader extends Loader {
|
|
1710
1712
|
}
|
1711
1713
|
return triangulatedData;
|
1712
1714
|
}
|
1713
|
-
const vA = new Vector3();
|
1714
|
-
const vB = new Vector3();
|
1715
|
-
const vC = new Vector3();
|
1716
|
-
const uvA = new Vector2();
|
1717
|
-
const uvB = new Vector2();
|
1718
|
-
const uvC = new Vector2();
|
1715
|
+
const vA = new THREE.Vector3();
|
1716
|
+
const vB = new THREE.Vector3();
|
1717
|
+
const vC = new THREE.Vector3();
|
1718
|
+
const uvA = new THREE.Vector2();
|
1719
|
+
const uvB = new THREE.Vector2();
|
1720
|
+
const uvC = new THREE.Vector2();
|
1719
1721
|
function computeAttributeFromIndexedData(coordIndex, index, data2, itemSize) {
|
1720
1722
|
const array = [];
|
1721
1723
|
for (let i = 0, l = coordIndex.length; i < l; i += 3) {
|
@@ -1738,7 +1740,7 @@ class VRMLLoader extends Loader {
|
|
1738
1740
|
array.push(vC.x, vC.y, vC.z);
|
1739
1741
|
}
|
1740
1742
|
}
|
1741
|
-
return new Float32BufferAttribute(array, itemSize);
|
1743
|
+
return new THREE.Float32BufferAttribute(array, itemSize);
|
1742
1744
|
}
|
1743
1745
|
function computeAttributeFromFaceData(index, faceData) {
|
1744
1746
|
const array = [];
|
@@ -1748,7 +1750,7 @@ class VRMLLoader extends Loader {
|
|
1748
1750
|
array.push(vA.x, vA.y, vA.z);
|
1749
1751
|
array.push(vA.x, vA.y, vA.z);
|
1750
1752
|
}
|
1751
|
-
return new Float32BufferAttribute(array, 3);
|
1753
|
+
return new THREE.Float32BufferAttribute(array, 3);
|
1752
1754
|
}
|
1753
1755
|
function computeAttributeFromLineData(index, lineData) {
|
1754
1756
|
const array = [];
|
@@ -1757,7 +1759,7 @@ class VRMLLoader extends Loader {
|
|
1757
1759
|
array.push(vA.x, vA.y, vA.z);
|
1758
1760
|
array.push(vA.x, vA.y, vA.z);
|
1759
1761
|
}
|
1760
|
-
return new Float32BufferAttribute(array, 3);
|
1762
|
+
return new THREE.Float32BufferAttribute(array, 3);
|
1761
1763
|
}
|
1762
1764
|
function toNonIndexedAttribute(indices, attribute) {
|
1763
1765
|
const array = attribute.array;
|
@@ -1770,10 +1772,10 @@ class VRMLLoader extends Loader {
|
|
1770
1772
|
array2[index2++] = array[index++];
|
1771
1773
|
}
|
1772
1774
|
}
|
1773
|
-
return new Float32BufferAttribute(array2, itemSize);
|
1775
|
+
return new THREE.Float32BufferAttribute(array2, itemSize);
|
1774
1776
|
}
|
1775
|
-
const ab = new Vector3();
|
1776
|
-
const cb = new Vector3();
|
1777
|
+
const ab = new THREE.Vector3();
|
1778
|
+
const cb = new THREE.Vector3();
|
1777
1779
|
function computeNormalAttribute(index, coord, creaseAngle) {
|
1778
1780
|
const faces = [];
|
1779
1781
|
const vertexNormals = {};
|
@@ -1814,10 +1816,10 @@ class VRMLLoader extends Loader {
|
|
1814
1816
|
normals.push(nB.x, nB.y, nB.z);
|
1815
1817
|
normals.push(nC.x, nC.y, nC.z);
|
1816
1818
|
}
|
1817
|
-
return new Float32BufferAttribute(normals, 3);
|
1819
|
+
return new THREE.Float32BufferAttribute(normals, 3);
|
1818
1820
|
}
|
1819
1821
|
function weightedNormal(normals, vector, creaseAngle) {
|
1820
|
-
const normal = new Vector3();
|
1822
|
+
const normal = new THREE.Vector3();
|
1821
1823
|
if (creaseAngle === 0) {
|
1822
1824
|
normal.copy(vector);
|
1823
1825
|
} else {
|
@@ -1832,7 +1834,7 @@ class VRMLLoader extends Loader {
|
|
1832
1834
|
function toColorArray(colors) {
|
1833
1835
|
const array = [];
|
1834
1836
|
for (let i = 0, l = colors.length; i < l; i += 3) {
|
1835
|
-
array.push(new Color(colors[i], colors[i + 1], colors[i + 2]));
|
1837
|
+
array.push(new THREE.Color(colors[i], colors[i + 1], colors[i + 2]));
|
1836
1838
|
}
|
1837
1839
|
return array;
|
1838
1840
|
}
|
@@ -1842,15 +1844,15 @@ class VRMLLoader extends Loader {
|
|
1842
1844
|
for (let i = 0, l = colors.length; i < l; i++) {
|
1843
1845
|
let angle = i === 0 ? 0 : angles[i - 1];
|
1844
1846
|
angle = topDown === true ? angle : startAngle - angle;
|
1845
|
-
const point = new Vector3();
|
1847
|
+
const point = new THREE.Vector3();
|
1846
1848
|
point.setFromSphericalCoords(radius, angle, 0);
|
1847
1849
|
thresholds.push(point);
|
1848
1850
|
}
|
1849
1851
|
const indices = geometry.index;
|
1850
1852
|
const positionAttribute = geometry.attributes.position;
|
1851
|
-
const colorAttribute = new BufferAttribute(new Float32Array(geometry.attributes.position.count * 3), 3);
|
1852
|
-
const position = new Vector3();
|
1853
|
-
const color = new Color();
|
1853
|
+
const colorAttribute = new THREE.BufferAttribute(new Float32Array(geometry.attributes.position.count * 3), 3);
|
1854
|
+
const position = new THREE.Vector3();
|
1855
|
+
const color = new THREE.Color();
|
1854
1856
|
for (let i = 0; i < indices.count; i++) {
|
1855
1857
|
const index = indices.getX(i);
|
1856
1858
|
position.fromBufferAttribute(positionAttribute, index);
|
@@ -1880,7 +1882,7 @@ class VRMLLoader extends Loader {
|
|
1880
1882
|
}
|
1881
1883
|
geometry.setAttribute("color", colorAttribute);
|
1882
1884
|
}
|
1883
|
-
const textureLoader = new TextureLoader(this.manager);
|
1885
|
+
const textureLoader = new THREE.TextureLoader(this.manager);
|
1884
1886
|
textureLoader.setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
|
1885
1887
|
if (data.indexOf("#VRML V2.0") === -1) {
|
1886
1888
|
throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");
|
@@ -1892,7 +1894,7 @@ class VRMLLoader extends Loader {
|
|
1892
1894
|
}
|
1893
1895
|
class VRMLLexer {
|
1894
1896
|
constructor(tokens) {
|
1895
|
-
this.lexer = new Lexer(tokens);
|
1897
|
+
this.lexer = new chevrotain.Lexer(tokens);
|
1896
1898
|
}
|
1897
1899
|
lex(inputText) {
|
1898
1900
|
const lexingResult = this.lexer.tokenize(inputText);
|
@@ -1903,7 +1905,7 @@ class VRMLLexer {
|
|
1903
1905
|
return lexingResult;
|
1904
1906
|
}
|
1905
1907
|
}
|
1906
|
-
class VRMLParser extends CstParser {
|
1908
|
+
class VRMLParser extends chevrotain.CstParser {
|
1907
1909
|
constructor(tokenVocabulary) {
|
1908
1910
|
super(tokenVocabulary);
|
1909
1911
|
const $ = this;
|
@@ -2091,7 +2093,7 @@ class Face {
|
|
2091
2093
|
this.a = a;
|
2092
2094
|
this.b = b;
|
2093
2095
|
this.c = c;
|
2094
|
-
this.normal = new Vector3();
|
2096
|
+
this.normal = new THREE.Vector3();
|
2095
2097
|
}
|
2096
2098
|
}
|
2097
2099
|
const TEXTURE_TYPE = {
|
@@ -2100,6 +2102,4 @@ const TEXTURE_TYPE = {
|
|
2100
2102
|
RGB: 3,
|
2101
2103
|
RGBA: 4
|
2102
2104
|
};
|
2103
|
-
|
2104
|
-
VRMLLoader
|
2105
|
-
};
|
2105
|
+
exports.VRMLLoader = VRMLLoader;
|