@nativescript/canvas-three 2.0.0-webgpu.3 → 2.0.0-webgpu.31
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/index.d.ts +2 -1
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/package.json +2 -3
- package/three/src/Three.Legacy.d.ts +20 -0
- package/three/src/Three.WebGPU.d.ts +180 -0
- package/three/src/Three.d.ts +189 -0
- package/three/src/animation/AnimationAction.d.ts +86 -0
- package/three/src/animation/AnimationClip.d.ts +50 -0
- package/three/src/animation/AnimationMixer.d.ts +35 -0
- package/three/src/animation/AnimationObjectGroup.d.ts +17 -0
- package/three/src/animation/AnimationUtils.d.ts +40 -0
- package/three/src/animation/KeyframeTrack.d.ts +55 -0
- package/three/src/animation/PropertyBinding.d.ts +43 -0
- package/three/src/animation/PropertyMixer.d.ts +17 -0
- package/three/src/animation/tracks/BooleanKeyframeTrack.d.ts +10 -0
- package/three/src/animation/tracks/ColorKeyframeTrack.d.ts +11 -0
- package/three/src/animation/tracks/NumberKeyframeTrack.d.ts +11 -0
- package/three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +11 -0
- package/three/src/animation/tracks/StringKeyframeTrack.d.ts +10 -0
- package/three/src/animation/tracks/VectorKeyframeTrack.d.ts +11 -0
- package/three/src/audio/Audio.d.ts +270 -0
- package/three/src/audio/AudioAnalyser.d.ts +58 -0
- package/three/src/audio/AudioContext.d.ts +19 -0
- package/three/src/audio/AudioListener.d.ts +96 -0
- package/three/src/audio/PositionalAudio.d.ts +101 -0
- package/three/src/cameras/ArrayCamera.d.ts +32 -0
- package/three/src/cameras/Camera.d.ts +74 -0
- package/three/src/cameras/CubeCamera.d.ts +68 -0
- package/three/src/cameras/OrthographicCamera.d.ts +167 -0
- package/three/src/cameras/PerspectiveCamera.d.ts +254 -0
- package/three/src/cameras/StereoCamera.d.ts +50 -0
- package/three/src/constants.d.ts +802 -0
- package/three/src/core/BufferAttribute.d.ts +592 -0
- package/three/src/core/BufferGeometry.d.ts +417 -0
- package/three/src/core/Clock.d.ts +72 -0
- package/three/src/core/EventDispatcher.d.ts +74 -0
- package/three/src/core/GLBufferAttribute.d.ts +121 -0
- package/three/src/core/InstancedBufferAttribute.d.ts +32 -0
- package/three/src/core/InstancedBufferGeometry.d.ts +37 -0
- package/three/src/core/InstancedInterleavedBuffer.d.ts +22 -0
- package/three/src/core/InterleavedBuffer.d.ts +162 -0
- package/three/src/core/InterleavedBufferAttribute.d.ts +201 -0
- package/three/src/core/Layers.d.ts +72 -0
- package/three/src/core/Object3D.d.ts +644 -0
- package/three/src/core/Raycaster.d.ts +199 -0
- package/three/src/core/RenderTarget.d.ts +89 -0
- package/three/src/core/Uniform.d.ts +38 -0
- package/three/src/core/UniformsGroup.d.ts +33 -0
- package/three/src/extras/DataUtils.d.ts +22 -0
- package/three/src/extras/Earcut.d.ts +15 -0
- package/three/src/extras/ImageUtils.d.ts +30 -0
- package/three/src/extras/PMREMGenerator.d.ts +82 -0
- package/three/src/extras/ShapeUtils.d.ts +25 -0
- package/three/src/extras/TextureUtils.d.ts +37 -0
- package/three/src/extras/core/Curve.d.ts +162 -0
- package/three/src/extras/core/CurvePath.d.ts +77 -0
- package/three/src/extras/core/Interpolations.d.ts +36 -0
- package/three/src/extras/core/Path.d.ts +148 -0
- package/three/src/extras/core/Shape.d.ts +86 -0
- package/three/src/extras/core/ShapePath.d.ts +98 -0
- package/three/src/extras/curves/ArcCurve.d.ts +34 -0
- package/three/src/extras/curves/CatmullRomCurve3.d.ts +77 -0
- package/three/src/extras/curves/CubicBezierCurve.d.ts +72 -0
- package/three/src/extras/curves/CubicBezierCurve3.d.ts +72 -0
- package/three/src/extras/curves/Curves.d.ts +10 -0
- package/three/src/extras/curves/EllipseCurve.d.ts +106 -0
- package/three/src/extras/curves/LineCurve.d.ts +42 -0
- package/three/src/extras/curves/LineCurve3.d.ts +42 -0
- package/three/src/extras/curves/QuadraticBezierCurve.d.ts +64 -0
- package/three/src/extras/curves/QuadraticBezierCurve3.d.ts +64 -0
- package/three/src/extras/curves/SplineCurve.d.ts +52 -0
- package/three/src/geometries/BoxGeometry.d.ts +52 -0
- package/three/src/geometries/CapsuleGeometry.d.ts +48 -0
- package/three/src/geometries/CircleGeometry.d.ts +51 -0
- package/three/src/geometries/ConeGeometry.d.ts +56 -0
- package/three/src/geometries/CylinderGeometry.d.ts +55 -0
- package/three/src/geometries/DodecahedronGeometry.d.ts +25 -0
- package/three/src/geometries/EdgesGeometry.d.ts +41 -0
- package/three/src/geometries/ExtrudeGeometry.d.ts +139 -0
- package/three/src/geometries/Geometries.d.ts +21 -0
- package/three/src/geometries/IcosahedronGeometry.d.ts +26 -0
- package/three/src/geometries/LatheGeometry.d.ts +55 -0
- package/three/src/geometries/OctahedronGeometry.d.ts +25 -0
- package/three/src/geometries/PlaneGeometry.d.ts +48 -0
- package/three/src/geometries/PolyhedronGeometry.d.ts +54 -0
- package/three/src/geometries/RingGeometry.d.ts +52 -0
- package/three/src/geometries/ShapeGeometry.d.ts +53 -0
- package/three/src/geometries/SphereGeometry.d.ts +59 -0
- package/three/src/geometries/TetrahedronGeometry.d.ts +25 -0
- package/three/src/geometries/TorusGeometry.d.ts +49 -0
- package/three/src/geometries/TorusKnotGeometry.d.ts +52 -0
- package/three/src/geometries/TubeGeometry.d.ts +80 -0
- package/three/src/geometries/WireframeGeometry.d.ts +40 -0
- package/three/src/helpers/ArrowHelper.d.ts +86 -0
- package/three/src/helpers/AxesHelper.d.ts +50 -0
- package/three/src/helpers/Box3Helper.d.ts +44 -0
- package/three/src/helpers/BoxHelper.d.ts +64 -0
- package/three/src/helpers/CameraHelper.d.ts +80 -0
- package/three/src/helpers/DirectionalLightHelper.d.ts +81 -0
- package/three/src/helpers/GridHelper.d.ts +47 -0
- package/three/src/helpers/HemisphereLightHelper.d.ts +72 -0
- package/three/src/helpers/PlaneHelper.d.ts +50 -0
- package/three/src/helpers/PointLightHelper.d.ts +73 -0
- package/three/src/helpers/PolarGridHelper.d.ts +48 -0
- package/three/src/helpers/SkeletonHelper.d.ts +78 -0
- package/three/src/helpers/SpotLightHelper.d.ts +77 -0
- package/three/src/lights/AmbientLight.d.ts +36 -0
- package/three/src/lights/DirectionalLight.d.ts +103 -0
- package/three/src/lights/DirectionalLightShadow.d.ts +73 -0
- package/three/src/lights/HemisphereLight.d.ts +61 -0
- package/three/src/lights/Light.d.ts +82 -0
- package/three/src/lights/LightProbe.d.ts +47 -0
- package/three/src/lights/LightShadow.d.ts +169 -0
- package/three/src/lights/PointLight.d.ts +102 -0
- package/three/src/lights/PointLightShadow.d.ts +22 -0
- package/three/src/lights/RectAreaLight.d.ts +82 -0
- package/three/src/lights/SpotLight.d.ts +157 -0
- package/three/src/lights/SpotLightShadow.d.ts +72 -0
- package/three/src/lights/webgpu/IESSpotLight.d.ts +6 -0
- package/three/src/loaders/AnimationLoader.d.ts +9 -0
- package/three/src/loaders/AudioLoader.d.ts +6 -0
- package/three/src/loaders/BufferGeometryLoader.d.ts +10 -0
- package/three/src/loaders/Cache.d.ts +21 -0
- package/three/src/loaders/CompressedTextureLoader.d.ts +9 -0
- package/three/src/loaders/CubeTextureLoader.d.ts +9 -0
- package/three/src/loaders/DataTextureLoader.d.ts +9 -0
- package/three/src/loaders/FileLoader.d.ts +14 -0
- package/three/src/loaders/ImageBitmapLoader.d.ts +17 -0
- package/three/src/loaders/ImageLoader.d.ts +12 -0
- package/three/src/loaders/Loader.d.ts +45 -0
- package/three/src/loaders/LoaderUtils.d.ts +10 -0
- package/three/src/loaders/LoadingManager.d.ts +65 -0
- package/three/src/loaders/MaterialLoader.d.ts +19 -0
- package/three/src/loaders/ObjectLoader.d.ts +25 -0
- package/three/src/loaders/TextureLoader.d.ts +13 -0
- package/three/src/materials/LineBasicMaterial.d.ts +60 -0
- package/three/src/materials/LineDashedMaterial.d.ts +40 -0
- package/three/src/materials/Material.d.ts +608 -0
- package/three/src/materials/Materials.d.ts +18 -0
- package/three/src/materials/MeshBasicMaterial.d.ts +139 -0
- package/three/src/materials/MeshDepthMaterial.d.ts +76 -0
- package/three/src/materials/MeshDistanceMaterial.d.ts +62 -0
- package/three/src/materials/MeshLambertMaterial.d.ts +204 -0
- package/three/src/materials/MeshMatcapMaterial.d.ts +117 -0
- package/three/src/materials/MeshNormalMaterial.d.ts +93 -0
- package/three/src/materials/MeshPhongMaterial.d.ts +228 -0
- package/three/src/materials/MeshPhysicalMaterial.d.ts +236 -0
- package/three/src/materials/MeshStandardMaterial.d.ts +218 -0
- package/three/src/materials/MeshToonMaterial.d.ts +178 -0
- package/three/src/materials/PointsMaterial.d.ts +61 -0
- package/three/src/materials/RawShaderMaterial.d.ts +14 -0
- package/three/src/materials/ShaderMaterial.d.ts +175 -0
- package/three/src/materials/ShadowMaterial.d.ts +39 -0
- package/three/src/materials/SpriteMaterial.d.ts +66 -0
- package/three/src/math/Box2.d.ts +48 -0
- package/three/src/math/Box3.d.ts +66 -0
- package/three/src/math/Color.d.ts +358 -0
- package/three/src/math/ColorManagement.d.ts +37 -0
- package/three/src/math/Cylindrical.d.ts +26 -0
- package/three/src/math/Euler.d.ts +50 -0
- package/three/src/math/Frustum.d.ts +30 -0
- package/three/src/math/Interpolant.d.ts +10 -0
- package/three/src/math/Line3.d.ts +29 -0
- package/three/src/math/MathUtils.d.ts +131 -0
- package/three/src/math/Matrix2.d.ts +48 -0
- package/three/src/math/Matrix3.d.ts +154 -0
- package/three/src/math/Matrix4.d.ts +217 -0
- package/three/src/math/Plane.d.ts +47 -0
- package/three/src/math/Quaternion.d.ts +173 -0
- package/three/src/math/Ray.d.ts +55 -0
- package/three/src/math/Sphere.d.ts +47 -0
- package/three/src/math/Spherical.d.ts +27 -0
- package/three/src/math/SphericalHarmonics3.d.ts +50 -0
- package/three/src/math/Triangle.d.ts +54 -0
- package/three/src/math/Vector2.d.ts +321 -0
- package/three/src/math/Vector3.d.ts +301 -0
- package/three/src/math/Vector4.d.ts +239 -0
- package/three/src/math/interpolants/CubicInterpolant.d.ts +7 -0
- package/three/src/math/interpolants/DiscreteInterpolant.d.ts +7 -0
- package/three/src/math/interpolants/LinearInterpolant.d.ts +7 -0
- package/three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -0
- package/three/src/nodes/Nodes.d.ts +231 -0
- package/three/src/nodes/accessors/AccessorsUtils.d.ts +9 -0
- package/three/src/nodes/accessors/BatchNode.d.ts +14 -0
- package/three/src/nodes/accessors/BitangentNode.d.ts +9 -0
- package/three/src/nodes/accessors/BufferAttributeNode.d.ts +28 -0
- package/three/src/nodes/accessors/BufferNode.d.ts +13 -0
- package/three/src/nodes/accessors/CameraNode.d.ts +15 -0
- package/three/src/nodes/accessors/ClippingNode.d.ts +16 -0
- package/three/src/nodes/accessors/CubeTextureNode.d.ts +24 -0
- package/three/src/nodes/accessors/InstanceNode.d.ts +13 -0
- package/three/src/nodes/accessors/MaterialNode.d.ts +130 -0
- package/three/src/nodes/accessors/MaterialReferenceNode.d.ts +9 -0
- package/three/src/nodes/accessors/ModelNode.d.ts +20 -0
- package/three/src/nodes/accessors/ModelViewProjectionNode.d.ts +8 -0
- package/three/src/nodes/accessors/NormalNode.d.ts +12 -0
- package/three/src/nodes/accessors/Object3DNode.d.ts +26 -0
- package/three/src/nodes/accessors/PointUVNode.d.ts +10 -0
- package/three/src/nodes/accessors/PositionNode.d.ts +9 -0
- package/three/src/nodes/accessors/ReferenceNode.d.ts +22 -0
- package/three/src/nodes/accessors/ReflectVectorNode.d.ts +9 -0
- package/three/src/nodes/accessors/RendererReferenceNode.d.ts +11 -0
- package/three/src/nodes/accessors/SkinningNode.d.ts +20 -0
- package/three/src/nodes/accessors/StorageBufferNode.d.ts +26 -0
- package/three/src/nodes/accessors/StorageTextureNode.d.ts +28 -0
- package/three/src/nodes/accessors/TangentNode.d.ts +12 -0
- package/three/src/nodes/accessors/Texture3DNode.d.ts +13 -0
- package/three/src/nodes/accessors/TextureBicubicNode.d.ts +18 -0
- package/three/src/nodes/accessors/TextureNode.d.ts +37 -0
- package/three/src/nodes/accessors/UVNode.d.ts +4 -0
- package/three/src/nodes/accessors/UniformsNode.d.ts +23 -0
- package/three/src/nodes/accessors/UserDataNode.d.ts +11 -0
- package/three/src/nodes/accessors/VertexColorNode.d.ts +12 -0
- package/three/src/nodes/code/CodeNode.d.ts +23 -0
- package/three/src/nodes/code/ExpressionNode.d.ts +9 -0
- package/three/src/nodes/code/FunctionCallNode.d.ts +22 -0
- package/three/src/nodes/code/FunctionNode.d.ts +38 -0
- package/three/src/nodes/core/AssignNode.d.ts +18 -0
- package/three/src/nodes/core/AttributeNode.d.ts +15 -0
- package/three/src/nodes/core/BypassNode.d.ts +18 -0
- package/three/src/nodes/core/CacheNode.d.ts +20 -0
- package/three/src/nodes/core/ConstNode.d.ts +9 -0
- package/three/src/nodes/core/ContextNode.d.ts +21 -0
- package/three/src/nodes/core/IndexNode.d.ts +20 -0
- package/three/src/nodes/core/InputNode.d.ts +15 -0
- package/three/src/nodes/core/LightingModel.d.ts +46 -0
- package/three/src/nodes/core/MRTNode.d.ts +19 -0
- package/three/src/nodes/core/Node.d.ts +117 -0
- package/three/src/nodes/core/NodeAttribute.d.ts +9 -0
- package/three/src/nodes/core/NodeBuilder.d.ts +133 -0
- package/three/src/nodes/core/NodeCache.d.ts +49 -0
- package/three/src/nodes/core/NodeCode.d.ts +4 -0
- package/three/src/nodes/core/NodeFrame.d.ts +34 -0
- package/three/src/nodes/core/NodeFunction.d.ts +13 -0
- package/three/src/nodes/core/NodeFunctionInput.d.ts +7 -0
- package/three/src/nodes/core/NodeKeywords.d.ts +17 -0
- package/three/src/nodes/core/NodeParser.d.ts +5 -0
- package/three/src/nodes/core/NodeUniform.d.ts +14 -0
- package/three/src/nodes/core/NodeUtils.d.ts +18 -0
- package/three/src/nodes/core/NodeVar.d.ts +7 -0
- package/three/src/nodes/core/NodeVarying.d.ts +7 -0
- package/three/src/nodes/core/OutputStructNode.d.ts +12 -0
- package/three/src/nodes/core/PropertyNode.d.ts +43 -0
- package/three/src/nodes/core/StackNode.d.ts +17 -0
- package/three/src/nodes/core/StructTypeNode.d.ts +8 -0
- package/three/src/nodes/core/TempNode.d.ts +10 -0
- package/three/src/nodes/core/UniformGroup.d.ts +7 -0
- package/three/src/nodes/core/UniformGroupNode.d.ts +21 -0
- package/three/src/nodes/core/UniformNode.d.ts +20 -0
- package/three/src/nodes/core/VarNode.d.ts +28 -0
- package/three/src/nodes/core/VaryingNode.d.ts +21 -0
- package/three/src/nodes/core/constants.d.ts +27 -0
- package/three/src/nodes/display/AfterImageNode.d.ts +25 -0
- package/three/src/nodes/display/AnamorphicNode.d.ts +26 -0
- package/three/src/nodes/display/BlendModeNode.d.ts +43 -0
- package/three/src/nodes/display/BloomNode.d.ts +30 -0
- package/three/src/nodes/display/ColorAdjustmentNode.d.ts +35 -0
- package/three/src/nodes/display/ColorSpaceNode.d.ts +32 -0
- package/three/src/nodes/display/DenoiseNode.d.ts +32 -0
- package/three/src/nodes/display/DepthOfFieldNode.d.ts +24 -0
- package/three/src/nodes/display/DotScreenNode.d.ts +22 -0
- package/three/src/nodes/display/FXAANode.d.ts +19 -0
- package/three/src/nodes/display/FilmNode.d.ts +21 -0
- package/three/src/nodes/display/FrontFacingNode.d.ts +10 -0
- package/three/src/nodes/display/GTAONode.d.ts +42 -0
- package/three/src/nodes/display/GaussianBlurNode.d.ts +27 -0
- package/three/src/nodes/display/Lut3DNode.d.ts +25 -0
- package/three/src/nodes/display/NormalMapNode.d.ts +21 -0
- package/three/src/nodes/display/PassNode.d.ts +62 -0
- package/three/src/nodes/display/PixelationPassNode.d.ts +41 -0
- package/three/src/nodes/display/PosterizeNode.d.ts +17 -0
- package/three/src/nodes/display/RGBShiftNode.d.ts +24 -0
- package/three/src/nodes/display/RenderOutputNode.d.ts +24 -0
- package/three/src/nodes/display/SobelOperatorNode.d.ts +17 -0
- package/three/src/nodes/display/ToneMappingNode.d.ts +25 -0
- package/three/src/nodes/display/TransitionNode.d.ts +27 -0
- package/three/src/nodes/display/ViewportDepthNode.d.ts +28 -0
- package/three/src/nodes/display/ViewportDepthTextureNode.d.ts +9 -0
- package/three/src/nodes/display/ViewportNode.d.ts +25 -0
- package/three/src/nodes/display/ViewportSharedTextureNode.d.ts +15 -0
- package/three/src/nodes/display/ViewportTextureNode.d.ts +25 -0
- package/three/src/nodes/fog/FogExp2Node.d.ts +18 -0
- package/three/src/nodes/fog/FogNode.d.ts +21 -0
- package/three/src/nodes/fog/FogRangeNode.d.ts +19 -0
- package/three/src/nodes/functions/BSDF/BRDF_GGX.d.ts +7 -0
- package/three/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +7 -0
- package/three/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
- package/three/src/nodes/functions/BSDF/DFGApprox.d.ts +11 -0
- package/three/src/nodes/functions/BSDF/D_GGX.d.ts +10 -0
- package/three/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +8 -0
- package/three/src/nodes/functions/BSDF/F_Schlick.d.ts +7 -0
- package/three/src/nodes/functions/BSDF/LTC.d.ts +7 -0
- package/three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +7 -0
- package/three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +7 -0
- package/three/src/nodes/functions/BasicLightingModel.d.ts +7 -0
- package/three/src/nodes/functions/PhongLightingModel.d.ts +7 -0
- package/three/src/nodes/functions/PhysicalLightingModel.d.ts +23 -0
- package/three/src/nodes/functions/ShadowMaskModel.d.ts +9 -0
- package/three/src/nodes/functions/ToonLightingModel.d.ts +3 -0
- package/three/src/nodes/functions/material/getGeometryRoughness.d.ts +6 -0
- package/three/src/nodes/functions/material/getRoughness.d.ts +7 -0
- package/three/src/nodes/geometry/RangeNode.d.ts +19 -0
- package/three/src/nodes/gpgpu/ComputeNode.d.ts +20 -0
- package/three/src/nodes/lighting/AONode.d.ts +8 -0
- package/three/src/nodes/lighting/AnalyticLightNode.d.ts +8 -0
- package/three/src/nodes/lighting/BasicEnvironmentNode.d.ts +10 -0
- package/three/src/nodes/lighting/BasicLightMapNode.d.ts +8 -0
- package/three/src/nodes/lighting/EnvironmentNode.d.ts +8 -0
- package/three/src/nodes/lighting/HemisphereLightNode.d.ts +13 -0
- package/three/src/nodes/lighting/IrradianceNode.d.ts +8 -0
- package/three/src/nodes/lighting/LightUtils.d.ts +5 -0
- package/three/src/nodes/lighting/LightingContextNode.d.ts +22 -0
- package/three/src/nodes/lighting/LightingNode.d.ts +7 -0
- package/three/src/nodes/lighting/LightsNode.d.ts +19 -0
- package/three/src/nodes/lighting/PointLightNode.d.ts +10 -0
- package/three/src/nodes/lighting/RectAreaLightNode.d.ts +21 -0
- package/three/src/nodes/lighting/SpotLightNode.d.ts +15 -0
- package/three/src/nodes/loaders/NodeLoader.d.ts +16 -0
- package/three/src/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
- package/three/src/nodes/loaders/NodeObjectLoader.d.ts +10 -0
- package/three/src/nodes/materials/Line2NodeMaterial.d.ts +53 -0
- package/three/src/nodes/materials/LineBasicNodeMaterial.d.ts +21 -0
- package/three/src/nodes/materials/Materials.d.ts +15 -0
- package/three/src/nodes/materials/MeshBasicNodeMaterial.d.ts +35 -0
- package/three/src/nodes/materials/MeshMatcapNodeMaterial.d.ts +31 -0
- package/three/src/nodes/materials/MeshNormalNodeMaterial.d.ts +27 -0
- package/three/src/nodes/materials/MeshPhongNodeMaterial.d.ts +55 -0
- package/three/src/nodes/materials/MeshPhysicalNodeMaterial.d.ts +87 -0
- package/three/src/nodes/materials/MeshSSSNodeMaterial.d.ts +16 -0
- package/three/src/nodes/materials/MeshStandardNodeMaterial.d.ts +55 -0
- package/three/src/nodes/materials/MeshToonNodeMaterial.d.ts +41 -0
- package/three/src/nodes/materials/NodeMaterial.d.ts +124 -0
- package/three/src/nodes/materials/PointsNodeMaterial.d.ts +21 -0
- package/three/src/nodes/materials/ShadowNodeMaterial.d.ts +16 -0
- package/three/src/nodes/materials/SpriteNodeMaterial.d.ts +25 -0
- package/three/src/nodes/materials/VolumeNodeMaterial.d.ts +10 -0
- package/three/src/nodes/materialx/MaterialXNodes.d.ts +36 -0
- package/three/src/nodes/materialx/lib/mx_hsv.d.ts +6 -0
- package/three/src/nodes/materialx/lib/mx_noise.d.ts +139 -0
- package/three/src/nodes/materialx/lib/mx_transform_color.d.ts +4 -0
- package/three/src/nodes/math/CondNode.d.ts +18 -0
- package/three/src/nodes/math/HashNode.d.ts +16 -0
- package/three/src/nodes/math/MathNode.d.ts +253 -0
- package/three/src/nodes/math/MathUtils.d.ts +16 -0
- package/three/src/nodes/math/OperatorNode.d.ts +61 -0
- package/three/src/nodes/math/TriNoise3D.d.ts +8 -0
- package/three/src/nodes/pmrem/PMREMNode.d.ts +16 -0
- package/three/src/nodes/procedural/CheckerNode.d.ts +15 -0
- package/three/src/nodes/shadernode/ShaderNode.d.ts +226 -0
- package/three/src/nodes/utils/ArrayElementNode.d.ts +9 -0
- package/three/src/nodes/utils/ConvertNode.d.ts +7 -0
- package/three/src/nodes/utils/DiscardNode.d.ts +17 -0
- package/three/src/nodes/utils/EquirectUVNode.d.ts +8 -0
- package/three/src/nodes/utils/JoinNode.d.ts +10 -0
- package/three/src/nodes/utils/MatcapUVNode.d.ts +8 -0
- package/three/src/nodes/utils/MaxMipLevelNode.d.ts +14 -0
- package/three/src/nodes/utils/OscNode.d.ts +21 -0
- package/three/src/nodes/utils/PackingNode.d.ts +24 -0
- package/three/src/nodes/utils/RTTNode.d.ts +40 -0
- package/three/src/nodes/utils/ReflectorNode.d.ts +32 -0
- package/three/src/nodes/utils/RemapNode.d.ts +24 -0
- package/three/src/nodes/utils/RotateNode.d.ts +18 -0
- package/three/src/nodes/utils/RotateUVNode.d.ts +19 -0
- package/three/src/nodes/utils/SplitNode.d.ts +15 -0
- package/three/src/nodes/utils/SpriteSheetUVNode.d.ts +12 -0
- package/three/src/nodes/utils/StoargeArrayElementNode.d.ts +22 -0
- package/three/src/nodes/utils/TimerNode.d.ts +21 -0
- package/three/src/nodes/utils/TriplanarTexturesNode.d.ts +25 -0
- package/three/src/objects/BatchedMesh.d.ts +193 -0
- package/three/src/objects/Bone.d.ts +36 -0
- package/three/src/objects/Group.d.ts +43 -0
- package/three/src/objects/InstancedMesh.d.ts +175 -0
- package/three/src/objects/LOD.d.ts +104 -0
- package/three/src/objects/Line.d.ts +83 -0
- package/three/src/objects/LineLoop.d.ts +36 -0
- package/three/src/objects/LineSegments.d.ts +37 -0
- package/three/src/objects/Mesh.d.ts +90 -0
- package/three/src/objects/Points.d.ts +62 -0
- package/three/src/objects/Skeleton.d.ts +120 -0
- package/three/src/objects/SkinnedMesh.d.ts +156 -0
- package/three/src/objects/Sprite.d.ts +65 -0
- package/three/src/renderers/WebGL3DRenderTarget.d.ts +29 -0
- package/three/src/renderers/WebGLArrayRenderTarget.d.ts +29 -0
- package/three/src/renderers/WebGLCubeRenderTarget.d.ts +18 -0
- package/three/src/renderers/WebGLRenderTarget.d.ts +8 -0
- package/three/src/renderers/WebGLRenderer.d.ts +516 -0
- package/three/src/renderers/common/Animation.d.ts +13 -0
- package/three/src/renderers/common/Attributes.d.ts +22 -0
- package/three/src/renderers/common/Backend.d.ts +19 -0
- package/three/src/renderers/common/Background.d.ts +23 -0
- package/three/src/renderers/common/BindGroup.d.ts +9 -0
- package/three/src/renderers/common/Binding.d.ts +8 -0
- package/three/src/renderers/common/Bindings.d.ts +35 -0
- package/three/src/renderers/common/Buffer.d.ts +11 -0
- package/three/src/renderers/common/BufferUtils.d.ts +4 -0
- package/three/src/renderers/common/ChainMap.d.ts +9 -0
- package/three/src/renderers/common/ClippingContext.d.ts +23 -0
- package/three/src/renderers/common/Color4.d.ts +10 -0
- package/three/src/renderers/common/ComputePipeline.d.ts +8 -0
- package/three/src/renderers/common/Constants.d.ts +9 -0
- package/three/src/renderers/common/CubeRenderTarget.d.ts +10 -0
- package/three/src/renderers/common/DataMap.d.ts +30 -0
- package/three/src/renderers/common/Geometries.d.ts +31 -0
- package/three/src/renderers/common/Info.d.ts +34 -0
- package/three/src/renderers/common/Pipeline.d.ts +6 -0
- package/three/src/renderers/common/Pipelines.d.ts +53 -0
- package/three/src/renderers/common/PostProcessing.d.ts +21 -0
- package/three/src/renderers/common/ProgrammableStage.d.ts +10 -0
- package/three/src/renderers/common/QuadMesh.d.ts +14 -0
- package/three/src/renderers/common/RenderBundle.d.ts +9 -0
- package/three/src/renderers/common/RenderBundles.d.ts +11 -0
- package/three/src/renderers/common/RenderContext.d.ts +41 -0
- package/three/src/renderers/common/RenderContexts.d.ts +15 -0
- package/three/src/renderers/common/RenderList.d.ts +42 -0
- package/three/src/renderers/common/RenderLists.d.ts +11 -0
- package/three/src/renderers/common/RenderObject.d.ts +61 -0
- package/three/src/renderers/common/RenderObjects.d.ts +31 -0
- package/three/src/renderers/common/RenderPipeline.d.ts +8 -0
- package/three/src/renderers/common/Renderer.d.ts +183 -0
- package/three/src/renderers/common/SampledTexture.d.ts +27 -0
- package/three/src/renderers/common/Sampler.d.ts +11 -0
- package/three/src/renderers/common/StorageBufferAttribute.d.ts +7 -0
- package/three/src/renderers/common/StorageInstancedBufferAttribute.d.ts +8 -0
- package/three/src/renderers/common/StorageTexture.d.ts +5 -0
- package/three/src/renderers/common/Textures.d.ts +67 -0
- package/three/src/renderers/common/Uniform.d.ts +45 -0
- package/three/src/renderers/common/UniformBuffer.d.ts +6 -0
- package/three/src/renderers/common/UniformsGroup.d.ts +23 -0
- package/three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -0
- package/three/src/renderers/common/nodes/NodeBuilderState.d.ts +19 -0
- package/three/src/renderers/common/nodes/NodeSampledTexture.d.ts +24 -0
- package/three/src/renderers/common/nodes/NodeSampler.d.ts +12 -0
- package/three/src/renderers/common/nodes/NodeUniform.d.ts +45 -0
- package/three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +10 -0
- package/three/src/renderers/common/nodes/Nodes.d.ts +98 -0
- package/three/src/renderers/shaders/ShaderChunk.d.ts +143 -0
- package/three/src/renderers/shaders/ShaderLib.d.ts +29 -0
- package/three/src/renderers/shaders/UniformsLib.d.ts +189 -0
- package/three/src/renderers/shaders/UniformsUtils.d.ts +14 -0
- package/three/src/renderers/webgl/WebGLAttributes.d.ts +21 -0
- package/three/src/renderers/webgl/WebGLBindingStates.d.ts +20 -0
- package/three/src/renderers/webgl/WebGLBufferRenderer.d.ts +12 -0
- package/three/src/renderers/webgl/WebGLCapabilities.d.ts +35 -0
- package/three/src/renderers/webgl/WebGLClipping.d.ts +26 -0
- package/three/src/renderers/webgl/WebGLCubeMaps.d.ts +8 -0
- package/three/src/renderers/webgl/WebGLCubeUVMaps.d.ts +9 -0
- package/three/src/renderers/webgl/WebGLExtensions.d.ts +7 -0
- package/three/src/renderers/webgl/WebGLGeometries.d.ts +13 -0
- package/three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +10 -0
- package/three/src/renderers/webgl/WebGLInfo.d.ts +39 -0
- package/three/src/renderers/webgl/WebGLLights.d.ts +49 -0
- package/three/src/renderers/webgl/WebGLObjects.d.ts +6 -0
- package/three/src/renderers/webgl/WebGLProgram.d.ts +30 -0
- package/three/src/renderers/webgl/WebGLPrograms.d.ts +218 -0
- package/three/src/renderers/webgl/WebGLProperties.d.ts +8 -0
- package/three/src/renderers/webgl/WebGLRenderLists.d.ts +52 -0
- package/three/src/renderers/webgl/WebGLShader.d.ts +1 -0
- package/three/src/renderers/webgl/WebGLShadowMap.d.ts +38 -0
- package/three/src/renderers/webgl/WebGLState.d.ts +71 -0
- package/three/src/renderers/webgl/WebGLTextures.d.ts +22 -0
- package/three/src/renderers/webgl/WebGLUniforms.d.ts +12 -0
- package/three/src/renderers/webgl/WebGLUniformsGroups.d.ts +17 -0
- package/three/src/renderers/webgl/WebGLUtils.d.ts +8 -0
- package/three/src/renderers/webgl-fallback/WebGLBackend.d.ts +14 -0
- package/three/src/renderers/webgpu/WebGPUBackend.d.ts +21 -0
- package/three/src/renderers/webgpu/WebGPURenderer.d.ts +10 -0
- package/three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +75 -0
- package/three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +6 -0
- package/three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +6 -0
- package/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +328 -0
- package/three/src/renderers/webxr/WebXRController.d.ts +63 -0
- package/three/src/renderers/webxr/WebXRDepthSensing.d.ts +22 -0
- package/three/src/renderers/webxr/WebXRManager.d.ts +87 -0
- package/three/src/scenes/Fog.d.ts +77 -0
- package/three/src/scenes/FogExp2.d.ts +66 -0
- package/three/src/scenes/Scene.d.ts +118 -0
- package/three/src/textures/CanvasTexture.d.ts +34 -0
- package/three/src/textures/CompressedArrayTexture.d.ts +61 -0
- package/three/src/textures/CompressedCubeTexture.d.ts +9 -0
- package/three/src/textures/CompressedTexture.d.ts +74 -0
- package/three/src/textures/CubeTexture.d.ts +82 -0
- package/three/src/textures/Data3DTexture.d.ts +96 -0
- package/three/src/textures/DataArrayTexture.d.ts +123 -0
- package/three/src/textures/DataTexture.d.ts +92 -0
- package/three/src/textures/DepthTexture.d.ts +85 -0
- package/three/src/textures/FramebufferTexture.d.ts +62 -0
- package/three/src/textures/Source.d.ts +75 -0
- package/three/src/textures/Texture.d.ts +445 -0
- package/three/src/textures/VideoTexture.d.ts +73 -0
- package/three/src/textures/types.d.ts +9 -0
- package/three/src/utils.d.ts +3 -0
- package/three/three.webgpu.d.ts +1 -0
- package/three.webgpu.d.ts +1 -0
- package/three.webgpu.js +63045 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A class for generating a two-dimensional ring geometry.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const geometry = new THREE.RingGeometry(1, 5, 32);
|
|
8
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
9
|
+
* color: 0xffff00,
|
|
10
|
+
* side: THREE.DoubleSide
|
|
11
|
+
* });
|
|
12
|
+
* const mesh = new THREE.Mesh(geometry, material);
|
|
13
|
+
* scene.add(mesh);
|
|
14
|
+
* ```
|
|
15
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/RingGeometry | Official Documentation}
|
|
16
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/RingGeometry.js | Source}
|
|
17
|
+
*/
|
|
18
|
+
export class RingGeometry extends BufferGeometry {
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of {@link RingGeometry}
|
|
21
|
+
* @param innerRadius Expects a `Float`. Default `0.5`.
|
|
22
|
+
* @param outerRadius Expects a `Float`. Default `1`.
|
|
23
|
+
* @param thetaSegments Number of segments. A higher number means the ring will be more round. Minimum is 3. Expects a `Integer`. Default `32`.
|
|
24
|
+
* @param phiSegments Number of segments per ring segment. Minimum is `1`. Expects a `Integer`. Default `1`.
|
|
25
|
+
* @param thetaStart Starting angle. Expects a `Float`. Default `0`.
|
|
26
|
+
* @param thetaLength Central angle. Expects a `Float`. Default `Math.PI * 2`.
|
|
27
|
+
*/
|
|
28
|
+
constructor(innerRadius?: number, outerRadius?: number, thetaSegments?: number, phiSegments?: number, thetaStart?: number, thetaLength?: number);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A Read-only _string_ to check if `this` object type.
|
|
32
|
+
* @remarks Sub-classes will update this value.
|
|
33
|
+
* @defaultValue `RingGeometry`
|
|
34
|
+
*/
|
|
35
|
+
override readonly type: string | 'RingGeometry';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An object with a property for each of the constructor parameters.
|
|
39
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
40
|
+
*/
|
|
41
|
+
readonly parameters: {
|
|
42
|
+
readonly innerRadius: number;
|
|
43
|
+
readonly outerRadius: number;
|
|
44
|
+
readonly thetaSegments: number;
|
|
45
|
+
readonly phiSegments: number;
|
|
46
|
+
readonly thetaStart: number;
|
|
47
|
+
readonly thetaLength: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
static fromJSON(data: {}): RingGeometry;
|
|
52
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
import { Shape } from '../extras/core/Shape.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates an one-sided polygonal geometry from one or more path shapes.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const x = 0, y = 0;
|
|
9
|
+
* const heartShape = new THREE.Shape();
|
|
10
|
+
* heartShape.moveTo(x + 5, y + 5);
|
|
11
|
+
* heartShape.bezierCurveTo(x + 5, y + 5, x + 4, y, x, y);
|
|
12
|
+
* heartShape.bezierCurveTo(x - 6, y, x - 6, y + 7, x - 6, y + 7);
|
|
13
|
+
* heartShape.bezierCurveTo(x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19);
|
|
14
|
+
* heartShape.bezierCurveTo(x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7);
|
|
15
|
+
* heartShape.bezierCurveTo(x + 16, y + 7, x + 16, y, x + 10, y);
|
|
16
|
+
* heartShape.bezierCurveTo(x + 7, y, x + 5, y + 5, x + 5, y + 5);
|
|
17
|
+
* const geometry = new THREE.ShapeGeometry(heartShape);
|
|
18
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
19
|
+
* color: 0x00ff00
|
|
20
|
+
* });
|
|
21
|
+
* const mesh = new THREE.Mesh(geometry, material);
|
|
22
|
+
* scene.add(mesh);
|
|
23
|
+
* ```
|
|
24
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/ShapeGeometry | Official Documentation}
|
|
25
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/ShapeGeometry.js | Source}
|
|
26
|
+
*/
|
|
27
|
+
export class ShapeGeometry extends BufferGeometry {
|
|
28
|
+
/**
|
|
29
|
+
* Create a new instance of {@link ShapeGeometry}
|
|
30
|
+
* @param shapes Array of shapes or a single {@link THREE.Shape | Shape}. Default `new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)])`, _a single triangle shape_.
|
|
31
|
+
* @param curveSegments Number of segments per shape. Expects a `Integer`. Default `12`
|
|
32
|
+
*/
|
|
33
|
+
constructor(shapes?: Shape | Shape[], curveSegments?: number);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A Read-only _string_ to check if `this` object type.
|
|
37
|
+
* @remarks Sub-classes will update this value.
|
|
38
|
+
* @defaultValue `ShapeGeometry`
|
|
39
|
+
*/
|
|
40
|
+
override readonly type: string | 'ShapeGeometry';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* An object with a property for each of the constructor parameters.
|
|
44
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
45
|
+
*/
|
|
46
|
+
readonly parameters: {
|
|
47
|
+
readonly shapes: Shape | Shape[];
|
|
48
|
+
readonly curveSegments: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
static fromJSON(data: {}): ShapeGeometry;
|
|
53
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A class for generating sphere geometries.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const geometry = new THREE.SphereGeometry(15, 32, 16);
|
|
8
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
9
|
+
* color: 0xffff00
|
|
10
|
+
* });
|
|
11
|
+
* const sphere = new THREE.Mesh(geometry, material);
|
|
12
|
+
* scene.add(sphere);
|
|
13
|
+
* ```
|
|
14
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/SphereGeometry | Official Documentation}
|
|
15
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/SphereGeometry.js | Source}
|
|
16
|
+
*/
|
|
17
|
+
export class SphereGeometry extends BufferGeometry {
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of {@link SphereGeometry}
|
|
20
|
+
* @remarks
|
|
21
|
+
* The geometry is created by sweeping and calculating vertexes
|
|
22
|
+
* around the **Y** axis (horizontal sweep) and the **Z** axis (vertical sweep)
|
|
23
|
+
* Thus, incomplete spheres (akin to `'sphere slices'`) can be created
|
|
24
|
+
* through the use of different values of {@link phiStart}, {@link phiLength}, {@link thetaStart} and {@link thetaLength},
|
|
25
|
+
* in order to define the points in which we start (or end) calculating those vertices.
|
|
26
|
+
* @param radius Sphere radius. Expects a `Float`. Default `1`
|
|
27
|
+
* @param widthSegments Number of horizontal segments. Minimum value is 3, and the Expects a `Integer`. Default `32`
|
|
28
|
+
* @param heightSegments Number of vertical segments. Minimum value is 2, and the Expects a `Integer`. Default `16`
|
|
29
|
+
* @param phiStart Specify horizontal starting angle. Expects a `Float`. Default `0`
|
|
30
|
+
* @param phiLength Specify horizontal sweep angle size. Expects a `Float`. Default `Math.PI * 2`
|
|
31
|
+
* @param thetaStart Specify vertical starting angle. Expects a `Float`. Default `0`
|
|
32
|
+
* @param thetaLength Specify vertical sweep angle size. Expects a `Float`. Default `Math.PI`
|
|
33
|
+
*/
|
|
34
|
+
constructor(radius?: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A Read-only _string_ to check if `this` object type.
|
|
38
|
+
* @remarks Sub-classes will update this value.
|
|
39
|
+
* @defaultValue `SphereGeometry`
|
|
40
|
+
*/
|
|
41
|
+
override readonly type: string | 'SphereGeometry';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* An object with a property for each of the constructor parameters.
|
|
45
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
46
|
+
*/
|
|
47
|
+
readonly parameters: {
|
|
48
|
+
readonly radius: number;
|
|
49
|
+
readonly widthSegments: number;
|
|
50
|
+
readonly heightSegments: number;
|
|
51
|
+
readonly phiStart: number;
|
|
52
|
+
readonly phiLength: number;
|
|
53
|
+
readonly thetaStart: number;
|
|
54
|
+
readonly thetaLength: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
static fromJSON(data: {}): SphereGeometry;
|
|
59
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PolyhedronGeometry } from './PolyhedronGeometry.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A class for generating a tetrahedron geometries.
|
|
5
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/TetrahedronGeometry | Official Documentation}
|
|
6
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TetrahedronGeometry.js | Source}
|
|
7
|
+
*/
|
|
8
|
+
export class TetrahedronGeometry extends PolyhedronGeometry {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new instance of {@link TetrahedronGeometry}
|
|
11
|
+
* @param radius Radius of the tetrahedron. Expects a `Float`. Default `1`
|
|
12
|
+
* @param detail Setting this to a value greater than 0 adds vertices making it no longer a tetrahedron. Expects a `Integer`. Default `0`
|
|
13
|
+
*/
|
|
14
|
+
constructor(radius?: number, detail?: number);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Read-only _string_ to check if `this` object type.
|
|
18
|
+
* @remarks Sub-classes will update this value.
|
|
19
|
+
* @defaultValue `TetrahedronGeometry`
|
|
20
|
+
*/
|
|
21
|
+
override readonly type: string | 'TetrahedronGeometry';
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
static fromJSON(data: {}): TetrahedronGeometry;
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A class for generating torus geometries.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const geometry = new THREE.TorusGeometry(10, 3, 16, 100);
|
|
8
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
9
|
+
* color: 0xffff00
|
|
10
|
+
* });
|
|
11
|
+
* const torus = new THREE.Mesh(geometry, material);
|
|
12
|
+
* scene.add(torus);
|
|
13
|
+
* ```
|
|
14
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/TorusGeometry | Official Documentation}
|
|
15
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TorusGeometry.js | Source}
|
|
16
|
+
*/
|
|
17
|
+
export class TorusGeometry extends BufferGeometry {
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of {@link TorusGeometry}
|
|
20
|
+
* @param radius Radius of the torus, from the center of the torus to the center of the tube. Expects a `Float`. Default `1`.
|
|
21
|
+
* @param tube Radius of the tube. Expects a `Float`. Default `0.4`.
|
|
22
|
+
* @param radialSegments Expects a `Integer`.Default is `12`.
|
|
23
|
+
* @param tubularSegments Expects a `Integer`. Default `48`.
|
|
24
|
+
* @param arc Central angle. Expects a `Float`. Default `Math.PI * 2`
|
|
25
|
+
*/
|
|
26
|
+
constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Read-only _string_ to check if `this` object type.
|
|
30
|
+
* @remarks Sub-classes will update this value.
|
|
31
|
+
* @defaultValue `TorusGeometry`
|
|
32
|
+
*/
|
|
33
|
+
override readonly type: string | 'TorusGeometry';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An object with a property for each of the constructor parameters.
|
|
37
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
38
|
+
*/
|
|
39
|
+
readonly parameters: {
|
|
40
|
+
readonly radius: number;
|
|
41
|
+
readonly tube: number;
|
|
42
|
+
readonly radialSegments: number;
|
|
43
|
+
readonly tubularSegments: number;
|
|
44
|
+
readonly arc: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
static fromJSON(data: any): TorusGeometry;
|
|
49
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a torus knot, the particular shape of which is defined by a pair of coprime integers, p and q
|
|
5
|
+
* If p and q are not coprime, the result will be a torus link.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const geometry = new THREE.TorusKnotGeometry(10, 3, 100, 16);
|
|
9
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
10
|
+
* color: 0xffff00
|
|
11
|
+
* });
|
|
12
|
+
* const torusKnot = new THREE.Mesh(geometry, material);
|
|
13
|
+
* scene.add(torusKnot);
|
|
14
|
+
* ```
|
|
15
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/TorusKnotGeometry | Official Documentation}
|
|
16
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TorusKnotGeometry.js | Source}
|
|
17
|
+
*/
|
|
18
|
+
export class TorusKnotGeometry extends BufferGeometry {
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of {@link TorusKnotGeometry}
|
|
21
|
+
* @param radius Radius of the torus.. Default `1`.
|
|
22
|
+
* @param tube Expects a `Float`. Default `0.4`.
|
|
23
|
+
* @param tubularSegments Expects a `Integer`. Default `64`.
|
|
24
|
+
* @param radialSegments Expects a `Integer`. Default `8`.
|
|
25
|
+
* @param p This value determines, how many times the geometry winds around its axis of rotational symmetry. Expects a `Integer`. Default `2`.
|
|
26
|
+
* @param q This value determines, how many times the geometry winds around a circle in the interior of the torus. Expects a `Integer`. Default `3`.
|
|
27
|
+
*/
|
|
28
|
+
constructor(radius?: number, tube?: number, tubularSegments?: number, radialSegments?: number, p?: number, q?: number);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A Read-only _string_ to check if `this` object type.
|
|
32
|
+
* @remarks Sub-classes will update this value.
|
|
33
|
+
* @defaultValue `TorusKnotGeometry`
|
|
34
|
+
*/
|
|
35
|
+
override readonly type: string | 'TorusKnotGeometry';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* An object with a property for each of the constructor parameters.
|
|
39
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
40
|
+
*/
|
|
41
|
+
readonly parameters: {
|
|
42
|
+
readonly radius: number;
|
|
43
|
+
readonly tube: number;
|
|
44
|
+
readonly tubularSegments: number;
|
|
45
|
+
readonly radialSegments: number;
|
|
46
|
+
readonly p: number;
|
|
47
|
+
readonly q: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
static fromJSON(data: {}): TorusKnotGeometry;
|
|
52
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
import { Curve } from '../extras/core/Curve.js';
|
|
3
|
+
import { Vector3 } from '../math/Vector3.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a tube that extrudes along a 3d curve.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* class CustomSinCurve extends THREE.Curve {
|
|
10
|
+
* constructor(scale = 1) {
|
|
11
|
+
* super();
|
|
12
|
+
* this.scale = scale;
|
|
13
|
+
* }
|
|
14
|
+
* getPoint(t, optionalTarget = new THREE.Vector3()) {
|
|
15
|
+
* const tx = t * 3 - 1.5;
|
|
16
|
+
* const ty = Math.sin(2 * Math.PI * t);
|
|
17
|
+
* const tz = 0;
|
|
18
|
+
* return optionalTarget.set(tx, ty, tz).multiplyScalar(this.scale);
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* const path = new CustomSinCurve(10);
|
|
22
|
+
* const geometry = new THREE.TubeGeometry(path, 20, 2, 8, false);
|
|
23
|
+
* const material = new THREE.MeshBasicMaterial({
|
|
24
|
+
* color: 0x00ff00
|
|
25
|
+
* });
|
|
26
|
+
* const mesh = new THREE.Mesh(geometry, material);
|
|
27
|
+
* scene.add(mesh);
|
|
28
|
+
* ```
|
|
29
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/TubeGeometry | Official Documentation}
|
|
30
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/TubeGeometry.js | Source}
|
|
31
|
+
*/
|
|
32
|
+
export class TubeGeometry extends BufferGeometry {
|
|
33
|
+
/**
|
|
34
|
+
* Create a new instance of {@link TubeGeometry}
|
|
35
|
+
* @param path A 3D path that inherits from the {@link THREE.Curve | Curve} base class.
|
|
36
|
+
* Default {@link THREE.QuadraticBezierCurve3 | new THREE.QuadraticBezierCurve3(new Vector3(-1, -1, 0 ), new Vector3(-1, 1, 0), new Vector3(1, 1, 0))}.
|
|
37
|
+
* @param tubularSegments The number of segments that make up the tube. Expects a `Integer`. Default `64`.
|
|
38
|
+
* @param radius The radius of the tube. Expects a `Float`. Default `1`.
|
|
39
|
+
* @param radialSegments The number of segments that make up the cross-section. Expects a `Integer`. Default `8`.
|
|
40
|
+
* @param closed Is the tube open or closed. Default `false`.
|
|
41
|
+
*/
|
|
42
|
+
constructor(path?: Curve<Vector3>, tubularSegments?: number, radius?: number, radialSegments?: number, closed?: boolean);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A Read-only _string_ to check if `this` object type.
|
|
46
|
+
* @remarks Sub-classes will update this value.
|
|
47
|
+
* @defaultValue `TubeGeometry`
|
|
48
|
+
*/
|
|
49
|
+
override readonly type: string | 'TubeGeometry';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An object with a property for each of the constructor parameters.
|
|
53
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
54
|
+
*/
|
|
55
|
+
readonly parameters: {
|
|
56
|
+
readonly path: Curve<Vector3>;
|
|
57
|
+
readonly tubularSegments: number;
|
|
58
|
+
readonly radius: number;
|
|
59
|
+
readonly radialSegments: number;
|
|
60
|
+
readonly closed: boolean;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* An array of {@link THREE.Vector3 | Vector3} tangents
|
|
65
|
+
*/
|
|
66
|
+
tangents: Vector3[];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* An array of {@link THREE.Vector3 | Vector3} normals
|
|
70
|
+
*/
|
|
71
|
+
normals: Vector3[];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* An array of {@link THREE.Vector3 | Vector3} binormals
|
|
75
|
+
*/
|
|
76
|
+
binormals: Vector3[];
|
|
77
|
+
|
|
78
|
+
/** @internal */
|
|
79
|
+
static fromJSON(data: {}): TubeGeometry;
|
|
80
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This can be used as a helper object to view a {@link BufferGeometry | geometry} as a wireframe.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const geometry = new THREE.SphereGeometry(100, 100, 100);
|
|
8
|
+
* const wireframe = new THREE.WireframeGeometry(geometry);
|
|
9
|
+
* const line = new THREE.LineSegments(wireframe);
|
|
10
|
+
* line.material.depthTest = false;
|
|
11
|
+
* line.material.opacity = 0.25;
|
|
12
|
+
* line.material.transparent = true;
|
|
13
|
+
* scene.add(line);
|
|
14
|
+
* ```
|
|
15
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_helpers | helpers}
|
|
16
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/WireframeGeometry | Official Documentation}
|
|
17
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/WireframeGeometry.js | Source}
|
|
18
|
+
*/
|
|
19
|
+
export class WireframeGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
|
|
20
|
+
/**
|
|
21
|
+
* Create a new instance of {@link WireframeGeometry}
|
|
22
|
+
* @param geometry Any geometry object. Default `null`.
|
|
23
|
+
*/
|
|
24
|
+
constructor(geometry?: TBufferGeometry);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A Read-only _string_ to check if `this` object type.
|
|
28
|
+
* @remarks Sub-classes will update this value.
|
|
29
|
+
* @defaultValue `WireframeGeometry`
|
|
30
|
+
*/
|
|
31
|
+
override readonly type: string | 'WireframeGeometry';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* An object with a property for each of the constructor parameters.
|
|
35
|
+
* @remarks Any modification after instantiation does not change the geometry.
|
|
36
|
+
*/
|
|
37
|
+
readonly parameters: {
|
|
38
|
+
readonly geometry: TBufferGeometry;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Object3D } from '../core/Object3D.js';
|
|
2
|
+
import { ColorRepresentation } from '../math/Color.js';
|
|
3
|
+
import { Vector3 } from '../math/Vector3.js';
|
|
4
|
+
import { Line } from '../objects/Line.js';
|
|
5
|
+
import { Mesh } from '../objects/Mesh.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* An 3D arrow object for visualizing directions.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const dir = new THREE.Vector3(1, 2, 0);
|
|
12
|
+
* //normalize the direction vector (convert to vector of length 1)
|
|
13
|
+
* dir.normalize();
|
|
14
|
+
* const origin = new THREE.Vector3(0, 0, 0);
|
|
15
|
+
* const length = 1;
|
|
16
|
+
* const hex = 0xffff00;
|
|
17
|
+
* const {@link ArrowHelper} = new THREE.ArrowHelper(dir, origin, length, hex);
|
|
18
|
+
* scene.add(arrowHelper);
|
|
19
|
+
* ```
|
|
20
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_shadowmesh | WebGL / shadowmesh}
|
|
21
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/ArrowHelper | Official Documentation}
|
|
22
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/ArrowHelper.js | Source}
|
|
23
|
+
*/
|
|
24
|
+
export class ArrowHelper extends Object3D {
|
|
25
|
+
/**
|
|
26
|
+
* Create a new instance of {@link ArrowHelper}
|
|
27
|
+
* @param dir Direction from origin. Must be a unit vector. Default `new THREE.Vector3(0, 0, 1)`
|
|
28
|
+
* @param origin Point at which the arrow starts. Default `new THREE.Vector3(0, 0, 0)`
|
|
29
|
+
* @param length Length of the arrow. Default `1`
|
|
30
|
+
* @param hex Hexadecimal value to define color. Default `0xffff00`
|
|
31
|
+
* @param headLength The length of the head of the arrow. Default `0.2 * length`
|
|
32
|
+
* @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
|
|
33
|
+
*/
|
|
34
|
+
constructor(dir?: Vector3, origin?: Vector3, length?: number, color?: ColorRepresentation, headLength?: number, headWidth?: number);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A Read-only _string_ to check if `this` object type.
|
|
38
|
+
* @remarks Sub-classes will update this value.
|
|
39
|
+
* @override
|
|
40
|
+
* @defaultValue `ArrowHelper`
|
|
41
|
+
*/
|
|
42
|
+
override readonly type: string | 'ArrowHelper';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Contains the line part of the arrowHelper.
|
|
46
|
+
*/
|
|
47
|
+
line: Line;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Contains the cone part of the arrowHelper.
|
|
51
|
+
*/
|
|
52
|
+
cone: Mesh;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Sets the color of the arrowHelper.
|
|
56
|
+
* @param color The desired color.
|
|
57
|
+
*/
|
|
58
|
+
setColor(color: ColorRepresentation): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @param dir The desired direction. Must be a unit vector.
|
|
62
|
+
*/
|
|
63
|
+
setDirection(dir: Vector3): void;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Sets the length of the arrowhelper.
|
|
67
|
+
* @param length The desired length.
|
|
68
|
+
* @param headLength The length of the head of the arrow. Default `0.2 * length`
|
|
69
|
+
* @param headWidth The width of the head of the arrow. Default `0.2 * headLength`
|
|
70
|
+
*/
|
|
71
|
+
setLength(length: number, headLength?: number, headWidth?: number): void;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Copy the given object into this object
|
|
75
|
+
* @remarks Note: event listeners and user-defined callbacks ({@link onAfterRender | .onAfterRender} and {@link onBeforeRender | .onBeforeRender}) are not copied.
|
|
76
|
+
* @param source
|
|
77
|
+
*/
|
|
78
|
+
override copy(source: this): this;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Frees the GPU-related resources allocated by this instance
|
|
82
|
+
* @remarks
|
|
83
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
84
|
+
*/
|
|
85
|
+
dispose(): void;
|
|
86
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ColorRepresentation } from '../math/Color.js';
|
|
2
|
+
import { LineSegments } from '../objects/LineSegments.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* An axis object to visualize the 3 axes in a simple way.
|
|
6
|
+
* @remarks
|
|
7
|
+
* The X axis is red
|
|
8
|
+
* The Y axis is green
|
|
9
|
+
* The Z axis is blue.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const {@link AxesHelper} = new THREE.AxesHelper(5);
|
|
13
|
+
* scene.add(axesHelper);
|
|
14
|
+
* ```
|
|
15
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_compression | WebGL / buffergeometry / compression}
|
|
16
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_geometry_convex | WebGL / geometry / convex}
|
|
17
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_loader_nrrd | WebGL / loader / nrrd}
|
|
18
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/AxesHelper | Official Documentation}
|
|
19
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/AxesHelper.js | Source}
|
|
20
|
+
*/
|
|
21
|
+
export class AxesHelper extends LineSegments {
|
|
22
|
+
/**
|
|
23
|
+
* Create a new instance of {@link AxesHelper}
|
|
24
|
+
* @param size Size of the lines representing the axes. Default `1`
|
|
25
|
+
*/
|
|
26
|
+
constructor(size?: number);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Read-only _string_ to check if `this` object type.
|
|
30
|
+
* @remarks Sub-classes will update this value.
|
|
31
|
+
* @override
|
|
32
|
+
* @defaultValue `AxesHelper`
|
|
33
|
+
*/
|
|
34
|
+
override readonly type: string | 'AxesHelper';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Sets the axes colors to {@link Color | xAxisColor}, {@link Color | yAxisColor}, {@link Color | zAxisColor}.
|
|
38
|
+
* @param xAxisColor
|
|
39
|
+
* @param yAxisColor
|
|
40
|
+
* @param zAxisColor
|
|
41
|
+
*/
|
|
42
|
+
setColors(xAxisColor: ColorRepresentation, yAxisColor: ColorRepresentation, zAxisColor: ColorRepresentation): this;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Frees the GPU-related resources allocated by this instance
|
|
46
|
+
* @remarks
|
|
47
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
48
|
+
*/
|
|
49
|
+
dispose(): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Box3 } from '../math/Box3.js';
|
|
2
|
+
import { ColorRepresentation } from '../math/Color.js';
|
|
3
|
+
import { LineSegments } from '../objects/LineSegments.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Helper object to visualize a {@link THREE.Box3 | Box3}.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const box = new THREE.Box3();
|
|
10
|
+
* box.setFromCenterAndSize(new THREE.Vector3(1, 1, 1), new THREE.Vector3(2, 1, 3));
|
|
11
|
+
* const helper = new THREE.Box3Helper(box, 0xffff00);
|
|
12
|
+
* scene.add(helper);
|
|
13
|
+
* ```
|
|
14
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/Box3Helper | Official Documentation}
|
|
15
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/Box3Helper.js | Source}
|
|
16
|
+
*/
|
|
17
|
+
export class Box3Helper extends LineSegments {
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new wireframe box that represents the passed Box3.
|
|
20
|
+
* @param box The Box3 to show.
|
|
21
|
+
* @param color The box's color. Default `0xffff00`
|
|
22
|
+
*/
|
|
23
|
+
constructor(box: Box3, color?: ColorRepresentation);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A Read-only _string_ to check if `this` object type.
|
|
27
|
+
* @remarks Sub-classes will update this value.
|
|
28
|
+
* @override
|
|
29
|
+
* @defaultValue `Box3Helper`
|
|
30
|
+
*/
|
|
31
|
+
override readonly type: string | 'Box3Helper';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The Box3 being visualized.
|
|
35
|
+
*/
|
|
36
|
+
box: Box3;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Frees the GPU-related resources allocated by this instance
|
|
40
|
+
* @remarks
|
|
41
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
42
|
+
*/
|
|
43
|
+
dispose(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
+
import { Object3D } from '../core/Object3D.js';
|
|
3
|
+
import { LineBasicMaterial } from '../materials/LineBasicMaterial.js';
|
|
4
|
+
import { ColorRepresentation } from '../math/Color.js';
|
|
5
|
+
import { LineSegments } from '../objects/LineSegments.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Helper object to graphically show the world-axis-aligned bounding box around an object
|
|
9
|
+
* @remarks
|
|
10
|
+
* The actual bounding box is handled with {@link THREE.Box3 | Box3}, this is just a visual helper for debugging
|
|
11
|
+
* It can be automatically resized with the {@link THREE.BoxHelper.update | BoxHelper.update} method when the object it's created from is transformed
|
|
12
|
+
* Note that the object must have a {@link THREE.BufferGeometry | BufferGeometry} for this to work, so it won't work with {@link Sprite | Sprites}.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const sphere = new THREE.SphereGeometry();
|
|
16
|
+
* const object = new THREE.Mesh(sphere, new THREE.MeshBasicMaterial(0xff0000));
|
|
17
|
+
* const box = new THREE.BoxHelper(object, 0xffff00);
|
|
18
|
+
* scene.add(box);
|
|
19
|
+
* ```
|
|
20
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_helpers | WebGL / helpers}
|
|
21
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_loader_nrrd | WebGL / loader / nrrd}
|
|
22
|
+
* @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_drawrange | WebGL / buffergeometry / drawrange}
|
|
23
|
+
* @see {@link https://threejs.org/docs/index.html#api/en/helpers/BoxHelper | Official Documentation}
|
|
24
|
+
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/helpers/BoxHelper.js | Source}
|
|
25
|
+
*/
|
|
26
|
+
export class BoxHelper extends LineSegments<BufferGeometry, LineBasicMaterial> {
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new wireframe box that bounds the passed object
|
|
29
|
+
* @remarks
|
|
30
|
+
* Internally this uses {@link THREE.Box3.setFromObject | Box3.setFromObject} to calculate the dimensions
|
|
31
|
+
* Note that this includes any children.
|
|
32
|
+
* @param object The object3D to show the world-axis-aligned bounding box.
|
|
33
|
+
* @param color Hexadecimal value that defines the box's color. Default `0xffff00`
|
|
34
|
+
*/
|
|
35
|
+
constructor(object: Object3D, color?: ColorRepresentation);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A Read-only _string_ to check if `this` object type.
|
|
39
|
+
* @remarks Sub-classes will update this value.
|
|
40
|
+
* @override
|
|
41
|
+
* @defaultValue `BoxHelper`
|
|
42
|
+
*/
|
|
43
|
+
override readonly type: string | 'BoxHelper';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Updates the helper's geometry to match the dimensions of the object, including any children
|
|
47
|
+
* @remarks
|
|
48
|
+
* See {@link THREE.Box3.setFromObject | Box3.setFromObject}.
|
|
49
|
+
*/
|
|
50
|
+
update(object?: Object3D): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Updates the wireframe box for the passed object.
|
|
54
|
+
* @param object {@link THREE.Object3D | Object3D} to create the helper of.
|
|
55
|
+
*/
|
|
56
|
+
setFromObject(object: Object3D): this;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Frees the GPU-related resources allocated by this instance
|
|
60
|
+
* @remarks
|
|
61
|
+
* Call this method whenever this instance is no longer used in your app.
|
|
62
|
+
*/
|
|
63
|
+
dispose(): void;
|
|
64
|
+
}
|