@plastic-software/three 0.183.4 → 0.184.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +773 -286
- package/build/three.core.js +372 -110
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +426 -180
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +7 -1
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +2979 -1281
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +2942 -1281
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +11 -0
- package/examples/jsm/animation/CCDIKSolver.js +5 -1
- package/examples/jsm/controls/ArcballControls.js +4 -1
- package/examples/jsm/controls/DragControls.js +2 -2
- package/examples/jsm/controls/FirstPersonControls.js +58 -54
- package/examples/jsm/controls/FlyControls.js +4 -0
- package/examples/jsm/controls/OrbitControls.js +2 -2
- package/examples/jsm/controls/TrackballControls.js +2 -2
- package/examples/jsm/controls/TransformControls.js +34 -2
- package/examples/jsm/csm/CSMShadowNode.js +6 -2
- package/examples/jsm/exporters/GLTFExporter.js +21 -5
- package/examples/jsm/geometries/TextGeometry.js +18 -0
- package/examples/jsm/helpers/LightProbeGridHelper.js +221 -0
- package/examples/jsm/inspector/Extension.js +13 -0
- package/examples/jsm/inspector/Inspector.js +169 -114
- package/examples/jsm/inspector/RendererInspector.js +2 -2
- package/examples/jsm/inspector/extensions/extensions.json +6 -0
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +916 -0
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +281 -0
- package/examples/jsm/inspector/tabs/Memory.js +128 -0
- package/examples/jsm/inspector/tabs/Parameters.js +34 -2
- package/examples/jsm/inspector/tabs/Performance.js +2 -2
- package/examples/jsm/inspector/tabs/Settings.js +264 -0
- package/examples/jsm/inspector/tabs/Timeline.js +1611 -0
- package/examples/jsm/inspector/tabs/Viewer.js +105 -3
- package/examples/jsm/inspector/ui/Graph.js +2 -2
- package/examples/jsm/inspector/ui/List.js +1 -1
- package/examples/jsm/inspector/ui/Profiler.js +273 -176
- package/examples/jsm/inspector/ui/Style.js +64 -10
- package/examples/jsm/inspector/ui/Tab.js +39 -7
- package/examples/jsm/inspector/ui/Values.js +39 -2
- package/examples/jsm/inspector/ui/utils.js +13 -0
- package/examples/jsm/interaction/InteractionManager.js +226 -0
- package/examples/jsm/libs/meshopt_decoder.module.js +8 -8
- package/examples/jsm/lighting/DynamicLighting.js +82 -0
- package/examples/jsm/lighting/LightProbeGrid.js +651 -0
- package/examples/jsm/lines/LineMaterial.js +1 -1
- package/examples/jsm/loaders/EXRLoader.js +682 -43
- package/examples/jsm/loaders/FBXLoader.js +233 -33
- package/examples/jsm/loaders/GLTFLoader.js +24 -7
- package/examples/jsm/loaders/HDRLoader.js +1 -1
- package/examples/jsm/loaders/KTX2Loader.js +8 -2
- package/examples/jsm/loaders/LDrawLoader.js +39 -47
- package/examples/jsm/loaders/SVGLoader.js +1 -1
- package/examples/jsm/loaders/VTKLoader.js +5 -1
- package/examples/jsm/loaders/collada/ColladaComposer.js +101 -7
- package/examples/jsm/loaders/collada/ColladaParser.js +19 -4
- package/examples/jsm/loaders/usd/USDAParser.js +6 -0
- package/examples/jsm/loaders/usd/USDCParser.js +26 -0
- package/examples/jsm/loaders/usd/USDComposer.js +656 -103
- package/examples/jsm/misc/GPUComputationRenderer.js +2 -0
- package/examples/jsm/misc/RollerCoaster.js +42 -4
- package/examples/jsm/modifiers/TessellateModifier.js +1 -1
- package/examples/jsm/objects/Reflector.js +73 -25
- package/examples/jsm/objects/Sky.js +14 -2
- package/examples/jsm/objects/SkyMesh.js +23 -6
- package/examples/jsm/renderers/Projector.js +18 -38
- package/examples/jsm/renderers/SVGRenderer.js +6 -25
- package/examples/jsm/transpiler/GLSLDecoder.js +2 -2
- package/examples/jsm/tsl/WebGLNodesHandler.js +605 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +10 -0
- package/examples/jsm/tsl/display/AnamorphicNode.js +11 -0
- package/examples/jsm/tsl/display/BilateralBlurNode.js +10 -0
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +3 -36
- package/examples/jsm/tsl/display/FSR1Node.js +477 -0
- package/examples/jsm/tsl/display/GTAONode.js +2 -1
- package/examples/jsm/tsl/display/GaussianBlurNode.js +10 -0
- package/examples/jsm/tsl/display/GodraysNode.js +2 -11
- package/examples/jsm/tsl/display/OutlineNode.js +66 -16
- package/examples/jsm/tsl/display/SSGINode.js +0 -4
- package/examples/jsm/tsl/display/SharpenNode.js +283 -0
- package/examples/jsm/tsl/display/TAAUNode.js +835 -0
- package/examples/jsm/tsl/display/TRAANode.js +48 -7
- package/examples/jsm/tsl/lighting/DynamicLightsNode.js +300 -0
- package/examples/jsm/tsl/lighting/data/AmbientLightDataNode.js +61 -0
- package/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.js +111 -0
- package/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.js +99 -0
- package/examples/jsm/tsl/lighting/data/PointLightDataNode.js +134 -0
- package/examples/jsm/tsl/lighting/data/SpotLightDataNode.js +161 -0
- package/examples/jsm/tsl/math/Bayer.js +13 -2
- package/examples/jsm/utils/BufferGeometryUtils.js +2 -3
- package/examples/jsm/utils/ColorUtils.js +76 -0
- package/examples/jsm/utils/SkeletonUtils.js +14 -8
- package/examples/jsm/webxr/XRHandMeshModel.js +36 -10
- package/examples/jsm/webxr/XRHandModelFactory.js +2 -1
- package/package.json +4 -4
- package/src/Three.Core.js +1 -0
- package/src/Three.TSL.js +6 -0
- package/src/Three.WebGPU.Nodes.js +3 -0
- package/src/Three.WebGPU.js +6 -0
- package/src/animation/AnimationAction.js +11 -1
- package/src/audio/AudioContext.js +2 -2
- package/src/constants.js +1 -1
- package/src/core/BufferAttribute.js +13 -1
- package/src/core/Clock.js +1 -1
- package/src/core/Object3D.js +1 -5
- package/src/core/RenderTarget.js +1 -0
- package/src/extras/curves/CatmullRomCurve3.js +3 -2
- package/src/loaders/AudioLoader.js +11 -1
- package/src/loaders/DataTextureLoader.js +6 -4
- package/src/loaders/FileLoader.js +1 -2
- package/src/loaders/ImageBitmapLoader.js +4 -6
- package/src/loaders/MaterialLoader.js +1 -1
- package/src/loaders/ObjectLoader.js +25 -4
- package/src/loaders/nodes/NodeObjectLoader.js +18 -0
- package/src/materials/MeshToonMaterial.js +1 -1
- package/src/materials/nodes/Line2NodeMaterial.js +27 -0
- package/src/materials/nodes/NodeMaterial.js +0 -27
- package/src/materials/nodes/manager/NodeMaterialObserver.js +188 -89
- package/src/math/Line3.js +3 -0
- package/src/math/Matrix2.js +13 -9
- package/src/math/Matrix3.js +13 -9
- package/src/math/Matrix4.js +13 -9
- package/src/math/Plane.js +4 -3
- package/src/math/Triangle.js +1 -1
- package/src/math/Vector2.js +11 -7
- package/src/math/Vector3.js +12 -8
- package/src/math/Vector4.js +13 -9
- package/src/nodes/Nodes.js +0 -1
- package/src/nodes/TSL.js +1 -1
- package/src/nodes/accessors/BufferAttributeNode.js +9 -3
- package/src/nodes/accessors/CubeTextureNode.js +7 -1
- package/src/nodes/accessors/MaterialProperties.js +2 -5
- package/src/nodes/accessors/Object3DNode.js +1 -1
- package/src/nodes/accessors/ReferenceBaseNode.js +2 -2
- package/src/nodes/accessors/ReferenceNode.js +4 -4
- package/src/nodes/accessors/SceneProperties.js +2 -8
- package/src/nodes/accessors/StorageBufferNode.js +10 -4
- package/src/nodes/accessors/StorageTextureNode.js +4 -9
- package/src/nodes/accessors/TextureNode.js +10 -2
- package/src/nodes/accessors/UniformArrayNode.js +2 -2
- package/src/nodes/code/FunctionCallNode.js +1 -1
- package/src/nodes/code/FunctionNode.js +1 -1
- package/src/nodes/core/ArrayNode.js +1 -1
- package/src/nodes/core/AssignNode.js +1 -1
- package/src/nodes/core/AttributeNode.js +1 -1
- package/src/nodes/core/BypassNode.js +1 -1
- package/src/nodes/core/ContextNode.js +1 -1
- package/src/nodes/core/IndexNode.js +2 -1
- package/src/nodes/core/InputNode.js +1 -1
- package/src/nodes/core/InspectorNode.js +1 -1
- package/src/nodes/core/IsolateNode.js +1 -1
- package/src/nodes/core/Node.js +83 -12
- package/src/nodes/core/NodeBuilder.js +117 -16
- package/src/nodes/core/NodeUtils.js +1 -1
- package/src/nodes/core/OutputStructNode.js +1 -1
- package/src/nodes/core/ParameterNode.js +1 -1
- package/src/nodes/core/StackNode.js +1 -1
- package/src/nodes/core/StructNode.js +1 -1
- package/src/nodes/core/StructTypeNode.js +1 -1
- package/src/nodes/core/SubBuildNode.js +1 -1
- package/src/nodes/core/UniformGroupNode.js +36 -6
- package/src/nodes/core/VarNode.js +1 -1
- package/src/nodes/core/VaryingNode.js +1 -1
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +27 -7
- package/src/nodes/display/RenderOutputNode.js +4 -4
- package/src/nodes/display/ScreenNode.js +1 -1
- package/src/nodes/display/ViewportDepthTextureNode.js +11 -15
- package/src/nodes/display/ViewportTextureNode.js +18 -7
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/geometry/RangeNode.js +1 -1
- package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
- package/src/nodes/gpgpu/BarrierNode.js +9 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +69 -44
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +1 -1
- package/src/nodes/lighting/LightsNode.js +6 -27
- package/src/nodes/lighting/ShadowNode.js +24 -2
- package/src/nodes/math/BitcastNode.js +1 -1
- package/src/nodes/math/ConditionalNode.js +1 -1
- package/src/nodes/math/MathNode.js +73 -1
- package/src/nodes/math/OperatorNode.js +1 -1
- package/src/nodes/math/PackFloatNode.js +1 -1
- package/src/nodes/math/UnpackFloatNode.js +1 -1
- package/src/nodes/tsl/TSLBase.js +1 -1
- package/src/nodes/tsl/TSLCore.js +21 -3
- package/src/nodes/utils/ArrayElementNode.js +1 -1
- package/src/nodes/utils/ConvertNode.js +1 -1
- package/src/nodes/utils/DebugNode.js +1 -1
- package/src/nodes/utils/EventNode.js +30 -0
- package/src/nodes/utils/FlipNode.js +1 -1
- package/src/nodes/utils/FunctionOverloadingNode.js +1 -1
- package/src/nodes/utils/JoinNode.js +1 -1
- package/src/nodes/utils/MemberNode.js +1 -1
- package/src/nodes/utils/Remap.js +48 -0
- package/src/nodes/utils/RotateNode.js +1 -1
- package/src/nodes/utils/SetNode.js +1 -1
- package/src/nodes/utils/SplitNode.js +1 -1
- package/src/objects/BatchedMesh.js +17 -2
- package/src/objects/InstancedMesh.js +19 -3
- package/src/objects/SkinnedMesh.js +26 -9
- package/src/renderers/WebGLRenderer.js +147 -48
- package/src/renderers/common/Animation.js +3 -3
- package/src/renderers/common/Attributes.js +15 -1
- package/src/renderers/common/Backend.js +0 -8
- package/src/renderers/common/Background.js +2 -2
- package/src/renderers/common/BindGroup.js +1 -8
- package/src/renderers/common/Bindings.js +2 -2
- package/src/renderers/common/ComputePipeline.js +1 -1
- package/src/renderers/common/CubeRenderTarget.js +1 -1
- package/src/renderers/common/Info.js +333 -4
- package/src/renderers/common/InspectorBase.js +6 -1
- package/src/renderers/common/Pipelines.js +36 -3
- package/src/renderers/common/ReadbackBuffer.js +78 -0
- package/src/renderers/common/RenderBundle.js +3 -1
- package/src/renderers/common/RenderBundles.js +5 -2
- package/src/renderers/common/RenderObject.js +2 -2
- package/src/renderers/common/RenderObjects.js +3 -3
- package/src/renderers/common/RenderPipeline.js +35 -6
- package/src/renderers/common/Renderer.js +232 -53
- package/src/renderers/common/Textures.js +72 -3
- package/src/renderers/common/UniformsGroup.js +1 -1
- package/src/renderers/common/XRManager.js +34 -27
- package/src/renderers/common/extras/PMREMGenerator.js +23 -15
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/NodeManager.js +230 -99
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +0 -1
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lightprobes_pars_fragment.glsl.js +80 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +2 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +1 -3
- package/src/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +0 -1
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +12 -2
- package/src/renderers/shaders/ShaderChunk.js +2 -0
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +1 -2
- package/src/renderers/shaders/ShaderLib.js +0 -1
- package/src/renderers/shaders/UniformsLib.js +7 -2
- package/src/renderers/shaders/UniformsUtils.js +27 -5
- package/src/renderers/webgl/WebGLAnimation.js +2 -1
- package/src/renderers/webgl/WebGLBackground.js +13 -13
- package/src/renderers/webgl/WebGLBufferRenderer.js +0 -32
- package/src/renderers/webgl/WebGLCapabilities.js +6 -0
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +0 -32
- package/src/renderers/webgl/WebGLMaterials.js +12 -13
- package/src/renderers/webgl/WebGLOutput.js +4 -1
- package/src/renderers/webgl/WebGLProgram.js +4 -0
- package/src/renderers/webgl/WebGLPrograms.js +19 -3
- package/src/renderers/webgl/WebGLRenderStates.js +13 -2
- package/src/renderers/webgl/WebGLState.js +43 -0
- package/src/renderers/webgl/WebGLTextures.js +129 -26
- package/src/renderers/webgl/WebGLUniformsGroups.js +19 -0
- package/src/renderers/webgl-fallback/WebGLBackend.js +106 -65
- package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +0 -41
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +29 -51
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +53 -19
- package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +25 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +42 -1
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +63 -50
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +1 -1
- package/src/renderers/webgpu/WebGPUBackend.js +160 -146
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +55 -33
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +103 -17
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUCapabilities.js +48 -0
- package/src/renderers/webgpu/utils/WebGPUConstants.js +8 -0
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +91 -17
- package/src/renderers/webgpu/utils/WebGPUUtils.js +18 -2
- package/src/renderers/webxr/WebXRController.js +12 -0
- package/src/textures/HTMLTexture.js +74 -0
- package/src/textures/Source.js +1 -1
- package/src/textures/Texture.js +13 -2
- package/src/utils.js +23 -1
- package/src/nodes/utils/RemapNode.js +0 -125
package/examples/jsm/Addons.js
CHANGED
|
@@ -30,6 +30,7 @@ export * from './effects/OutlineEffect.js';
|
|
|
30
30
|
export * from './effects/ParallaxBarrierEffect.js';
|
|
31
31
|
export * from './effects/StereoEffect.js';
|
|
32
32
|
|
|
33
|
+
export * from './environments/ColorEnvironment.js';
|
|
33
34
|
export * from './environments/DebugEnvironment.js';
|
|
34
35
|
export * from './environments/RoomEnvironment.js';
|
|
35
36
|
|
|
@@ -51,9 +52,11 @@ export * from './geometries/RoundedBoxGeometry.js';
|
|
|
51
52
|
export * from './geometries/TeapotGeometry.js';
|
|
52
53
|
export * from './geometries/TextGeometry.js';
|
|
53
54
|
|
|
55
|
+
export * from './helpers/AnimationPathHelper.js';
|
|
54
56
|
export * from './helpers/LightProbeHelper.js';
|
|
55
57
|
export * from './helpers/OctreeHelper.js';
|
|
56
58
|
export * from './helpers/PositionalAudioHelper.js';
|
|
59
|
+
export * from './helpers/RapierHelper.js';
|
|
57
60
|
export * from './helpers/RectAreaLightHelper.js';
|
|
58
61
|
export * from './helpers/TextureHelper.js';
|
|
59
62
|
export * from './helpers/VertexNormalsHelper.js';
|
|
@@ -98,6 +101,7 @@ export * from './loaders/KTXLoader.js';
|
|
|
98
101
|
export * from './loaders/LDrawLoader.js';
|
|
99
102
|
export * from './loaders/LUT3dlLoader.js';
|
|
100
103
|
export * from './loaders/LUTCubeLoader.js';
|
|
104
|
+
export * from './loaders/LUTImageLoader.js';
|
|
101
105
|
export * from './loaders/LWOLoader.js';
|
|
102
106
|
export * from './loaders/LottieLoader.js';
|
|
103
107
|
export * from './loaders/MD2Loader.js';
|
|
@@ -127,6 +131,7 @@ export * from './materials/LDrawConditionalLineMaterial.js';
|
|
|
127
131
|
|
|
128
132
|
export * from './math/Capsule.js';
|
|
129
133
|
export * from './math/ColorConverter.js';
|
|
134
|
+
export * as ColorSpaces from './math/ColorSpaces.js';
|
|
130
135
|
export * from './math/ConvexHull.js';
|
|
131
136
|
export * from './math/ImprovedNoise.js';
|
|
132
137
|
export * from './math/Lut.js';
|
|
@@ -165,6 +170,7 @@ export * from './objects/Water.js';
|
|
|
165
170
|
export { Water as Water2 } from './objects/Water2.js';
|
|
166
171
|
|
|
167
172
|
export * from './physics/AmmoPhysics.js';
|
|
173
|
+
export * from './physics/JoltPhysics.js';
|
|
168
174
|
export * from './physics/RapierPhysics.js';
|
|
169
175
|
|
|
170
176
|
export * from './postprocessing/AfterimagePass.js';
|
|
@@ -174,6 +180,7 @@ export * from './postprocessing/ClearPass.js';
|
|
|
174
180
|
export * from './postprocessing/CubeTexturePass.js';
|
|
175
181
|
export * from './postprocessing/DotScreenPass.js';
|
|
176
182
|
export * from './postprocessing/EffectComposer.js';
|
|
183
|
+
export * from './postprocessing/FXAAPass.js';
|
|
177
184
|
export * from './postprocessing/FilmPass.js';
|
|
178
185
|
export * from './postprocessing/GlitchPass.js';
|
|
179
186
|
export * from './postprocessing/GTAOPass.js';
|
|
@@ -185,6 +192,7 @@ export * from './postprocessing/OutputPass.js';
|
|
|
185
192
|
export * from './postprocessing/Pass.js';
|
|
186
193
|
export * from './postprocessing/RenderPass.js';
|
|
187
194
|
export * from './postprocessing/RenderPixelatedPass.js';
|
|
195
|
+
export * from './postprocessing/RenderTransitionPass.js';
|
|
188
196
|
export * from './postprocessing/SAOPass.js';
|
|
189
197
|
export * from './postprocessing/SMAAPass.js';
|
|
190
198
|
export * from './postprocessing/SSAARenderPass.js';
|
|
@@ -234,6 +242,7 @@ export * from './shaders/LuminosityShader.js';
|
|
|
234
242
|
export * from './shaders/MirrorShader.js';
|
|
235
243
|
export * from './shaders/NormalMapShader.js';
|
|
236
244
|
export * from './shaders/OutputShader.js';
|
|
245
|
+
export * from './shaders/PoissonDenoiseShader.js';
|
|
237
246
|
export * from './shaders/RGBShiftShader.js';
|
|
238
247
|
export * from './shaders/SAOShader.js';
|
|
239
248
|
export * from './shaders/SMAAShader.js';
|
|
@@ -257,9 +266,11 @@ export * from './textures/FlakesTexture.js';
|
|
|
257
266
|
|
|
258
267
|
export * as BufferGeometryUtils from './utils/BufferGeometryUtils.js';
|
|
259
268
|
export * as CameraUtils from './utils/CameraUtils.js';
|
|
269
|
+
export * as ColorUtils from './utils/ColorUtils.js';
|
|
260
270
|
export * as GeometryCompressionUtils from './utils/GeometryCompressionUtils.js';
|
|
261
271
|
export * as GeometryUtils from './utils/GeometryUtils.js';
|
|
262
272
|
export * from './utils/LDrawUtils.js';
|
|
273
|
+
export * from './utils/SceneOptimizer.js';
|
|
263
274
|
export * as SceneUtils from './utils/SceneUtils.js';
|
|
264
275
|
export * from './utils/ShadowMapViewer.js';
|
|
265
276
|
export * as SkeletonUtils from './utils/SkeletonUtils.js';
|
|
@@ -204,7 +204,11 @@ class CCDIKSolver {
|
|
|
204
204
|
|
|
205
205
|
if ( c > 1.0 ) c = 1.0;
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
// preserve sign of the rotation along the limitation axis,
|
|
208
|
+
// otherwise negative rotations get mirrored to positive
|
|
209
|
+
const dot = link.quaternion.x * limitation.x + link.quaternion.y * limitation.y + link.quaternion.z * limitation.z;
|
|
210
|
+
const sign = dot < 0 ? - 1 : 1;
|
|
211
|
+
const c2 = sign * math.sqrt( 1 - c * c );
|
|
208
212
|
link.quaternion.set( limitation.x * c2,
|
|
209
213
|
limitation.y * c2,
|
|
210
214
|
limitation.z * c2,
|
|
@@ -453,7 +453,6 @@ class ArcballControls extends Controls {
|
|
|
453
453
|
|
|
454
454
|
super.connect( element );
|
|
455
455
|
|
|
456
|
-
this.domElement.style.touchAction = 'none';
|
|
457
456
|
this._devPxRatio = window.devicePixelRatio;
|
|
458
457
|
|
|
459
458
|
this.domElement.addEventListener( 'contextmenu', this._onContextMenu );
|
|
@@ -463,6 +462,8 @@ class ArcballControls extends Controls {
|
|
|
463
462
|
|
|
464
463
|
window.addEventListener( 'resize', this._onWindowResize );
|
|
465
464
|
|
|
465
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
466
|
+
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
disconnect() {
|
|
@@ -477,6 +478,8 @@ class ArcballControls extends Controls {
|
|
|
477
478
|
|
|
478
479
|
window.removeEventListener( 'resize', this._onWindowResize );
|
|
479
480
|
|
|
481
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
482
|
+
|
|
480
483
|
}
|
|
481
484
|
|
|
482
485
|
onSinglePanStart( event, operation ) {
|
|
@@ -139,7 +139,7 @@ class DragControls extends Controls {
|
|
|
139
139
|
this.domElement.addEventListener( 'pointerleave', this._onPointerCancel );
|
|
140
140
|
this.domElement.addEventListener( 'contextmenu', this._onContextMenu );
|
|
141
141
|
|
|
142
|
-
this.domElement.style.touchAction = 'none'; //
|
|
142
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
143
143
|
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -151,7 +151,7 @@ class DragControls extends Controls {
|
|
|
151
151
|
this.domElement.removeEventListener( 'pointerleave', this._onPointerCancel );
|
|
152
152
|
this.domElement.removeEventListener( 'contextmenu', this._onContextMenu );
|
|
153
153
|
|
|
154
|
-
this.domElement.style.touchAction = '
|
|
154
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
155
155
|
this.domElement.style.cursor = '';
|
|
156
156
|
|
|
157
157
|
}
|
|
@@ -60,14 +60,6 @@ class FirstPersonControls extends Controls {
|
|
|
60
60
|
*/
|
|
61
61
|
this.autoForward = false;
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Whether it's possible to look around or not.
|
|
65
|
-
*
|
|
66
|
-
* @type {boolean}
|
|
67
|
-
* @default true
|
|
68
|
-
*/
|
|
69
|
-
this.activeLook = true;
|
|
70
|
-
|
|
71
63
|
/**
|
|
72
64
|
* Whether or not the camera's height influences the forward movement speed.
|
|
73
65
|
* Use the properties `heightCoef`, `heightMin` and `heightMax` for configuration.
|
|
@@ -141,14 +133,16 @@ class FirstPersonControls extends Controls {
|
|
|
141
133
|
this._pointerX = 0;
|
|
142
134
|
this._pointerY = 0;
|
|
143
135
|
|
|
136
|
+
this._pointerDownX = 0;
|
|
137
|
+
this._pointerDownY = 0;
|
|
138
|
+
|
|
139
|
+
this._pointerCount = 0;
|
|
140
|
+
|
|
144
141
|
this._moveForward = false;
|
|
145
142
|
this._moveBackward = false;
|
|
146
143
|
this._moveLeft = false;
|
|
147
144
|
this._moveRight = false;
|
|
148
145
|
|
|
149
|
-
this._viewHalfX = 0;
|
|
150
|
-
this._viewHalfY = 0;
|
|
151
|
-
|
|
152
146
|
this._lat = 0;
|
|
153
147
|
this._lon = 0;
|
|
154
148
|
|
|
@@ -167,8 +161,6 @@ class FirstPersonControls extends Controls {
|
|
|
167
161
|
|
|
168
162
|
this.connect( domElement );
|
|
169
163
|
|
|
170
|
-
this.handleResize();
|
|
171
|
-
|
|
172
164
|
}
|
|
173
165
|
|
|
174
166
|
this._setOrientation();
|
|
@@ -187,6 +179,8 @@ class FirstPersonControls extends Controls {
|
|
|
187
179
|
this.domElement.addEventListener( 'pointerup', this._onPointerUp );
|
|
188
180
|
this.domElement.addEventListener( 'contextmenu', this._onContextMenu );
|
|
189
181
|
|
|
182
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
183
|
+
|
|
190
184
|
}
|
|
191
185
|
|
|
192
186
|
disconnect() {
|
|
@@ -199,6 +193,8 @@ class FirstPersonControls extends Controls {
|
|
|
199
193
|
this.domElement.removeEventListener( 'pointerup', this._onPointerUp );
|
|
200
194
|
this.domElement.removeEventListener( 'contextmenu', this._onContextMenu );
|
|
201
195
|
|
|
196
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
197
|
+
|
|
202
198
|
}
|
|
203
199
|
|
|
204
200
|
dispose() {
|
|
@@ -207,25 +203,6 @@ class FirstPersonControls extends Controls {
|
|
|
207
203
|
|
|
208
204
|
}
|
|
209
205
|
|
|
210
|
-
/**
|
|
211
|
-
* Must be called if the application window is resized.
|
|
212
|
-
*/
|
|
213
|
-
handleResize() {
|
|
214
|
-
|
|
215
|
-
if ( this.domElement === document ) {
|
|
216
|
-
|
|
217
|
-
this._viewHalfX = window.innerWidth / 2;
|
|
218
|
-
this._viewHalfY = window.innerHeight / 2;
|
|
219
|
-
|
|
220
|
-
} else {
|
|
221
|
-
|
|
222
|
-
this._viewHalfX = this.domElement.offsetWidth / 2;
|
|
223
|
-
this._viewHalfY = this.domElement.offsetHeight / 2;
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
206
|
/**
|
|
230
207
|
* Rotates the camera towards the defined target position.
|
|
231
208
|
*
|
|
@@ -282,13 +259,7 @@ class FirstPersonControls extends Controls {
|
|
|
282
259
|
if ( this._moveUp ) this.object.translateY( actualMoveSpeed );
|
|
283
260
|
if ( this._moveDown ) this.object.translateY( - actualMoveSpeed );
|
|
284
261
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if ( ! this.activeLook ) {
|
|
288
|
-
|
|
289
|
-
actualLookSpeed = 0;
|
|
290
|
-
|
|
291
|
-
}
|
|
262
|
+
const actualLookSpeed = delta * this.lookSpeed;
|
|
292
263
|
|
|
293
264
|
let verticalLookRatio = 1;
|
|
294
265
|
|
|
@@ -298,8 +269,12 @@ class FirstPersonControls extends Controls {
|
|
|
298
269
|
|
|
299
270
|
}
|
|
300
271
|
|
|
301
|
-
|
|
302
|
-
|
|
272
|
+
if ( this.mouseDragOn ) {
|
|
273
|
+
|
|
274
|
+
this._lon -= this._pointerX * actualLookSpeed;
|
|
275
|
+
if ( this.lookVertical ) this._lat -= this._pointerY * actualLookSpeed * verticalLookRatio;
|
|
276
|
+
|
|
277
|
+
}
|
|
303
278
|
|
|
304
279
|
this._lat = Math.max( - 85, Math.min( 85, this._lat ) );
|
|
305
280
|
|
|
@@ -332,6 +307,15 @@ class FirstPersonControls extends Controls {
|
|
|
332
307
|
|
|
333
308
|
}
|
|
334
309
|
|
|
310
|
+
/**
|
|
311
|
+
* @deprecated, r184. This method is no longer needed.
|
|
312
|
+
*/
|
|
313
|
+
handleResize() {
|
|
314
|
+
|
|
315
|
+
console.warn( 'THREE.FirstPersonControls: handleResize() has been removed.' );
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
|
|
335
319
|
}
|
|
336
320
|
|
|
337
321
|
function onPointerDown( event ) {
|
|
@@ -342,7 +326,16 @@ function onPointerDown( event ) {
|
|
|
342
326
|
|
|
343
327
|
}
|
|
344
328
|
|
|
345
|
-
|
|
329
|
+
this.domElement.setPointerCapture( event.pointerId );
|
|
330
|
+
|
|
331
|
+
this._pointerCount ++;
|
|
332
|
+
|
|
333
|
+
if ( event.pointerType === 'touch' ) {
|
|
334
|
+
|
|
335
|
+
this._moveForward = this._pointerCount === 1;
|
|
336
|
+
this._moveBackward = this._pointerCount >= 2;
|
|
337
|
+
|
|
338
|
+
} else {
|
|
346
339
|
|
|
347
340
|
switch ( event.button ) {
|
|
348
341
|
|
|
@@ -353,13 +346,28 @@ function onPointerDown( event ) {
|
|
|
353
346
|
|
|
354
347
|
}
|
|
355
348
|
|
|
349
|
+
this._pointerDownX = event.pageX;
|
|
350
|
+
this._pointerDownY = event.pageY;
|
|
351
|
+
|
|
352
|
+
this._pointerX = 0;
|
|
353
|
+
this._pointerY = 0;
|
|
354
|
+
|
|
356
355
|
this.mouseDragOn = true;
|
|
357
356
|
|
|
358
357
|
}
|
|
359
358
|
|
|
360
359
|
function onPointerUp( event ) {
|
|
361
360
|
|
|
362
|
-
|
|
361
|
+
this.domElement.releasePointerCapture( event.pointerId );
|
|
362
|
+
|
|
363
|
+
this._pointerCount --;
|
|
364
|
+
|
|
365
|
+
if ( event.pointerType === 'touch' ) {
|
|
366
|
+
|
|
367
|
+
this._moveForward = this._pointerCount === 1;
|
|
368
|
+
this._moveBackward = false;
|
|
369
|
+
|
|
370
|
+
} else {
|
|
363
371
|
|
|
364
372
|
switch ( event.button ) {
|
|
365
373
|
|
|
@@ -370,23 +378,19 @@ function onPointerUp( event ) {
|
|
|
370
378
|
|
|
371
379
|
}
|
|
372
380
|
|
|
373
|
-
this.
|
|
381
|
+
this._pointerX = 0;
|
|
382
|
+
this._pointerY = 0;
|
|
383
|
+
|
|
384
|
+
if ( this._pointerCount === 0 ) this.mouseDragOn = false;
|
|
374
385
|
|
|
375
386
|
}
|
|
376
387
|
|
|
377
388
|
function onPointerMove( event ) {
|
|
378
389
|
|
|
379
|
-
if ( this.
|
|
390
|
+
if ( this.mouseDragOn === false ) return;
|
|
380
391
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
} else {
|
|
385
|
-
|
|
386
|
-
this._pointerX = event.pageX - this.domElement.offsetLeft - this._viewHalfX;
|
|
387
|
-
this._pointerY = event.pageY - this.domElement.offsetTop - this._viewHalfY;
|
|
388
|
-
|
|
389
|
-
}
|
|
392
|
+
this._pointerX = event.pageX - this._pointerDownX;
|
|
393
|
+
this._pointerY = event.pageY - this._pointerDownY;
|
|
390
394
|
|
|
391
395
|
}
|
|
392
396
|
|
|
@@ -109,6 +109,8 @@ class FlyControls extends Controls {
|
|
|
109
109
|
this.domElement.addEventListener( 'pointercancel', this._onPointerCancel );
|
|
110
110
|
this.domElement.addEventListener( 'contextmenu', this._onContextMenu );
|
|
111
111
|
|
|
112
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
113
|
+
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
disconnect() {
|
|
@@ -122,6 +124,8 @@ class FlyControls extends Controls {
|
|
|
122
124
|
this.domElement.removeEventListener( 'pointercancel', this._onPointerCancel );
|
|
123
125
|
this.domElement.removeEventListener( 'contextmenu', this._onContextMenu );
|
|
124
126
|
|
|
127
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
128
|
+
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
dispose() {
|
|
@@ -505,7 +505,7 @@ class OrbitControls extends Controls {
|
|
|
505
505
|
const document = this.domElement.getRootNode(); // offscreen canvas compatibility
|
|
506
506
|
document.addEventListener( 'keydown', this._interceptControlDown, { passive: true, capture: true } );
|
|
507
507
|
|
|
508
|
-
this.domElement.style.touchAction = 'none'; //
|
|
508
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
509
509
|
|
|
510
510
|
}
|
|
511
511
|
|
|
@@ -524,7 +524,7 @@ class OrbitControls extends Controls {
|
|
|
524
524
|
const document = this.domElement.getRootNode(); // offscreen canvas compatibility
|
|
525
525
|
document.removeEventListener( 'keydown', this._interceptControlDown, { capture: true } );
|
|
526
526
|
|
|
527
|
-
this.domElement.style.touchAction = '
|
|
527
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
528
528
|
|
|
529
529
|
}
|
|
530
530
|
|
|
@@ -281,7 +281,7 @@ class TrackballControls extends Controls {
|
|
|
281
281
|
this.domElement.addEventListener( 'wheel', this._onMouseWheel, { passive: false } );
|
|
282
282
|
this.domElement.addEventListener( 'contextmenu', this._onContextMenu );
|
|
283
283
|
|
|
284
|
-
this.domElement.style.touchAction = 'none'; //
|
|
284
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
285
285
|
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -297,7 +297,7 @@ class TrackballControls extends Controls {
|
|
|
297
297
|
this.domElement.removeEventListener( 'wheel', this._onMouseWheel );
|
|
298
298
|
this.domElement.removeEventListener( 'contextmenu', this._onContextMenu );
|
|
299
299
|
|
|
300
|
-
this.domElement.style.touchAction = '
|
|
300
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
301
301
|
|
|
302
302
|
}
|
|
303
303
|
|
|
@@ -251,6 +251,33 @@ class TransformControls extends Controls {
|
|
|
251
251
|
*/
|
|
252
252
|
defineProperty( 'showZ', true );
|
|
253
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Whether the xy-plane helper should be visible or not.
|
|
256
|
+
*
|
|
257
|
+
* @name TransformControls#showXY
|
|
258
|
+
* @type {boolean}
|
|
259
|
+
* @default true
|
|
260
|
+
*/
|
|
261
|
+
defineProperty( 'showXY', true );
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Whether the yz-plane helper should be visible or not.
|
|
265
|
+
*
|
|
266
|
+
* @name TransformControls#showYZ
|
|
267
|
+
* @type {boolean}
|
|
268
|
+
* @default true
|
|
269
|
+
*/
|
|
270
|
+
defineProperty( 'showYZ', true );
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Whether the xz-axis helper should be visible or not.
|
|
274
|
+
*
|
|
275
|
+
* @name TransformControls#showXZ
|
|
276
|
+
* @type {boolean}
|
|
277
|
+
* @default true
|
|
278
|
+
*/
|
|
279
|
+
defineProperty( 'showXZ', true );
|
|
280
|
+
|
|
254
281
|
/**
|
|
255
282
|
* The minimum allowed X position during translation.
|
|
256
283
|
*
|
|
@@ -373,7 +400,7 @@ class TransformControls extends Controls {
|
|
|
373
400
|
this.domElement.addEventListener( 'pointermove', this._onPointerHover );
|
|
374
401
|
this.domElement.addEventListener( 'pointerup', this._onPointerUp );
|
|
375
402
|
|
|
376
|
-
this.domElement.style.touchAction = 'none'; //
|
|
403
|
+
this.domElement.style.touchAction = 'none'; // Disable touch scroll
|
|
377
404
|
|
|
378
405
|
}
|
|
379
406
|
|
|
@@ -384,7 +411,7 @@ class TransformControls extends Controls {
|
|
|
384
411
|
this.domElement.removeEventListener( 'pointermove', this._onPointerMove );
|
|
385
412
|
this.domElement.removeEventListener( 'pointerup', this._onPointerUp );
|
|
386
413
|
|
|
387
|
-
this.domElement.style.touchAction = '
|
|
414
|
+
this.domElement.style.touchAction = ''; // Restore touch scroll
|
|
388
415
|
|
|
389
416
|
}
|
|
390
417
|
|
|
@@ -1784,6 +1811,11 @@ class TransformControlsGizmo extends Object3D {
|
|
|
1784
1811
|
handle.visible = handle.visible && ( handle.name.indexOf( 'Z' ) === - 1 || this.showZ );
|
|
1785
1812
|
handle.visible = handle.visible && ( handle.name.indexOf( 'E' ) === - 1 || ( this.showX && this.showY && this.showZ ) );
|
|
1786
1813
|
|
|
1814
|
+
// Hide disabled plane helpers
|
|
1815
|
+
handle.visible = handle.visible && ( handle.name.indexOf( 'XY' ) === - 1 || this.showXY );
|
|
1816
|
+
handle.visible = handle.visible && ( handle.name.indexOf( 'YZ' ) === - 1 || this.showYZ );
|
|
1817
|
+
handle.visible = handle.visible && ( handle.name.indexOf( 'XZ' ) === - 1 || this.showXZ );
|
|
1818
|
+
|
|
1787
1819
|
// highlight selected axis
|
|
1788
1820
|
|
|
1789
1821
|
handle.material._color = handle.material._color || handle.material.color.clone();
|
|
@@ -574,8 +574,12 @@ class CSMShadowNode extends ShadowBaseNode {
|
|
|
574
574
|
const light = this.lights[ i ];
|
|
575
575
|
const parent = light.parent;
|
|
576
576
|
|
|
577
|
-
|
|
578
|
-
|
|
577
|
+
if ( parent !== null ) {
|
|
578
|
+
|
|
579
|
+
parent.remove( light.target );
|
|
580
|
+
parent.remove( light );
|
|
581
|
+
|
|
582
|
+
}
|
|
579
583
|
|
|
580
584
|
}
|
|
581
585
|
|
|
@@ -88,6 +88,7 @@ const KHR_mesh_quantization_ExtraAttrTypes = {
|
|
|
88
88
|
* - KHR_texture_transform
|
|
89
89
|
* - EXT_materials_bump
|
|
90
90
|
* - EXT_mesh_gpu_instancing
|
|
91
|
+
* - EXT_texture_webp
|
|
91
92
|
*
|
|
92
93
|
* The following glTF 2.0 extension is supported by an external user plugin:
|
|
93
94
|
*
|
|
@@ -1533,15 +1534,30 @@ class GLTFWriter {
|
|
|
1533
1534
|
|
|
1534
1535
|
}
|
|
1535
1536
|
|
|
1536
|
-
|
|
1537
|
+
const mimeType = map.userData.mimeType;
|
|
1537
1538
|
|
|
1538
|
-
|
|
1539
|
+
const imageIndex = this.processImage( map.image, map.format, map.flipY, mimeType );
|
|
1539
1540
|
|
|
1540
1541
|
const textureDef = {
|
|
1541
|
-
sampler: this.processSampler( map )
|
|
1542
|
-
source: this.processImage( map.image, map.format, map.flipY, mimeType )
|
|
1542
|
+
sampler: this.processSampler( map )
|
|
1543
1543
|
};
|
|
1544
1544
|
|
|
1545
|
+
if ( mimeType === 'image/webp' ) {
|
|
1546
|
+
|
|
1547
|
+
textureDef.extensions = textureDef.extensions || {};
|
|
1548
|
+
textureDef.extensions[ 'EXT_texture_webp' ] = {
|
|
1549
|
+
source: imageIndex
|
|
1550
|
+
};
|
|
1551
|
+
|
|
1552
|
+
this.extensionsUsed[ 'EXT_texture_webp' ] = true;
|
|
1553
|
+
this.extensionsRequired[ 'EXT_texture_webp' ] = true;
|
|
1554
|
+
|
|
1555
|
+
} else {
|
|
1556
|
+
|
|
1557
|
+
textureDef.source = imageIndex;
|
|
1558
|
+
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1545
1561
|
if ( map.name ) textureDef.name = map.name;
|
|
1546
1562
|
|
|
1547
1563
|
await this._invokeAllAsync( async function ( ext ) {
|
|
@@ -1832,7 +1848,7 @@ class GLTFWriter {
|
|
|
1832
1848
|
const validVertexAttributes =
|
|
1833
1849
|
/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;
|
|
1834
1850
|
|
|
1835
|
-
if ( ! validVertexAttributes.test( attributeName ) ) attributeName = '_' + attributeName;
|
|
1851
|
+
if ( ! validVertexAttributes.test( attributeName ) && ! attributeName.startsWith( '_' ) ) attributeName = '_' + attributeName;
|
|
1836
1852
|
|
|
1837
1853
|
if ( cache.attributes.has( this.getUID( attribute ) ) ) {
|
|
1838
1854
|
|
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
ExtrudeGeometry
|
|
3
3
|
} from 'three';
|
|
4
4
|
|
|
5
|
+
import { Font } from '../loaders/FontLoader.js';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* A class for generating text as a single geometry. It is constructed by providing a string of text, and a set of
|
|
7
9
|
* parameters consisting of a loaded font and extrude settings.
|
|
@@ -60,6 +62,22 @@ class TextGeometry extends ExtrudeGeometry {
|
|
|
60
62
|
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
toJSON() {
|
|
66
|
+
|
|
67
|
+
const data = super.toJSON();
|
|
68
|
+
return data;
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static fromJSON( data ) {
|
|
73
|
+
|
|
74
|
+
const options = data.options;
|
|
75
|
+
|
|
76
|
+
options.font = new Font( options.font.data );
|
|
77
|
+
return new TextGeometry( options.text, options );
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
/**
|